Multiple values as Input Parameter

Hi All,
I need some help on how to implement
Create or replace Pr( p_id in varchar2)
is
begin
select empname from emp where empid = p_id;
end;
The above will work fine if i pass one value how to handle if i want to pass multiple id's (comma seperated or tab ).
I tried it with dbms_utility.COMMA_TO_TABLE the output is not consistant.
Can some one please give inputs
Thanks

You can give input parameter as a String, then just split by coma seperator or something else...
You can use the following split function in your procedure..
FUNCTION SPLIT (p_in_string VARCHAR2, p_delim VARCHAR2) RETURN t_array 
   IS
      i       number :=0;
      pos     number :=0;
      lv_str  varchar2(50) := p_in_string;
   strings t_array;
   BEGIN
      -- determine first chuck of string  
      pos := instr(lv_str,p_delim,1,1);
      -- while there are chunks left, loop 
      WHILE ( pos != 0) LOOP
         -- increment counter 
         i := i + 1;
         -- create array element for chuck of string 
         strings(i) := substr(lv_str,1,pos);
         -- remove chunk from string 
         lv_str := substr(lv_str,pos+1,length(lv_str));
         -- determine next chunk 
         pos := instr(lv_str,p_delim,1,1);
         -- no last chunk, add to array 
         IF pos = 0 THEN
            strings(i+1) := lv_str;
         END IF;
      END LOOP;
      -- return array 
      RETURN strings;
   END SPLIT; After spliting you will got an array of values... Just use them in loop or wherever you want

Similar Messages

  • Multiple values for the Parameter

    1. Had any tried the selecting MULTIPLE values for the parameter in Oracle Discoverer Plus Releae 4.1 Version 4.1.37.00.0. If so can please let me know how to implement it.
    2. In a Page-Detail Cross Tab workbook, I have to show the weighted average instead of the avg or sum. Any inputs please.
    3. I have to compare two periods (TOP) of datapoints. Any inputs please.

    If you wanted to eliminate the need for users to type in the parameter values, you could create a LOV on the desired column. This will produce a distinct list of all valid values where the user would simply select as the wish. Of course you still need to check the "let user enter multiple values" checkbox if you want them to select more than one.
    -DG

  • Passing multiple values to a parameter in report

    Can anyone help me how to pass multiple parameters to a parameter in my report.
    As user is able to select multiple values from list of values , can I pass the selected values to calling function.
    Suppose if User selects Value1,Value2,Value3 from list of values of a parameter P_Org,
    I need to pass all these values to parameter P_Org in my Before Trigger Function in Discoverer reproting tool.
    Thanks in advance

    I have a Before trigger Function to which the parameters will be passed.
    Suppose if User selects multiple values for a parameter then how to pass these multiple Values to that parameter?
    eg:In first Workbook Before Trigger is fired and the paramters for the trigger are
    'par1','par2','par3' etc.
    If User selects multiple values for a parameter 'par1' from the list of values displayed then how to pass all these values to 'par1' in Function?
    After firing the trigger rows are inserted in a temp_table .My second Workbook will
    fetch the rows inserted in this Temp Table.
    I hope u understood what my requirement is...
    Thanks in advance

  • How to passing multiple values for a parameter of discoverer(url parameters

    Hi All,
    I am trying to pass multiple values for a parameter of disco report. I am trying to include my url for discoverer viewer report. the values has the following
    'jeff,mark'
    'sfophiee,angela'
    Thanks and Regards
    Venkat

    Hello Venkat,
    I know there are some problems with 10.1.2.0.2, maybe if you haven't done yet you can try with 10.1.2.2, assuming this version should be working for multiple parameter values :
    OracleAS Discoverer 10.1.2.2 is installed with the following patch :
    Patch 4960210 PLACEHOLDER BUG FOR AS/DS 10G R2 PATCH SET 2 10.1.2.2
    So, once installed you can try adding your parameter as param_<parameter_name>='sfophiee,angela'
    Hope this helps, otherwise feel free to log a Service Request to Support.
    Best Regards,
    Gianluca

  • Create URL with multiple values for one parameter

    Post Author: cbamberg
    CA Forum: General
    While I have no problems to create the URL to open a report with a single value for a parameter from my Java application, I don't know how to format multiple values for a parameter when I want to pass the "&prompt0=" value. The values I want to pass are numbers, not strings.
    Anyone can help?

    Hi gayatri,
    you need to select both the product id and custname.put a count on the prodid column and write a condition of count>1 and apply it.
    Thanks
    Hari

  • Passing and Parsing Multiple values for 1 Parameter using ASP and reportInterface.ReportParameters

    Post Author: ckwizard77
    CA Forum: Crystal Reports
    HELP!!
    I have been knocking my head against a wall trying to figure out how to pass multiple values to 1 parameter and how to add it to the parameter collection. I have code so if I pass single values for each parameter it works fine. I am passing the parmeters and values in a pipe delimited string through a url where it gets parsed and pass in here.
    Any help would be greatly appreciated.
    Here is the single param code:
    Public Sub SetParamValues(ReportName, strParamName, ParamValue) Dim i,reportInterface, ParamName,strSubReprotName,CurrentValues        Set reportInterface = reportObject.PluginInterface("")      Set reportParameters = result.Item(1).PluginInterface("Report").ReportParameters      For i=1 to reportParameters.Count           if ReportName <>"" then                 strSubReprotName=reportInterface.ReportParameters.Item(i).ReportName               if strSubReprotName=ReportName then                    ParamName = reportInterface.ReportParameters.Item(i).ParameterName                    if ucase(ParamName)=Ucase(strParamName) then                         Set CurrentValues = reportInterface.ReportParameters.Item(i).CurrentValues                         CurrentValues.Clear()                         Dim newSingleParameter                         Set newSingleParameter = ReportInterface.ReportParameters.Item(i).CreateSingleValue                         newSingleParameter.Value = ParamValue                         reportInterface.ReportParameters.Item(i).CurrentValues.Add newSingleParameter                         reportInterface.ReportParameters.Item(i).PromptOnDemandViewing=false                         iStore.Commit result                    End if               End if          Else               ParamName = reportInterface.ReportParameters.Item(i).ParameterName               Set param1 = reportInterface.ReportParameters.Item(i)               if Ucase(ParamName)=UCase(strParamName) then                     Set CurrentValues = reportInterface.ReportParameters.Item(i).CurrentValues                    CurrentValues.Clear()                    Set newSingleParameter = ReportInterface.ReportParameters.Item(i).CreateSingleValue                    newSingleParameter.Value = ParamValue                    reportInterface.ReportParameters.Item(i).CurrentValues.Add newSingleParameter                    reportInterface.ReportParameters.Item(i).PromptOnDemandViewing=false                    iStore.Commit result                End if         End if      NextEnd Sub

    That Makes sense.
    thanks a lot !
    Well now are at it, mind if I ask you another quick question:
    If I make an option in the multiselect list called ALL which should return all the results:
    as should act like this
    select * from dept;
    you solution was:
    select * from dept
    where INSTR(':'||:P1_EMPNO||':', ':'||empno ||':') > 0
    Can I modify this to return all the rows ?

  • Passing multiple values in a parameter through IN operator

    hello everyone,
    i want to know wheather it is possible to pass multiple values to a report parameter and use the parameter in the query with the IN operator.
    I feel this should be possible but dont know the way.
    Pls help

    i have also suffered from this problem. you can solve it by creating a table like
    create table abc
    id number,
    value number;
    then follow the steps.
    1) insert all the values in this table by incrementing id and values
    2) then pass lowest id and larget id to the report
    3) now in report use the select statement like
    SELECT * FROM AAA WHERE ABC IN (SELECT VALUE FROM ABC WHERE ID BETWEEN V_MAX AND V_MIN)
    4) IN THE REPORT'S AFTER TRIGGER, YOU HAVE TO DELETE
    THESE TEMPORARILY CREATED ROWS
    LIKE
    DELETE ABC
    WHERE ID BETWEEN V_MAX AND V_MIN;
    SO THIS WILL SOLVE YOUR PROBLEM.

  • Is it possible to pass table type values as input parameter for con prg?

    Hi All,
    Could you please confirm that is it possible to pass table type value as input to concurrent program?
    If possible how to achive this?
    If not possible whether we have any ora doc which is confirming this.
    Any hel will be great.
    Thanks,

    Hi student;
    Please check (http://apps2fusion.com/at/45-as/241-enablingdisabling-concurrent-program-parameters)
    Hope it helps
    Regard
    Helios

  • Need to select one from multiple values from a parameter memory area

    Hello,
    I am accessing transaction CKM3N, and, by using the old/classical debugger, it's possible to see that the parameter ID BDTJ (2nd box of the Period/Year parameter line) contains not one but 2 values (in the old/classical debugger version, go to GOTO->System Areas-> Sap Memory): 
    BDTJ                (  4)G <2009>
                                  L <2008>
    I want to access the value from the line that contains 'L', not 2009, from the one that holds 'G'.
    How do I differentiate between them, how do I access one specific value when a single parameter ID has more than one value assigned to it ?
    Thanks in advance,
    Avraham

    Ah, youre actually asking different things.
    In your topic title, you say youre running separate instances
    In your body text, you say you are under different user/schema
    So tell me, do you have more than one database or not? How many entries in your TNS file?
    I would say, for "multiple database instances"
    SELECT
      a.id, b.id
    FROM
      tableA a
      INNER JOIN
      tableB@OTHER_DATABASE_LINK_NAME b  <--NOTE!
      USING(id)And of course you will have to look up CREATE PUBLIC DATABASE LINK sql..
    Message was edited by:
    charred

  • Running report from command line with multiple value for same parameter

    Hey,
    I know how to run a report from the command line specifying parameters values each time but I was wondering if someone could tell me how I would go about running the same report multiple times in a batch program but specifying a list of values to pass to a parameter each time.
    So for example if a parameter was 'School Number', how could I run a report in a batch program that would pass a school number to the report as a parameter using a list of school numbers generated for a sql statement or something. So if I had 300 school numbers in my list then I would get 300 different reports when the batch program finished.
    This leads me to another question. How can I dynamically change the name of the report generated by the batch to use the school number value passed in, so for example if the value 3 was passed in the name would be something like School 3.pdf, if 4 was passed in the name would be School 4.pdf....etc
    Any help on this?
    Thanks

    Hello,
    Bursting and Distribution may help you ....
    37 Bursting and Distributing a Report
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b13895/orbr_dist.htm
    Regards

  • How to work on multiple values in single parameter

    Hi Guys,
    I want to insert emp record upon selection (more than one value from UI) of applications list for a given empid.
    like below:
    empid        app_id
    123          1
    123          2
    both are in parameters and records need to insert for given empid =123
    can any one help on this.
    Thanks in advance!
    Rgds,
    Lrk

    Thanks for your response.
    Actually from UI when I enter empid = 123 then all list of unchecked app_ids will display. when I check two or more than two checkboxes for app_id, it need to insert respective records associated with empid.
    my proc like below:
    procedure insert_appid
    p_empid in varchar2,
    p_appid varchar2
    is
    cursor c1 is
    select emp_id,app_id from emp_tab where emp_id = p_empid;
    begin
    for i in c1 loop
    if i.emp_id = p_empid then
    update app_ids for given emp_id.
    else
    insert into
    emp_tab
    emp_id,
    app_id
    values
    i.emp_id,
    i.app_id
    end if;
    end loop;
    end insert_appid;
    will it works your query..or can u suggest me for my proc...how to handle if i check more than one checkbox from UI which is passing through p_appid parameter.?

  • Pass multiple values with IN parameter in stored procedure

    CREATE TABLE VTEST_INSERT (
    MY_ID NUMBER,
    COLUMN1 VARCHAR2(50)
    --SELECT * FROM VTEST_INSERT;
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (1,'TEST1');
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (2,'TEST2');
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (3,'TEST3');
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (4,'TEST4');
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (5,'TEST5');
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (1,'TEST6');
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (2,'TEST7');
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (3,'TEST8');
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (4,'TEST9');
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (5,'TEST10');
    CREATE OR REPLACE
    PROCEDURE VTEST_INSERT_SP(vid IN VARCHAR2,vname IN VARCHAR2)
    AS
    BEGIN
    DELETE FROM VTEST_INSERT WHERE MY_ID IN (vid);
    INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (vid,vname);
    END;
    EXEC VTEST_INSERT_SP(1,'TEST999');
    This all works fine above. But I want to be able to pass in multiple vname values. so something like:
    EXEC VTEST_INSERT_SP(1,'TEST999','TEST888','TEST777');
    all help appreciated. thank you.
    This would do multiple inserts each with the same vid and the different vname values.

    Try something like this
    SET SQLBLANKLINES ON;
    ALTER SESSION SET PLSQL_WARNINGS='ENABLE:ALL';
    DROP TABLE vtest_insert;
    CREATE TABLE vtest_insert(vid NUMBER, vname VARCHAR2(20));
    INSERT ALL
       INTO vtest_insert(vid, vname) VALUES(1, 'aaaa')
       INTO vtest_insert(vid, vname) VALUES(1, 'bb')
       INTO vtest_insert(vid, vname) VALUES(1, 'cccccc')
       INTO vtest_insert(vid, vname) VALUES(2, 'ddd')
       INTO vtest_insert(vid, vname) VALUES(2, 'ee')
    SELECT * FROM "PUBLIC".dual;
    SELECT * FROM vtest_insert;
    CREATE OR REPLACE TYPE vnames_tab_ty IS TABLE OF VARCHAR2(20)
    SHOW ERRORS;
    CREATE OR REPLACE PROCEDURE vtest_insert_sp
       p_vid     IN  vtest_insert.vid%TYPE,
       p_vnames  IN  vnames_tab_ty
    AUTHID DEFINER
    IS
    BEGIN
       DELETE FROM vtest_insert WHERE vid = p_vid;
       FORALL idx IN p_vnames.FIRST .. p_vnames.LAST
           INSERT INTO vtest_insert(vid, vname) VALUES(p_vid, p_vnames(idx));
    END vtest_insert_sp;
    SHOW ERRORS;
    <<bk>>
    DECLARE
      vnames vnames_tab_ty;
      vid vtest_insert.vid%TYPE;
    BEGIN
      bk.vid := 1;
      bk.vnames := vnames_tab_ty('vn-01', 'vn-02', 'vn-03');
      vtest_insert_sp(p_vid=>bk.vid, p_vnames=>bk.vnames);
      COMMIT;
      bk.vid := 2;
      bk.vnames := vnames_tab_ty('vn-04', 'vn-05', 'vn-06', 'vn-07');
      vtest_insert_sp(p_vid=>bk.vid, p_vnames=>bk.vnames);
      COMMIT;
    END;
    SELECT * FROM vtest_insert;
    Which produces the following output
    Table created.
    5 rows created.
           VID VNAME
         1 aaaa
         1 bb
         1 cccccc
         2 ddd
         2 ee
    Type created.
    No errors.
    Procedure created.
    No errors.
    PL/SQL procedure successfully completed.
           VID VNAME
         1 vn-01
         1 vn-02
         1 vn-03
         2 vn-04
         2 vn-05
         2 vn-06
         2 vn-07
    7 rows selected.
    SQL>
    Regards,
    Dariyoosh

  • Need to pass field value as input parameter for a task

    I have the following scenario:
    User opens a task from UWL and sees a UI in which a Quote no. is generated, which is saved in the backend. Next time the user comes to this UI(from the same task in his UWL) he should see the Quote no. generated. Also, the data is fetched from backend by calling BAPI which takes the Quote no. as input, which was generated the first time user visited this UI.
    My concern is how can I store this Quote no. in GP, which was generated the first time, so that user sees the data specific to quote no., as relevant for that task.
    Please help.
    Thanks and Regards
    Aanchal

    Hi Srinivasan,
    Thanks for ur quick response.
    I am explaining my issue further.
    User comes to this UI (first time), Quote no. is generated. User fills some other fields( but does not complete whatever he has to) and saves the data to backend. Now user closes the window (task remains in his UWL), but now when he opens the task, he should see the Quote no. which was generated earlier and also data which he saved(by calling BAPI). How can I get this quote no.?
    Can you please explain what you mean by "expose the quote no. at process level"?
    Thanks and Regards
    Aanchal

  • In eCATT, How to mention the values as  input parameter during test script

    Hi,
    1. I am just learning eCATT tool. I created a Test Script by recording my transaction. But if i want to execute the recorded transaction with different data then how to store the values.
    2. How to execute my Test Script created in one client to another client of same server. is it just by mentioning the target system or do we have to do anything in anothere client.
    Lakshmi

    Hi
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0e0ebec-c9da-2910-689e-b1a22a621c7f
    Manoj Shakya.

  • Dynamically Pass a list as input parameter to a Graphical Clac View

    Hi All,
    Can anyone please let me know if it is possible to pass a list of comma separated values as an input parameter to a graphical calculation view and how this list can be parsed inside the view?
    The requirement is to invoke the graphical view using sql script.
    Thanks,
    Goutham

    Hi Goutham,
    Have a look on these documents:
    Using Multiple Values in Input parameter for filtering in Graphical Calculation View
    SAP HANA: Handling Dynamic Select Column List and Multiple values in input parameter
    Regards,
    Krishna Tangudu

Maybe you are looking for

  • Background color output

    Hello experts i have several internal tables which i need to convert into files in background mode this is fine however, i also need some of the rows in the file to be <b>colored </b>with a particular color any idea by which i can achieve this ? the

  • Count the No.of Columns in a Table

    Hi,Is it possible to write a Select statement that returns back the number of columns in a table? Or is there any other way on knowing the number of columns in a table?

  • Mail link to this page...question

    When I select the "Mail link to this page" option in Safari, the Mail compose window opens but it opens behind the main Mail application. Does anyone know what I need to change to correct this please? Thanks

  • HTML code for region position 3

    Hi All, Can i get the HTML code for display point: Region position 3. My requirement is, i have to apply some background color to all the regions which are placed in region position 3.

  • E mails and folders vanish.

    Some folders completely vanish, some folders remain, but with all of the contents missing. Some e mails that I want to keep but havn't moved to a folder will vanish.