Query help Multiple values in condition

Hi,
I am trying to do something like this
SELECT clave_grupo FROM SS_TTABLAS
WHERE CLAVE_GRUPO IN
CASE WHEN (condition) THEN 'v1'
ELSE ('v1','v2',v3')
end
This is the error msg:
ORA-00907: missing right parenthesis
just before ,'v2',v3')
Is it possible?

Hi,
Welcome to the forum!
Here's one way:
SELECT  clave_grupo
FROM      ss_ttablas
WHERE      clave_grupo     = 'v1'
OR     (     clave_grupo     IN ('v2', 'v3')
     AND     NOT condition
;A CASE expression returns a single value. The error in what you posted was that the ELSE branch was trying to return 3 values.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ {message:id=9360002}

Similar Messages

  • Single query return multiple value

    Hi ALL,
    I have a sql query as below :
    select order_number,
    (select decode(hcp.contact_point_purpose,'ABC',hcp.email_address,'CDE',hcp.email_address,null)
    from hz_contact_points,
    hz_parties hz
    WHERE hz.party_id=hcp.owner_table_id) Email
    FROM oe_order_headers_all h
    WHERE h.order_number='102'
    Actually the problem i am facing is the inner select query is returning multiple row , so my main query is erroring out, i need to capture the multiple row.
    in the above example the inner decode statement returning two mail address, i need to capture that, but while executing the whole query it is erroring out as saying single query returns multiple values.
    please help me on this to capture multiple values
    Thanks

    >
    select order_number,
    (select decode(hcp.contact_point_purpose,'ABC',hcp.email_address,'CDE',hcp.email_address,null)
    from hz_contact_points,
    hz_parties hz
    WHERE hz.party_id=hcp.owner_table_id
    /* a join is missing here that points to table oe_order_headers_all h*/) Email
    FROM oe_order_headers_all h
    WHERE h.order_number='102'
    >
    I can see a join missing in your select sub query.
    However, if you you are still getting the single query return multiple value error then you need to replace the sql sub query
    select decode(hcp.contact_point_purpose,'ABC',hcp.email_address,'CDE',hcp.email_address,null)
    from hz_contact_points,
    hz_parties hz
    WHERE hz.party_id=hcp.owner_table_id)by decode(hcp.contact_point_purpose,'ABC',hcp.email_address,'CDE',hcp.email_address,null)
    and join the two tables in you main query..
    Regards
    Biju
    ED: Provide test script and your expected output to get what you want exacly!
    Edited by: biju2012 on Sep 7, 2012 12:06 AM

  • Search help multiple values selection problem

    Hello Friends,
    I am using FM f4_if_int_table_value_request FM to display multiple values on selection screen
    in AT-selection-screen on value request event.
    Multiple values are getting displayed perfectly .
    Then after that I am using DYNP_VALUES_UPDATE FM to return the values back to screen.
    But the problem is in the select-option field . It only picks the last value selected.
    I have a row:
    I EQ 'last value selected from F4 help screen''.
    Is there a way to update multiple rows in the select option selection screen field.
    Thanks.

    Hi Suhas,
    you may try the following:
    TABLES spfli.
    SELECT-OPTIONS: s_carrid FOR spfli-carrid.
    SELECTION-SCREEN: PUSHBUTTON /1(20) but1 USER-COMMAND carr.
    INITIALIZATION.
      but1 = 'Choose CARRID(s)'.
    AT SELECTION-SCREEN.
      CASE sy-ucomm.
        WHEN 'CARR'.
          TYPES: t_return_tab  TYPE ddshretval.
          TYPES: BEGIN OF ty_line,
            carrid   TYPE spfli-carrid,
            carrname TYPE scarr-carrname,
          END OF ty_line.
          DATA: it_list TYPE STANDARD TABLE OF ty_line,
                wa_return_tab TYPE t_return_tab,
                i_return_tab TYPE STANDARD TABLE OF t_return_tab,
                v_repid TYPE sy-repid,
                v_dynnr TYPE sy-dynnr.
          v_repid = sy-repid.
          v_dynnr = sy-dynnr.
          SELECT carrid carrname
          FROM scarr
          INTO TABLE it_list.
          IF sy-subrc = 0.
            CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
              EXPORTING
                retfield        = 'CARRID'
                dynpprog        = v_repid
                dynpnr          = v_dynnr
    *        dynprofield     = 'S_CARRID-LOW'
                value_org       = 'S'
                multiple_choice = 'X'
              TABLES
                value_tab       = it_list
                return_tab      = i_return_tab
              EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
            IF sy-subrc = 0.
              s_carrid-sign = 'I'.
              s_carrid-option = 'EQ'.
              LOOP AT i_return_tab INTO wa_return_tab.
                s_carrid-low = wa_return_tab-fieldval.
                APPEND s_carrid.
              ENDLOOP.
              READ TABLE s_carrid INDEX 1.
            ENDIF.
          ENDIF.
      ENDCASE.
    What I have done is:
    - not linking the result of the F4 search to field S_CARRID-LOW
    - inserting this F4 search into event AT SELECTION SCREEN. This allows to see the select-options filled when its contents are actually populated.
    I hope this helps. Kind regards,
    Alvaro

  • Query for multiple value search

    Hi
    I got struck when I try to construct SQL query to fetch multiple values in WHERE clause.
    SELECT columnName from someTable
    WHERE someValue = {here is the problem, I have multiple values here which I get from some array}
    Is there any way I can put multiple values to where clause?

    here we go
    this????
    SQL> var LIST varchar2(200)
    SQL> EXEC :LIST := '10,20';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL>  SELECT items.EXTRACT('/l/text()').getStringVal() item
      2   FROM TABLE(XMLSEQUENCE(
      3   EXTRACT(XMLTYPE('<all><l>'||
      4   REPLACE(:LIST,',','</l><l>')||'</l></all>')
      5  ,'/all/l'))) items;
    ITEM
    10
    20
    Elapsed: 00:00:00.04
    SQL> ed
    Wrote file afiedt.buf
      1  SELECT empno,
      2         ename
      3    FROM emp
      4   WHERE dno IN (SELECT items.EXTRACT ('/l/text()').getStringVal () item
      5                   FROM TABLE (XMLSEQUENCE (EXTRACT
      6*                   (XMLTYPE ('<all><l>' || REPLACE (:LIST, ',', '</l><l>') || '</l></all>'), '/all/l') ) )
    SQL> /
         EMPNO ENAME
          7934 MILLER
          7839 KING
          7782 CLARK
          7902 FORD
          7876 ADAMS
          7788 SCOTT
          7566 JONES
          7369 SMITH
    8 rows selected.

  • Query Help---DISTINCT values

    Hi..
    I have the following query..
    I'm getting the following o/p...
    Offshore     In-house     1858     616
    Offshore     In-house     1858     615
    Onshore      In-house     1858     611
    Offshore     In-house     1858     923
    Offshore     In-house     1858     613
    Onshore             In-house     1858     941
    Onshore             In-house     1858     940
    Onshore             In-house     1858     890Can I get distinct onshores and offshores values..like in the above case only one in-house for offshore and one in-house for onshore and if there are multiple repeating values for offshore and on shrore..I need only dinstinct values in both offshore and onshore..
    Any help..?
    Edited by: user10280715 on Apr 14, 2009 10:21 AM

    If I have a result set like this..
    Offshore     In-house     1858     616
    Offshore     In-house     1858     615
    Onshore      In-house     1858     611
    Offshore     In-house     1858     923
    Offshore     In-house     1858     613
    Onshore             In-house     1858     941
    Onshore             In-house     1858     940
    Onshore             In-house     1858     890the o/p I'm looking for..
    Offshore     In-house     1858     616
    Onshore             In-house     1858     890If I have different result set like..
    Offshore     In-house     1858     616
    Offshore     In-house     1858     615
    Offshore      aaaaaaaa     1859     611
    Offshore     aaaaaaaa     1859     923
    Offshore     In-house     1858     613
    Onshore             In-house     1858     941
    Onshore             In-house     1858     940
    Onshore             eeeeeee     1860     890
    Onshore             eeeeeee     1860     941I'm looking for..
    Offshore     In-house     1858     616
    Offshore      aaaaaaaa     1859     611
    Onshore             In-house     1858     941
    Onshore             eeeeeee     1860     890Is it possible..

  • Query of multiple counts with conditions or multiple querys

    I have this demo table
    create table qtyrtu
    rtunam varchar2(10) not null,
    entity varchar2(10) not null,
    linked number(3) not null
    Insert into qtyrtu values ('02vh1', 'zdvh', 100);
    Insert into qtyrtu values ('02vh2', 'zdvh', 0);
    Insert into qtyrtu values ('02eh1', 'zdvh', 0);
    Insert into qtyrtu values ('02sh1', 'stvh', 100);
    Insert into qtyrtu values ('02sh1', 'stvh', 0);
    Insert into qtyrtu values ('02sh1', 'stvh', 100);
    Insert into qtyrtu values ('02tx', 'zdch', 100);
    Insert into qtyrtu values ('02ta', 'zdch', 100);And my result expected would be the next one.
    Entity | Count(rtunam linked by 100) | Count (rtunam linked by 0)
    STVH    2   1
    ZDCH    2   0   
    ZDVH    1   2The problem is that I don't know how to query the 0, when I do my query(by column) it shows this:
    select entity, count(rtunam) from qtyrtu where linked = 100 group by entity order by entity asc;
    STVH    2
    ZDCH    2   
    ZDVH    1
    select entity, count(rtunam) from qtyrtu where linked = 0group by entity order by entity asc;
    STVH     1
    ZDVH     2And I need to show all the counts( even the 0)
    Regards

    Hi,
    Thanks for posting the sample data and the results; that really helps!
    Here's one way:
    SELECT    UPPER (entity)                    AS upper_entity
    ,       COUNT (CASE WHEN linked = 100 THEN 1 END)     AS cnt_100
    ,       COUNT (CASE WHEN linked = 0   THEN 1 END)     AS cnt_0
    FROM       qtyrtu
    GROUP BY  entity
    ;It looks like rtunam plays no role in this problem: is that right?
    You already know how to get the separate column results, using a WHERE clause to ignore certain rows, but you can't use a WHERE clause here, because to want to ignore different rows for the two COUNT columns. A CASE expression can be like a WHERE clause that applies only to one column.

  • Query Filter Multiple Value

    Dear expert,
    On the query filter I have u201CTransaction Dateu201D. When prompt to enter the date I picked the operator u201CBetweenu201D. The date I entered ex: u201C05/01/2011u201D and u201C08/31/2011u201D.
    On the report title I need those time frame above. I put the u201CTransaction Dateu201D on my report title.
    However  on the report result I got #MULTIVALUE. Much appreaciate your help.
    Edited by: LToronto on Aug 31, 2011 5:34 PM

    Hi,
    You cannot use minimum or maximum functions, take an example where user has entered dates like 1-1-2000 to 1-1-2012
    but the actaual data may contain values for the dates 9-1-2001 to 2-9-2011 then your report with min and max displays vlaues 9-1-2001 to 2-9-2011 but the actual dates entered by user is different.
    ="Start Date: " + UserResponse("Enter Transaction Date(Start):")+" to  End Date : " + UserResponse("Enter Transaction Date(End):")

  • Query help - max value

    Hello together,
    I have the following example table:
    PERSONID_____BEGINDATE_____ENDDATE_____ROOMID
    1033_________1.10.2009______5.10.2009_____567
    1033_________1.10.2010______5.10.2010_____891
    1041_________2.11.2009______1.12.2009_____123
    1041_________3.12.2010______3.12.2011_____456
    What I need is the line with the highest end date by PERSONID.
    In the example above I would need to see the 2nd and the 4th line.
    This is the query I am using:
    select example.personid, max(example.begindate), max(example.enddate), example.roomid
    from example
    where (example.enddate >= trunc(sysdate))
    group by example.personid, example.roomid
    The problem is it always gives me 4 result lines (in this example). I think because it gets grouped by the roomid, which is distinct in each line, in the example.
    What I actually want is ONE result line, per person, which shows me the highest end date, independently of the room id.
    Can someone please point me in the right direction? Using max(date) is correct?
    Thank you very much in advance.

    Hi,
    Welcome to the forum!
    The most versatile way is:
    WITH     got_r_num     AS
         SELECT     e.*
         ,     ROW_NUMBER () OVER ( PARTITION BY  personid
                                   ORDER BY          enddate     DESC
                           ) AS r_num
         FROM    example      e
         WHERE     enddate      >= TRUNC (SYSDATE)
    SELECT  *     -- Or list all columns except r_num
    FROM     got_r_num
    WHERE     r_num     = 1
    ;What do you want to do in case of a tie? For example, what if both rows for personid=1033 had the same enddate?
    The query above would pick one of them arbitarily.
    If you want both of them, then change ROW_NUMBER to RANK.
    If you want to add a tie-breaker (e.g., pick the one with the latest begindate), then add more columns to the analytic ORDER BY clause.
    Edited by: Frank Kulash on Sep 15, 2009 2:12 PM
    Added <tt>WHERE     enddate     >= TRUNC (SYSDATE)</tt> condition

  • Hi how will get subquery returns multiple values for main query

    Hi all ;
    here i given one sql query
    1)select decode(a.FLG,'Y','yes','N','no','null')||'] '||a.p_type||' : '|| initcap(replace(substr(b.mgr,0,instr(b.mgr,'@')-1),'.',' '))||' - '||
    b.name||' ('|| substr(a.name,0,instr(a.name,'-')-1)||')'
    from table1 a
    join table3 c on c.emptype = a.emptype
    left outer join table2 b on a.name = b.name
    where a.mgrid = 100;
    if i run this above query returning multiple values depend on sa.mgr values.
    like output coming like this
    yes:2000-anbarasan
    yes:2700-anb
    yes:2000-rasan
    yes:2807-anbarasan
    yes:2700-anbanu
    yes:2000-null
    2) this sub query i am passing with main query
    select sa.mgrid,sa.sal,(select decode(a.FLG,'Y','yes','N','no','null')||'] '||a.p_type||' : '||
    initcap(replace(substr(b.mgr,0,instr(b.mgr,'@')-1),'.',' '))||' - '||
    b .name||' ('|| substr(a.name,0,instr(a.name,'-')-1)||')'
    from table1 a
    join table3 c on c.emptype = a.emptype
    left outer join table2 b on a.name = b.name
    where a.mgrid = 100)" test " from table4 sa,table5 te ,table6 ft where sa.id(+)=te.id and sa.mgr=ft.mgr;
    my final out put required like this:
    mgrid sal test
    100 20000 yes:2000-anbarasan
    yes:2700-anb
    yes:2000-rasan
    yes:2807-anbarasan
    yes:2700-anbanu
    yes:2000-null
    but i am getting erro:
    1)missing paranths
    2)single row subquery return more then one row.
    hi kindly give me answer to me as soon as possible
    Edited by: anbarasan on Sep 29, 2008 9:48 PM

    I refuse to read all of that code and guess what error message you are getting. Apparently others feel the same way.
    Run the final SQL statement and then cut and paste the code and full error statement into a post.
    Also include your full version number to three decimal places.
    My refusal is not an unwillingness to help you but rather an unwillingness to spend 10 minutes reconstructing what you could have pasted in in a fraction of a second. We are all volunteers here and there are many people that need help. I hope you understand.

  • How will get subquery return multiple values and passing to the main query

    Hi all ;
    here i given one sql query
    1)select decode(a.FLG,'Y','yes','N','no','null')||'] '||a.p_type||' : '|| initcap(replace(substr(b.mgr,0,instr(b.mgr,'@')-1),'.',' '))||' - '||
    b.name||' ('|| substr(a.name,0,instr(a.name,'-')-1)||')'
    from table1 a
    join table3 c on c.emptype = a.emptype
    left outer join table2 b on a.name = b.name
    where a.mgrid = 100;
    if i run this above query returning multiple values depend on sa.mgr values.
    like output coming like this
    [yes]:2000-anbarasan
    [yes]:2700-anb
    [yes]:2000-rasan
    [yes]:2807-anbarasan
    [yes]:2700-anbanu
    [yes]:2000-null
    2) this sub query i am passing with main query
    select sa.mgrid,sa.sal,(select decode(a.FLG,'Y','yes','N','no','null')||'] '||a.p_type||' : '||
    initcap(replace(substr(b.mgr,0,instr(b.mgr,'@')-1),'.',' '))||' - '||
    b .name||' ('|| substr(a.name,0,instr(a.name,'-')-1)||')'
    from table1 a
    join table3 c on c.emptype = a.emptype
    left outer join table2 b on a.name = b.name
    where a.mgrid = 100)" test " from table4 sa,table5 te ,table6 ft where sa.id(+)=te.id and sa.mgr=ft.mgr;
    my final out put required like this:
    mgrid sal test
    100 20000 [yes]:2000-anbarasan
    [yes]:2700-anb
    [yes]:2000-rasan
    [yes]:2807-anbarasan
    [yes]:2700-anbanu
    [yes]:2000-null
    but i am getting erro:
    1)missing paranths-it solved
    2)single row subquery return more then one row.
    give me the correct solution.how will solve this problem
    Edited by: anbarasan on Sep 29, 2008 6:49 AM
    Edited by: anbarasan on Sep 29, 2008 6:51 AM
    Edited by: anbarasan on Sep 29, 2008 6:53 AM
    Edited by: anbarasan on Sep 29, 2008 6:56 AM
    Edited by: anbarasan on Sep 29, 2008 6:58 AM

    Hi,
    It doesn't look like you posted either the complete query or the complete error message (including line number). Try again.
    "single row subquery return more then one row" usually means you are using a sub-query in a place where a single expression is expected, for example the column called avg_sal in this query:
    SELECT  ename
    ,       sal
    ,       (SELECT  AVG (sal) FROM scott.dept WHERE deptno = e.deptno) AS avg_sal  -- Scalar-sub-query
    FROM    scott.emp  e; The error occurs when the sub-query returns more than one row
    If the sub-querry really is supoosed to be returning only one row, the solution is to fix the sub-query, usually be adding something to the WHERE clause.
    If the sub-query is supposed to return more than one row, then the main query has to be re-written, perhaps as a join.
    Post a little sample data and the results you want from that data if you need help.

  • Updating a table with a query that return multiple values

    Hi,
    I'm trying to update a table which contain these fields : ItemID, InventoryID, total amounts
    with a query that return these values itemId, inventoryid and total amounts for each items
    Mind you, not all the rows in the table need to be updated. only a few.
    This what i wrote but doesn't work since the query return multiple values so i can't assign it to journalAmounts.
    UPDATE [bmssa].[etshortagetemp]
    SET JournalAmounts = (SELECT sum(b.BomQty) FROM [bmssa].[Bom] b
    JOIN [bmssa].[SalesLine] sl ON sl.ItemBomId = b.BomId
    JOIN [bmssa].[SalesTable] st ON st.SalesId = sl.SalesId
    WHERE st.SalesType = 0 AND (st.SalesStatus IN (0,1,8,12,13)) AND st.DataAreaId = 'sdi'
    GROUP BY b.itemid, b.inventdimid)
    Any advise how to do this task?

    Remember that link to the documentation posted above that explains exactly how to do this. When you read it which part exactly were you having trouble with?

  • Using multiple values in a where clause, for values only known at runtime

    Dear all
    I am creating a PL/SQL program which returns multiple rows of data but only where it meets a set id values that a user has previously chosen. The id values are stored in an associative array and are chosen by a user in the preceding procedure at run time.
    I know all the table and column names in advance. The only things I don't know are the exact number of ids selected from the id column and what their values will be. This will only be known at runtime. When the procedure is run by the user it prints multiple rows of data to a web browser.
    I have been reading the following posting, which I understand to a large extent, Query for multiple value search But I cannot seem to figure out how I would apply it to my work as I am dealing with multiple rows and a cursor.
    The code as I have currently written it is wrong because I get an error not found message in my web browser. I think the var_user_chosen_map_list_ids in the for cursor loop could be the problem. I am using the variable_user_chosen_map_list_ids to store all the id values from my associatative array as a string. Which I modified from the code that vidyadhars posted in the other thread.
    Should I be creating a OPEN FOR ref cursor and if so where would I put my associative array into it? At the moment I take the value, turning it into a string and IN part in the WHERE clause holds the string, allowing the WHERE clause to read all the values from it. I would expect the where clause to read everything in the string as 1 complete string of VARCHAR2 data but this would not be the case if this part of the code at least was correct. The code is as follows:
    --Global variable section contains:
    var_user_chosen_map_list_ids VARCHAR2(32767);
    PROCEDURE PROCMAPSEARCH (par_user_chosen_map_list_ids PKG_ARR_MAPS.ARR_MAP_LIST)
    IS
    CURSOR cur_map_search (par_user_chosen_map_list_ids IN NUMBER)
    IS
    SELECT MI.map_date
           MT.map_title,
    FROM map_info MI,
         map_title MT,
    WHERE MI.map_title_id = MT.map_title_id
    AND MI.map_publication_id IN
    (var_user_chosen_map_list_ids);
    var_map_list_to_compare VARCHAR2(32767) := '';
    var_exe_imm_map VARCHAR2(32767);
    BEGIN
    FOR rec_user_chosen_map_list_ids IN 1 .. par_user_chosen_map_list_ids.count
    LOOP
       var_user_chosen_map_list_ids := var_user_chosen_map_list_ids ||
       '''' ||
       par_user_chosen_map_list_ids(rec_user_chosen_map_list_ids) ||
    END LOOP;
    var_user_chosen_map_list_ids := substr(var_user_chosen_map_list_ids,
                                            1,
                                            length(var_user_chosen_map_list_ids)-1);
    var_exe_imm_map := 'FOR rec_search_entered_details IN cur_map_search
    LOOP
    htp.print('Map date: ' || cur_map_search.map_date || ' Map title: ' || cur_map_search.map_title)
    END LOOP;';
    END PROCMAPSEARCH;EXECUTE IMMEDIATE var_exe_imm_map;
    I would be grateful of any comments or advice.
    Kind regards
    Tim

    I would like to thank everyone for their kind help.
    I have now successfully converted my code for use with dynamic SQL. Part of my problem was getting the concept confused a little, especially as I could get everything work in a static cursor, including variables, as long as they did not contain multiple values. I have learnt that dynamic sql runs the complete select statement at runtime. However even with this I was getting concepts confused. For example I was including variables and the terminator; inside my select string, where as these should be outside it. For example the following is wrong:
         TABLE (sys.dbms_debug_vc2coll(par_user_chosen_map_list_ids))....
    AND MI.map_publication_id = column_value;';Where as the following is correct:
         TABLE (sys.dbms_debug_vc2coll('||par_user_chosen_map_list_ids||'))....
    AND MI.map_publication_id = column_value';PL/SQL is inserting the values and then running the select statement, as opposed to running the select statement with the variables and then accessing the values stored in those variables. Once I resolved that it worked. My revised code is as follows:
    --Global variable section contains:
    var_user_chosen_map_list_ids VARCHAR2(32767);
    var_details VARCHAR(32767);
    PROCEDURE PROCMAPSEARCH (par_user_chosen_map_list_ids PKG_ARR_MAPS.ARR_MAP_LIST)
    IS
    BEGIN
    FOR rec_user_chosen_map_list_ids IN 1 .. par_user_chosen_map_list_ids.count
    LOOP
       var_user_chosen_map_list_ids := var_user_chosen_map_list_ids ||
       '''' ||
       par_user_chosen_map_list_ids(rec_user_chosen_map_list_ids) ||
    END LOOP;
    var_user_chosen_map_list_ids := substr(var_user_chosen_map_list_ids,
                                            1,
                                            length(var_user_chosen_map_list_ids)-1);
    var_details := FUNCMAPDATAFIND (var_user_chosen_map_list_ids);
    htp.print(var_details);
    END PROCMAPSEARCH;
    FUNCTION FUNCMAPDETAILS (par_user_chosen_map_list_ids IN VARCHAR2(32767)
    RETURN VARCHAR2
    AS
    TYPE cur_type_map_search IS REF CURSOR;
    cur_map_search cur_type_map_search;
    var_map_date NUMBER(4);
    var_map_title VARCHAR2(32767);
    begin:
    OPEN cur_map_search FOR
    'SELECT MI.map_date,
           MT.map_title
    FROM map_info MI,
         map_title MT,
         TABLE (sys.dbms_debug_vc2coll(' || par_user_chosen_map_list_ids || '))
    WHERE MI.map_title_id = MT.map_title_id
    AND MI.map_publication_id = column_value';
    LOOP
    FETCH cur_map_compare INTO
    var_map_date,
    var_map_title;
    var_details := var_details || 'Map date: '||
                        var_map_date ||
                        'Map title: ' ||
                        var_map_title;
    EXIT WHEN cur_map_compare%NOTFOUND;
    END LOOP;
    RETURN var_details;
    END FUNCMAPDETAILS;Kind regards
    Tim

  • Passing multiple values to a parmeters in SQL Query

    Hi friends,
    I have the following requirement -
    I need to pass multiple values to the parameter 'WHERE hou.name = (:id1)' and the query is copied below for your reference .
    SELECT partno part_num,
         customer customer_name,
         hou.name op_name
         FROM hr_organization_units hou,
         oe_transaction_types_all sot,
         ra_customers rc,
         ra_addresses_all ra,
         ra_site_uses_all rsu,
         oe_order_headers_all h,
         oe_order_lines_all l,pwr_sod50 ps
         WHERE hou.name = (:id1)
    -- and hou.name = (:id4)
    --hou.name in ('CPS FRANCE','CPS GERMANY')
    --and hou.name = (:id1,hou.name)
         and trunc(ps.sch_ship_date) between nvl(:id2,trunc(ps.sch_ship_date)) and nvl(to_date(:id3)+.99999,trunc(ps.sch_ship_date))
         and ps.group_id = 9999999
         and hou.organization_id=h.org_id
         and ps.line_id =l.line_id
         and l.header_id =h.header_id
         and h.invoice_to_org_id=rsu.site_use_id
         and rsu.address_id =ra.address_id
         and ra.customer_id =rc.customer_id
         and h.order_type_id =sot.transaction_type_id
    Looking for your help on this.
    Thanks In Advance.
    Thanks & Regards
    Ramya Nomula

    Hi karthik,
    I am sorry for the wrong updation of my anonymus block.
    My requirement is to pass a multiple values to the parameter in SQL query, and here is the code which is working now for the multiple values with ourt single quotes to the values -
    SELECT partno part_num,
         customer customer_name,
         ps.customer_id customer_id,
         avail_qty avail_qty,
         sch_ship_date schedule_Ship_date,
         so_num order_no,
         h.header_id header_id,
         line_num line_no,
         l.ordered_quantity ordered_quantity,
         scd_qty qty_open,
         s_price unit_price,
         part_flag flag,
         sub_inv subinv,
         sbu,
         hold,
         qoh,
         line_detail_id detail_id,
         picking_line_id,
         picking_line_detail_id,
         rc.customer_name cust_name,
         rc.customer_number customer_number,
         rsu.location location,
         sot.attribute5 order_type,
         ps.line_id line_id,
         h.transactional_curr_code transactional_curr_code,
         hou.name op_name
         FROM hr_organization_units hou,
         oe_transaction_types_all sot,
         ra_customers rc,
         ra_addresses_all ra,
         ra_site_uses_all rsu,
         oe_order_headers_all h,
         oe_order_lines_all l,pwr_sod50 ps
         WHERE ','||:id1||',' like '%,'||hou.name||',%'
         and trunc(ps.sch_ship_date) between nvl(:id2,trunc(ps.sch_ship_date)) and nvl(to_date(:id3)+.99999,trunc(ps.sch_ship_date))
         and ps.group_id = 9999999
         and hou.organization_id=h.org_id
         and ps.line_id =l.line_id
         and l.header_id =h.header_id
         and h.invoice_to_org_id=rsu.site_use_id
         and rsu.address_id =ra.address_id
         and ra.customer_id =rc.customer_id
         and h.order_type_id =sot.transaction_type_id;
    Condition for sending multiple Oprtaing Units -
    WHERE ','||:id1||',' like '%,'||hou.name||',%'
    This above condition is working when i am passing multiple values with out single quotes...but not working for multiple values with single quotes.
    Sample queries tested -
    select 1 from dual where ',aa,bb,cc,' like '%,bb,%' (This is working)
    select 1 from dual where ','aa','bb','cc',' like '%,'bb',%'(This is not working).
    Thanks In Advance!
    Looking for Your Great Help.
    Thanks & Regards
    Ramya Nomula

  • How to use multiple values in an IF condition in RTF

    Hi,
    I have a scenario as mentioned below.
    IF column value in ('A','B')
    display C;
    end if
    IF column value not in ('A','B')
    display D;
    end if
    My query is how to provide multiple values in an IF condition.?
    Thanks,
    Anand

    But suppose "x.jar" needs a library from "y.jar". How do you put another JAR on the classpath of an applet in a Web page?
    <applet code="z.class" archive="a.jar,b.jar,c.jar">

  • Passing multiple values to a BI query

    Hi experts,
    This question has probably been asked a few times, but I have an issue with passing multiple values to a BI query.  Here's the scenario....
    1)  I have created a BI query.  When I test the query in VC I can enter values 1000:1100 in the Infoobject Business Area and I see that the values are passed through OK
    2)  Then I created a form where Business Area is an Input Field
    3)  I linked the form to the BI query and assigned value @Business_area
    3)  A table is linked to the BI query to view my result ( I have set a distinct before my table to view the data by fiscal year period)
    4) When running the VC model, the table show values for 1000 and 1100, but when I enter 1000:1100 and Submit it does not show both the business areas
    There must be something I am missing and I thought it was that in my submit string (between the input form and the BI query) that I should fill in some values (instad of @Business_area). I tried to fill in 1000:1100, but then I get an error saying Invalid time 1000:1100.
    I would really appreciate any help on this issue :-).
    Regards,
    Thomas

    Hi Thomas,
    I wish to enter default values for dates onto the VC form. Ie I have a VC report to display a customer's shipped data. Ship date is a selection field/ input field on the form for the report/ output table.
    At present if a user clicks submit they get all their shipped records from the beginning of time till today. How can I restrict the dates at VC level to past  3months? So if the users don't specify a ship date, they get the past 3 months data, and afterwards they can change it an retrieve all the data or past 2 years as they wish.
    Thanks,
    Jasmine

Maybe you are looking for