Passing in values to a cursor in a package procedure

Hi all
I have a package :- test
i have a procedure in the package :- test_proc
in the procedure i have a cursor
which has a select statement
select jobid,jobname from jobs
where jobcode = p_job_code; -- i think this is wrong
when i execute the package i pass the job code to the package as a parameter which i use in the cursor above
as a parameter i have values(i can select any of the above values )
job code :-
10
20
10,20
how can i pass the values to the cursor in the procedure
it is giving me invaiid number;

Dear abcdxyz!
As already stated you should try this with dynamic SQL. Here is an example for you:
CREATE OR REPLACE PROCEDURE job_cursor(p_job_code VARCHAR2)
IS
  l_jobid      NUMBER(5);
  l_jobname    VARCHAR2(30);
  c_job_cursor INTEGER;
  l_ignore     INTEGER;
BEGIN
  -- open cursor on source table
  c_job_cursor := DBMS_SQL.Open_Cursor;
  -- parse the SELECT statement
  DBMS_SQL.parse(c_job_cursor, 'SELECT jobid, jobname FROM job WHERE job_code IN (' || p_job_code || ')', DBMS_SQL.NATIVE);
  -- define the column type
  DBMS_SQL.Define_Column(c_job_cursor, 1, l_jobid);
  DBMS_SQL.Define_Column(c_job_cursor, 2, l_jobname, 30);
  ignore := DBMS_SQL.Execute(c_job_cursor);
  LOOP
  -- Fetch a row from the source table
    IF DBMS_SQL.Fetch_Rows(c_job_cursor) > 0 THEN
        -- get column values of the row
        DBMS_SQL.Column_Value(c_job_cursor, 1, l_jobid);
        DBMS_SQL.Column_Value(c_job_cursor, 2, l_jobname);
    ELSE
       -- No more rows to copy
      EXIT;
    END IF;
  END LOOP;
  DBMS_OUTPUT.PUT_LINE(l_jobid || ', ' || l_jobname);
  DBMS_SQL.Close_Cursor(c_job_cursor);
EXCEPTION
  WHEN OTHERS THEN
    IF DBMS_SQL.Is_Open(c_job_cursor) THEN
      DBMS_SQL.Close_Cursor(c_job_cursor);
    END IF;
    RAISE;
END;
/Yours sincerely
Florian W.
P.S. I haven't tested this procedure.

Similar Messages

  • How to pass a value to a bind variable in a query report in oracle apex

    Hi Guys,
    I have requirement to send weekly reports via email to some users. The users should receive their own records in the report. The user details is stored in a table. What I am planning to do is to create a report query in oracle apex to generate the report and then run a function/procedure via a scheduler to email the report to respective users. Now my query is ............. is it possible to pass a value (user name) to the report query to pull records of only that user? I know we can have bind variables in the report query but I have no idea how to pass a value for bind variables from a function/procedure.
    Can anyone help me on this issue or suggest a better approach?
    Thanks,
    San

    You need to use dynamic sql
    But please keep in mind that since you're using Oracle you may be better off posting this in some Oracle forums
    This forum is specifically for SQL Server
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Pass a value from a PL/SQL function to a javascript (html header) ? ?

    Hey Guys,
    Have a question regarding how to pass a value from a PL/SQL function to a javascript in the HTML Header.
    I have created a PL/SQL function in my database, which does looping.
    The reason for this is:  On my apex page when the user selects a code, it should display(or highlight buttons) the different project id's present for that particular code.
    example= code 1
    has project id's = 5, 6, 7
    code 2
    has project id's = 7,8
    Thank you for your Help or Suggestions
    Jesh
    The PL/SQL function :
    CREATE OR REPLACE FUNCTION contact_details(ACT_CODE1 IN NUMBER) RETURN VARCHAR2 IS
    Project_codes varchar2(10);
    CURSOR contact_cur IS
    SELECT ACT_CODE,PROJECT_ID
    FROM ACTASQ.ASQ_CONTACT where ACT_CODE = ACT_CODE1;
    currec contact_cur%rowtype;
    NAME: contact_details
    PURPOSE:
    REVISIONS:
    Ver Date Author Description
    1.0 6/25/2009 1. Created this function.
    BEGIN
    FOR currec in contact_cur LOOP
         dbms_output.put_line(currec.PROJECT_ID || '|');
         Project_codes := currec.PROJECT_ID|| '|' ||Project_codes;
    END LOOP;
    RETURN Project_codes;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHEN OTHERS THEN
    -- Consider logging the error and then re-raise
    RAISE;
    END contact_details;
    /

    Jesh:
    I have made the following modifications to your app to get it to work as I thing you need it to.
    1) Changed the source for the HTML Buttons Region(note use of id vs name for the Buttons)
    <script>
    function hilitebtn(val) {
    //gray buttons
    $x('graduate').style.backgroundColor='gray'
    $x('distance').style.backgroundColor='gray'
    $x('career').style.backgroundColor='gray'
    $x('photo').style.backgroundColor='gray'
    //AJAX call to get project-ids
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=GETPROJECTS',0);
    get.addParam('x01',val)
    gReturn = get.get();
    var arr=gReturn.split(':');  //dump into array
    get = null;
    for (i=0;i<arr.length;i++) {
    // alert('val=' + arr);
    if ( arr[i]==5)
    $x('graduate').style.backgroundColor='red';
    if ( arr[i]==6)
    $x('distance').style.backgroundColor='red';
    if ( arr[i]==7)
    $x('career').style.backgroundColor='red';
    if ( arr[i]==8)
    $x('photo').style.backgroundColor='red';
    </script>
    <table cellpadding='0' cellspacing='0' border='0'>
    <tr><td>
    <input type='button' id='graduate' value='Graduate'>
    </td>
    <td>
    <input type='button' id='distance' value='Distance'>
    </td>
    <td>
    <input type='button' id='career' value='Career/Tech'>
    </td>
    <td>
    <input type='button' id='photo' value='Photos'>
    </td>
    </tr></table>
    2) Defined the application process  GETPROJECTS as DECLARE
    IDS varchar2(1000);
    l_act_code varchar2(100) :=4;
    begin
    IDS:='';
    l_act_code := wwv_flow.g_x01;
    for x in(
    SELECT ACT_CODE,PROJECT_ID
    FROM ASQ_CONTACT
    where ACT_CODE = l_act_code)
    LOOP
    IDS := IDS || X.PROJECT_ID|| ':' ;
    END LOOP;
    HTP.PRN(IDS);
    END;
    3) Changed the 'onchange' event-handler on p1_act_code to be 'onchange=hilitebtn(this.value)'
    4) Added the JS to the HTML Page Footer <script>
    hilitebtn($v('P1_ACT_CODE'));
    </SCRIPT>

  • How to pass input value to the IN parameter in a function

    Hi ,
    I'm new to pl/sql programming.
    The below function is used inside a package and the package is invoked in visual studio.
    The function uses 2 input parameters.
    Out of which 'in_report_parameter_id' value comes thru job processor service 's job request.
    The second IN paramter values are hard coded in the function.
    I'm not able to understand this.
    If the values are hard coded , how to make sure that only the hard coded values are the right ones?
    Please anyone could explain to me?
    I really dont have good idea about how to pass INPUT parameter to the functions or procedure
    Is there any nice document which could give me good understanding about what are the ways or types we could pass values to the input parameter in subprograms?
    thanks in advance.
    CREATE OR REPLACE FUNCTION get_class_text_str
         in_report_parameter_id IN NUMBER,
         in_which                IN VARCHAR2 DEFAULT 'SELECT'
    RETURN VARCHAR2
    IS
             end_text            VARCHAR2 (50)   := '';
             my_class_text_str  VARCHAR2(10000) := '';
             my_class_value_str VARCHAR2(10000) := '';
         CURSOR class_text(c_1_text VARCHAR2, c_2_text VARCHAR2) IS
         SELECT c_1_text || report_parameters.report_parameter_value
                               || c_2_text
                               || report_parameters.report_parameter_value
                               || '" '
          FROM report_parameters
         WHERE report_parameters.report_parameter_id     = 3690
           AND report_parameters.report_parameter_group  = 'CLASS'
           AND report_parameters.report_parameter_name   = 'CLASS'
    GROUP BY report_parameters.report_parameter_value
    ORDER BY CAST(report_parameters.report_parameter_value AS NUMBER);
    BEGIN
         IF (in_which = 'SUM') THEN     
              OPEN class_text ( 'SUM(NVL("Class ', '", 0)) "Class ' );
         ELSIF (in_which = 'PERC')THEN
              OPEN class_text ( 'ROUND((("Class ', '" / "Total") * 100), 2) "Class ' );
              end_text := ', DECODE("Total", -1, 0, 100) "Total" ';
         ELSE
              OPEN class_text ( 'SUM(DECODE(bin_id, ', ', bin_value, 0)) "Class ' );
         END IF;
         LOOP
              FETCH class_text INTO my_class_value_str;
              EXIT WHEN class_text%NOTFOUND;
              my_class_text_str := my_class_text_str || ', ' || my_class_value_str;
         END LOOP;
         CLOSE class_text;
         my_class_text_str := my_class_text_str || end_text;
         RETURN my_class_text_str;
    END get_class_text_str;
    /Edited by: user10641405 on Nov 19, 2009 8:16 AM
    Edited by: user10641405 on Nov 19, 2009 8:30 AM

    This is not a design I would use, but should work if coded properly. I would probably build a reference cursor query as text and use one open fetch and close.
    You have 2 input parameters, in_report_parameter_id and in_which. I could not find where in_report_parameter_id was used in the program, but the value passed in for in_which is being used in IF logic to decide how to open the cursor. After the cursor is open rows are being fetched and eventually the cursor is closed.
    The values in_which are compared to are hard-coded. It is the programmer's job to make sure the values listed are the right values and the actions taken are also correct. Your program is assuming that if the first 2 values are not encountered the third one listed is the one you want.
    To pass input values to a procedure you merely provide the values as a literal or variable in the call, something like
    whatever := get_class_text_str(1,'SELECT');

  • I am facing a problem in passing multiple values as out parameters from fo

    Hi All,
    i am facing a problem in passing multiple values as out parameters from for loop.
    EX:
    i have a select statment inside a loop like.....
    PACKAGE SPEC:
    create or replace PACKAGE EMP_PKG AS
    TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
    TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
    TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
    temp_table TAB_NUM;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB);
    END EMP_PKG;
    PACKAGE BODY:
    create or replace PACKAGE BODY EMP_PKG AS
    v_e_no NUMBER;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB) IS
    BEGIN
    select EMPNO bulk collect into temp_table from emp;
    for i in 1..temp_table.count loop
    v_e_no := temp_table(i);
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    end loop;
    end test;
    END EMP_PKG;
    PROBLEM FACING IS:
    I am expecting all rows returning from bellow select statment ...
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    But,while running the SP , i am getting error like
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SCOTT.EMP_PKG", line 16
    why i am not getting all values as out parameters.please provide a solution for me.
    Thanks in advance my friend.

    user9041629 wrote:
    Hi All,
    i am facing a problem in passing multiple values as out parameters from for loop.
    EX:
    i have a select statment inside a loop like.....
    PACKAGE SPEC:
    create or replace PACKAGE EMP_PKG AS
    TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
    TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
    TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
    temp_table TAB_NUM;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB);
    END EMP_PKG;
    PACKAGE BODY:
    create or replace PACKAGE BODY EMP_PKG AS
    v_e_no NUMBER;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB) IS
    BEGIN
    select EMPNO bulk collect into temp_table from emp;
    for i in 1..temp_table.count loop
    v_e_no := temp_table(i);
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    end loop;
    end test;
    END EMP_PKG;
    PROBLEM FACING IS:
    I am expecting all rows returning from bellow select statment ...
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    But,while running the SP , i am getting error like
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SCOTT.EMP_PKG", line 16
    why i am not getting all values as out parameters.please provide a solution for me.
    Thanks in advance my friend.Probably not a bad thing that this isn't working for you.
    This is a horrible way to return the contents of a table.
    Are you doing this for educational purpose, or ... what is your goal here? If you just want to return a result set to a client you'd want to look in to using a REF CURSOR and not a bunch of arrays combined with horribly procedural (slow) code.

  • Cursor-pasing multiple values as a cursor parameter

    declare
    credit_amount number:=0;
    debit_amount number:=0;
    v1 number:=0;
    v2 number:=0;
    v3 varchar2(500);
    v4 varchar2(500);
    v5 varchar2(240);
    v6 varchar2(240);
    v7 number;
    v8 varchar2(240);
    v9 varchar2(240);
    v10 number;
    v11 number;
    v12 varchar2(240);
    v13 varchar2(240);
    v14 varchar2(240);
    v15 number;
    v16 number;
    --This cursor is for liability records which are in GL not in AP
    cursor c1(p_header_id number,p_reference_2 varchar2,p_reference_4 varchar2)
    is
    (select
    jl.je_header_id "JE_HEADER_ID"
    ,jl.period_name "PERIOD"
    ,glcc.concatenated_segments "ACCOUNT_CODE"
    ,DECODE(jl.accounted_dr,null,0,jl.accounted_dr)"ACCOUNTED_DEBIT"
    ,DECODE(jl.accounted_cr,null,0,jl.accounted_cr) "ACCOUNTED_CREDIT"
    ,DECODE(jl.accounted_dr,null,0,jl.accounted_dr) - DECODE(jl.accounted_cr,null,0,jl.accounted_cr) "NET"
    ,glcc.CODE_COMBINATION_ID "CODE_COMBINATION_ID"
    ,jl.SET_OF_BOOKS_ID "SET_OF_BOOKS_ID"
    ,jl.PERIOD_NAME "PERIOD_NAME"
    ,DECODE(Jl.entered_dr,null,0,Jl.entered_dr)"ENTERED_DEBIT"
    ,DECODE(Jl.entered_cr,null,0,Jl.entered_cr) "ENTERED_CREDIT"
    ,jl.reference_1 "SUPPLIER"
    ,jl.reference_2 "INVOICE_ID"
    ,jl.reference_3 "CHECK_ID"
    ,jl.reference_4 "CHECK_NUMBER"
    ,jl.reference_5 "INVOICE_NUM"
    ,jl.reference_6 "'AP_PAYMT_JUST_INSERTED'"
    ,jl.reference_7 "set_of_books_id"
    ,jl.GL_SL_LINK_ID "GL_SL_LINK_ID"
    ,jl.REFERENCE_8 "INVOICE_DIST_LINE_NUMBER"
    ,jl.reference_9 "INVOICE_PAYMENT_ID"
    ,jl.REFERENCE_10 "LIABILITY"
    ,jl.TAX_CODE_ID "TAX_CODE_ID"
    ,jl.TAX_GROUP_ID "TAX_GROUP_ID"
    FROM
    gl_je_lines jl
    , apps.gl_code_combinations_KFV glcc
    , gl_je_headers jh
    WHERE
    jl.period_name='Mar-10'
    and glcc. code_combination_id in (1016,1296,1298)
    and jh.je_header_id = jl.je_header_id
    AND glcc.code_combination_id = jl.code_combination_id
    and jh.je_source = 'Payables'
    AND jl.je_header_id = p_header_id
    and jl.reference_2 = p_reference_2
    and jl.reference_4 = p_reference_4
    MINUS
    select
    ir.je_header_id
    , h.period_name "APPERIOD"
    ,g.CONCATENATED_SEGMENTS "AP ACCOUNT CODE"
    ,DECODE(l.accounted_dr,null,0,l.accounted_dr) "AP ACCOUNTED_DR"
    ,DECODE(l.accounted_cr,null,0,l.accounted_cr) "AP ACCOUNTED_CR"
    ,DECODE(l.accounted_dr,null,0,l.accounted_dr) - DECODE(l.accounted_cr,null,0,l.accounted_cr) "NET"
    ,l.CODE_COMBINATION_ID "AP_CCID"
    ,h.set_of_books_id
    ,h.PERIOD_NAME "PERIOD_NAME"
    ,DECODE(l.entered_dr,null,0,l.entered_dr)"ENTERED_DEBIT"
    ,DECODE(l.entered_cr,null,0,l.entered_cr) "ENTERED_CREDIT"
    ,l.reference1 "SUPPLIER"
    ,l.reference2 "INVOICE_Id"
    ,l.reference3 "reference_3"
    ,l.reference4 "reference_4"
    ,l.reference5 "INVOICE_NUM"
    ,l.reference6 "reference_6"
    ,l.reference7 "reference_7"
    ,l.GL_SL_LINK_ID "GL_SL_LINK_ID"
    ,l.REFERENCE8 "REFERENCE_8"
    ,l.reference9 "reference_9"
    ,l.REFERENCE10 "REFERENCE_10"
    ,l.TAX_CODE_ID "TAX_CODE_ID"
    ,l.TAX_LINK_ID "TAX_LINK_ID"
    from
    ap_ae_lines_all l,
    ap_ae_headers_all h,
    gl_code_combinations_kfv g
    ,gl_import_references ir
    where
    ir.gl_sl_link_id=l.gl_sl_link_id
    AND g.CODE_COMBINATION_ID = l.CODE_COMBINATION_ID
    and h.ae_header_id = l.ae_header_id
    AND h.period_name ='Mar-10'
    AND g.CODE_COMBINATION_ID in (1016,1296,1298)
    AND ir.JE_HEADER_ID = p_header_id
    and l.reference2 = p_reference_2
    and l.reference4 = p_reference_4);
    --This cursor is for writeoff records
    cursor c2
    is
    (select * from gl_je_lines
    where period_name='Mar-10'
    and reference_10='WRITEOFF'
    and reference_2 in ('525706','525600'));
    credit number:=0;
    debit number:=0;
    j varchar2(240);
    i varchar2(4000):='0';
    cursor c3 (p_invoice_id varchar2)
    is
    (select
    jl.je_header_id "JE_HEADER_ID"
    ,jl.period_name "PERIOD"
    ,glcc.concatenated_segments "ACCOUNT_CODE"
    ,DECODE(jl.accounted_dr,null,0,jl.accounted_dr)"ACCOUNTED_DEBIT"
    ,DECODE(jl.accounted_cr,null,0,jl.accounted_cr) "ACCOUNTED_CREDIT"
    ,DECODE(jl.accounted_dr,null,0,jl.accounted_dr) - DECODE(jl.accounted_cr,null,0,jl.accounted_cr) "NET"
    ,glcc.CODE_COMBINATION_ID "CODE_COMBINATION_ID"
    ,jl.SET_OF_BOOKS_ID "SET_OF_BOOKS_ID"
    ,jl.PERIOD_NAME "PERIOD_NAME"
    ,DECODE(Jl.entered_dr,null,0,Jl.entered_dr)"ENTERED_DEBIT"
    ,DECODE(Jl.entered_cr,null,0,Jl.entered_cr) "ENTERED_CREDIT"
    ,jl.reference_1 "SUPPLIER"
    ,jl.reference_2 "INVOICE_ID"
    ,jl.reference_3 "CHECK_ID"
    ,jl.reference_4 "CHECK_NUMBER"
    ,jl.reference_5 "INVOICE_NUM"
    ,jl.reference_6 "'AP_PAYMT_JUST_INSERTED'"
    ,jl.reference_7 "set_of_books_id"
    ,jl.GL_SL_LINK_ID "GL_SL_LINK_ID"
    ,jl.REFERENCE_8 "INVOICE_DIST_LINE_NUMBER"
    ,jl.reference_9 "INVOICE_PAYMENT_ID"
    ,jl.REFERENCE_10 "LIABILITY"
    ,jl.TAX_CODE_ID "TAX_CODE_ID"
    ,jl.TAX_GROUP_ID "TAX_GROUP_ID"
    FROM
    gl_je_lines jl
    , apps.gl_code_combinations_KFV glcc
    , gl_je_headers jh
    WHERE
    jl.period_name='Mar-10'
    and glcc. code_combination_id in (1016,1296,1298)
    and jh.je_header_id = jl.je_header_id
    AND glcc.code_combination_id = jl.code_combination_id
    and jh.je_source = 'Payables'
    and jl.reference_2 in (p_invoice_id)
    MINUS
    select
    ir.je_header_id
    , h.period_name "AP PERIOD"
    ,g.CONCATENATED_SEGMENTS "AP ACCOUNT CODE"
    ,DECODE(l.accounted_dr,null,0,l.accounted_dr) "AP ACCOUNTED_DR"
    ,DECODE(l.accounted_cr,null,0,l.accounted_cr) "AP ACCOUNTED_CR"
    ,DECODE(l.accounted_dr,null,0,l.accounted_dr) - DECODE(l.accounted_cr,null,0,l.accounted_cr) "NET"
    ,l.CODE_COMBINATION_ID "AP_CCID"
    ,h.set_of_books_id
    ,h.PERIOD_NAME "PERIOD_NAME"
    ,DECODE(l.entered_dr,null,0,l.entered_dr)"ENTERED_DEBIT"
    ,DECODE(l.entered_cr,null,0,l.entered_cr) "ENTERED_CREDIT"
    ,l.reference1 "SUPPLIER"
    ,l.reference2 "INVOICE_Id"
    ,l.reference3 "reference_3"
    ,l.reference4 "reference_4"
    ,l.reference5 "INVOICE_NUM"
    ,l.reference6 "reference_6"
    ,l.reference7 "reference_7"
    ,l.GL_SL_LINK_ID "GL_SL_LINK_ID"
    ,l.REFERENCE8 "REFERENCE_8"
    ,l.reference9 "reference_9"
    ,l.REFERENCE10 "REFERENCE_10"
    ,l.TAX_CODE_ID "TAX_CODE_ID"
    ,l.TAX_LINK_ID "TAX_LINK_ID"
    from
    ap_ae_lines_all l,
    ap_ae_headers_all h,
    gl_code_combinations_kfv g
    ,gl_import_references ir
    where
    ir.gl_sl_link_id=l.gl_sl_link_id
    AND g.CODE_COMBINATION_ID = l.CODE_COMBINATION_ID
    and h.ae_header_id = l.ae_header_id
    AND h.period_name ='Mar-10'
    AND g.CODE_COMBINATION_ID in (1016,1296,1298)
    and l.reference2 in (p_invoice_id)); --here if i put l.reference2  in (p_invoice_id)) it must show the details of
    -- of all.but it doesnot display sir
    --here if i put l.reference2 not in (p_invoice_id)) it shows that id also sir
    BEGIN
    for writeoff_rec in c2
    LOOP
    FOR Main_cur in c1(writeoff_rec.je_header_id,writeoff_rec.reference_2,writeoff_rec.reference_4)
    LOOP
    j:='0';
    IF writeoff_rec.accounted_dr is not null AND Main_cur.ACCOUNTED_CREDIT<>0
    THEN
    v10:=Main_cur.ACCOUNTED_CREDIT;
    credit_amount:= credit_amount+Main_cur.ACCOUNTED_CREDIT;
    ELSIF writeoff_rec.accounted_cr is not null AND Main_cur.ACCOUNTED_DEBIT<>0
    THEN
    v11:=Main_cur.ACCOUNTED_DEBIT;
    debit_amount:= debit_amount+Main_cur.ACCOUNTED_DEBIT;
    END IF;
    if c1%found then
    j:=Main_cur.INVOICE_ID;
    end if;
    END LOOP;
    -- i:=i||','||j;
    i:= i||','''||j||'''';
    END LOOP;
    dbms_output.put_line(i); --Here i got all invoiceids of varchar2 records without single qutations
    --its look like '0','23232','2324234' etc.
    for cash_clearing_cur in c3(i)--Here is the problem ..is it correct way here i am passing parameter to cursor
    loop
    v3:=0;
    v4:=0;
    v5:=0;
    v6:=0;
    v7:=0;
    v8:=0;
    v9:=0;
    v10:=0;
    v11:=0;
    v12:=0;
    v13:=0;
    v14:=0;
    v15:=0;
    v16:=0;
    credit:=credit+cash_clearing_cur.ACCOUNTED_CREDIT;
    debit:=debit+cash_clearing_cur.ACCOUNTED_DEBIT;
    v3:=cash_clearing_cur.JE_HEADER_ID;
    v4:=cash_clearing_cur.INVOICE_ID;
    v5:=cash_clearing_cur.CHECK_NUMBER;
    v6:=cash_clearing_cur.LIABILITY;
    v7:=cash_clearing_cur.CODE_COMBINATION_ID;
    v8:=cash_clearing_cur.PERIOD;
    v9:=cash_clearing_cur.ACCOUNT_CODE;
    v10:=cash_clearing_cur.ACCOUNTED_CREDIT;
    v11:=cash_clearing_cur.ACCOUNTED_DEBIT;
    v12:=cash_clearing_cur.SUPPLIER;
    v13:=cash_clearing_cur.CHECK_ID;
    v14:=cash_clearing_cur.INVOICE_NUM;
    v15:=cash_clearing_cur.GL_SL_LINK_ID;
    v16:=cash_clearing_cur.SET_OF_BOOKS_ID;
    DBMS_OUTPUT.PUT_LINE('HEAd '||v3||','||'inv_id '||v4||','||
    'chk_num '||v5||','||'ref10 '||v6||','||'CCID '||V7||','||'PED '||V8
    ||','||'acctcode '||v9||','||'acct_Ct '||V10
    ||','||'acct_Dt '||v11||','||'chk_id '||v13||','||'inv_num '||V14
    ||','||'link '||v15||','||'sob '||v16||','||'suplir '||V12);
    end loop;
    DBMS_OUTPUT.PUT_LINE( 'Dr Amt ' ||debit || 'Cr amt ' || credit );
    EXCEPTION
    when too_many_rows then
    dbms_output.put_line('Invalid no of rows');
    when no_data_found then
    dbms_output.put_line('no data found exception');
    when others then
    dbms_output.put_line('Other than Invalid no of rows');
    dbms_output.put_line(SQLERRM);
    END;
    ouutput was
    0,0 that means cursor c3 is not compiled because i am passing multiple values in parametr .is there any solution

    Whats wrong with your previous thread passing variable which has multiple values to cursor as parameter
    Opening a new thread doesn't mean that you will get more responses. Did you carefully studied the hints given by Justin Cave ? I guess no, because you ignored the first point itself to format your code with tag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Passing Parameter  values

    Hi,
    Iam trying to print a crystal report, but it is not prompting me to pass the parameter values.
    i want  user to pass parameter values.
    Iam using VB.Net code to generate the reports.
    Could plz help me
    Thanks
    Ravi

    assuming v_seqprocess_id takes the process_id, I'd probably go with something like:
    cursor sum_cur(p_process_id number) is
    select sum(cheque_amt), sum(balance)
    from   table
    where  process_id = p_process_id;and call the cursor passing v_seqprocess_id into it.
    That's if I had to do extra processing on top of getting the values, etc.
    Otherwise, I'd go with:
    insert into table2
    select sum(cheque_amt), sum(balance)
    from   table
    where  process_id = v_seqprocess_id;Message was edited by:
    Boneist
    Added in the insert version

  • How Do I Pass A Value Between two Spry Tabs?

    I am using the Adobe Spry framework to develop an webpage
    with 3 tabs. I want to be able to pass a value between tabs.
    More specifically...
    In Tab1, the user will click on a link that declares a
    variable called "groupID" with a value of "999"
    Tab 2 Should then open up and have "groupID" available for
    use. It will be used as a hidden form field.

    I think I get what your talking about.
    Thing to remember is that all the data is loaded on the same
    page still so you can just pass it over like you would using JS.
    I did a little example let me know if this is what you are
    looking for.
    You will see that I added a function at the bottom that will
    tell spry what panal to open as well as pass your "groupID" the
    function is call on the onclick even.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    <script language="JavaScript" type="text/javascript"
    src="js/SpryTabbedPanels.js"></script>
    <style>
    .TabbedPanels {
    clear:none;
    float:left;
    width:100%;
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
    .TabbedPanelsTabGroup {
    margin:0px;
    padding:0px;
    .TabbedPanelsTab {
    -moz-user-select:none;
    cursor:pointer;
    float:left;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:11pt;
    font-size-adjust:none;
    font-stretch:normal;
    font-style:normal;
    font-variant:normal;
    font-weight:normal;
    line-height:normal;
    list-style-image:none;
    list-style-position:outside;
    list-style-type:none;
    position:relative;
    top:0px;
    background-color:#FFEEEE;
    height: 25px;
    width: 161px;
    margin-top: 2px;
    margin-right: 15px;
    margin-bottom: -2px;
    margin-left: 0px;
    padding-top: 8px;
    padding-right: 10px;
    padding-bottom: 4px;
    padding-left: 10px;
    color: #ebe3cb;
    background-repeat: no-repeat;
    vertical-align: bottom;
    text-align: center;
    .TabbedPanelsTabHover {
    .TabbedPanelsTabSelected {
    background-color:#EEEEEE;
    height: 25px;
    margin-top: 2px;
    margin-right: 15px;
    margin-bottom: -2px;
    margin-left: 0px;
    padding-top: 2px;
    padding-right: 10px;
    padding-bottom: 9px;
    color: #46483c;
    .TabbedPanelsTab a {
    color:black;
    text-decoration:none;
    .TabbedPanelsContentGroup {
    background-color:#EEEEEE;
    clear:both;
    .TabbedPanelsContent {
    padding:4px;
    border: 1px solid #000000;
    text-align: left;
    background-color: #FFFFFF;
    .TabbedPanelsContentVisible {
    .VTabbedPanels .TabbedPanelsTabGroup {
    background-color:#EEEEEE;
    border-color:#999999 rgb(153, 153, 153) rgb(204, 204, 204)
    rgb(204, 204, 204);
    border-style:solid;
    border-width:1px;
    float:left;
    height:20em;
    position:relative;
    width:10em;
    .VTabbedPanels .TabbedPanelsTab {
    border-left:medium none;
    border-right:medium none;
    border-top:medium none;
    float:none;
    margin:0px;
    .VTabbedPanels .TabbedPanelsTabSelected {
    background-color:#EEEEEE;
    border-bottom:1px solid #999999;
    .VTabbedPanels .TabbedPanelsContentGroup {
    clear:none;
    float:left;
    height:20em;
    padding:0px;
    width:30em;
    </style>
    </head>
    <body>
    <div class="TabbedPanels" id="tp1">
    <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" tabindex="0"
    >Tab1</li>
    <li class="TabbedPanelsTab" tabindex="0"
    >Tab2</li>
    <li class="TabbedPanelsTab"
    tabindex="0">Tab3</li>
    <li class="TabbedPanelsTab"
    tabindex="0">Tab4</li>
    </ul>
    <div class="TabbedPanelsContentGroup">
    <!---We include the 4 tabs--->
    <div class="TabbedPanelsContent" >
    tab1
    </div>
    <div class="TabbedPanelsContent1" >
    <a href="#" onclick="tabtest(3,999);">test</a>
    </div>
    <div class="TabbedPanelsContent" >
    </div>
    <div class="TabbedPanelsContent" >
    <form name="myform">
    This number was passed from tab 1 <input name="mystuff"
    /></form>
    </form>
    </div>
    </div>
    </div>
    </body>
    </html>
    <!---we add this so the tabs will work--->
    <script language="JavaScript" type="text/javascript">
    var tp1 = new Spry.Widget.TabbedPanels("tp1", { defaultTab: 0
    function tabtest(tab,groupID)
    var tp1 = new Spry.Widget.TabbedPanels("tp1", { defaultTab:
    tab });
    document.myform.mystuff.value = groupID ;
    </script>

  • Passing Ref Cursor to Oracle Stored Procedure Via C#

    Hi all,
    I am new to oracle and stuck with an issue. I have three insert stored procedures for three different tables. Two of them have multiple rows to be inserted, which is currently done via iterating through each row and insert to db in C# code. My requirement is to merge these three procedures in one and instead of iterating from C# code send table rows as (ref cursor or collection) to procedure and the procedure will handle the rest.
    I read that ref cursor only works if you're data is in database as it reference the memory but in my case data is build on client side.
    I am using Oracle 11i and ASP.Net 2.0
    Can any help me on this please?
    Edited by: 929463 on Apr 23, 2012 12:38 AM

    929463 wrote:
    I am new to oracle and stuck with an issue. I have three insert stored procedures for three different tables. Two of them have multiple rows to be inserted, which is currently done via iterating through each row and insert to db in C# code. My requirement is to merge these three procedures in one and instead of iterating from C# code send table rows as (ref cursor or collection) to procedure and the procedure will handle the rest.Why a single procedure? How is the procedure to determine the target table to insert the data into? And please - no dynamic SQL as that is 99% of the time wrong.
    A ref cursor is something that PL/SQL creates - with the purpose of passing the cursor handle to your code. This enables the actual SQL statement for that cursor to be moved from client code, into a PL/SQL stored proc. It abstracts the client from having to understand SQL, understand the data model and so on. All clients use the same PL/SQL proc and thus the same code for creating that cursor. Thus no issue of some clients getting it half right or half wrong and dealing with data inconsistencies between clients.
    The PL/SQL proc can be tuned and optimised, modified for catering for data model changes and so on. Without your client code having to be even recompiled as it is isolated against these server changes.
    For all other interaction (running PL/SQL code, doing insert/update/delete/etc SQL statements), you need to create the cursor yourself in your code.
    Also, the SQL engine only sees cursors. There are no differences between cursors. The client (e.g. PL/SQL) can call it a reference cursor, or an implicit cursor, or a DBMS_SQL cursor.. the SQL engine does not know that and does not care.
    A ref cursor is simply a special type of client interface to a SQL cursor, allowing PL/SQL to create that SQL cursor and then pass the handle of that SQL cursor to other code to consume that cursor.
    Okay, so if you want to insert data, you need in your code to create a cursor. This can be a SQL INSERT cursor - the actual insert statement. Or it can be a PL/SQL call - an anonymous PL/SQL code block that calls a stored proc that performs the insert (after applying validation and business logic).
    The cursor will have one or more bind variables. Your client will pass values for these variables and the server-side code (SQL or PL/SQL) will be executed using this as variable data.
    You can for example create a cursor as follows:
    begin
      DoFunkyInsert( :1, :2, :3 );
    end;
    {code}
    3 bind variables are expected. You can now in the client build an array for each of these variables, containing a 100 values each (total of a 100 rows to insert). Do a single execute of the cursor, and tell Oracle that the bind is actually a 100 element array.
    The complete array ships to Oracle - Oracle opens a loop and execute the cursor for each element in the array.
    This is called bulk binding.
    An alternative approach is to define the bind variable as a collection (a non-scalar value). And then code the PL/SQL procedure to open a loop and iterate through the collection/array, inserting a row per iteration.
    The binding itself is more complex as your code know needs to understand Oracle object types and be able to define an array/collection that is a valid Oracle non-scalar data type.
    The +Oracle Call Interface+ (OCI) is quite flexible in this regard. However, as you work via an abstraction layer (e.g. ADO, OleDB, ODBC, etc) your code is subject to whatever functionality this abstraction layer makes available to your code. And this is seldom includes all the power, functionality and flexibility of the (more complex) OCI itself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Fetching values of Dynamic Cursor

    Hi,
    Can I fetch values of dynamic cursor into a variable(record OR individual)? If yes what will be the type of that record/variable?
    Thanks in Advance!
    Regards
    RK

    bluefrog wrote:
    There is no way in 10g to identify the column data types of the result set of a dynamic ref cursor.
    In 11g one can use ;
    DBMS_SQL.DESCRIBE_COLUMNS (
    c IN INTEGER,
    col_cnt OUT INTEGER,
    desc_t OUT DESC_TAB);when using DBMS_SQL
    P;In 11g you can use a ref cursor and then use the DBMS_SQL package to convert that ref cursor to a DBMS_SQL cursor where you can then describe the columns. The initial query doesn't have to be a DBMS_SQL cursor. In 10g, unfortunately, there is no way to convert the ref cursor to a DBMS_SQL cursor, so dynamic cursors would have to be written as DBMS_SQL cursors initially. Ref cursors are only really suitable for 3rd party tools, such as when passing queries back to .NET or Java applications. Too many people try and use ref cursors inside PL/SQL and then discover why that's not a good idea.
    PL/SQL 101 : Understanding Ref Cursors:-
    PL/SQL 101 : Understanding Ref Cursors

  • How to call a rtf template from another rtf template by passing a value

    Hi Gurus,
    Its about calling a rtf template from another rtf template by passing a value.
    My requirement is like:
    I got a quote report from Siebel, based on the product PartNumber I need to pull product description or literature from another database database.
    My approach is something like; get a partnumber from quote report pass it to another rtf template which uses the partnumber and get the data from table using DataSource. When user pull a quote report from siebel this new rtf template should attach to the quote at the end.
    I've gone through all available blogs about sub-reports and white papers from Oracle they are not much helpful since I need step-by-step.
    http://www.adivaconsulting.com/adiva-blog/item/36-working-with-rtf-sub-templates.html
    bip-subtemplate-1-132933.pdf
    I'm using 10g obiee integrated with Siebel.
    Just started learning BIP.
    Thanks in advance.
    Edited by: 911927 on Apr 2, 2013 8:56 AM
    Edited by: 911927 on Apr 2, 2013 8:57 AM

    How to call a rtf template from another rtf template by passing a value try in main template create hyperlink of url with parameters for another template
    http://bipconsulting.blogspot.ru/2010/02/drill-down-to-detail-or-another-report.html
    When user pull a quote report from siebel this new rtf template should attach to the quote at the end.it'll be only another report
    IMHO you can not attach it to main. it'll be second independent report
    you can try subtemplate but it's not about rtf from rtf by click
    it's about call automatically rtf subtemplate from main rtf based on some conditions
    for example, main template contain some data and if some condition is true then call subtemplate and place it instead of its condition

  • Job scheduling(passing the values to the child program)

    when i'm trying to schedule a background job(using job_open job_submit and job_close) i'm passing the values of the selection screen(parent program) to my child program using set parameter id. And trying to get the values using get parameter id in the cild program.
    But the values of the parent program are not being passed to the child program what may be the cause for it?

    rathan,
    Why con't you use
    SUBMIT... [VIA SELECTION-SCREEN]
    [USING SELECTION-SET <var>]
    [WITH <sel> <criterion>]
    [WITH FREE SELECTIONS <freesel>]
    [WITH SELECTION-TABLE <rspar>].
    When you start an executable program, the standard selection screen normally appears, containing the selection criteria and parameters of both the logical database connected to the program and of the program itself (see Direct Execution - Reports). When you start an executable program using SUBMIT, there are various additions that you can use to fill the input fields on the selection screen:
    SUBMIT... [VIA SELECTION-SCREEN]
    [USING SELECTION-SET <var>]
    [WITH <sel> <criterion>]
    [WITH FREE SELECTIONS <freesel>]
    [WITH SELECTION-TABLE <rspar>].
    These options have the following effects:
    VIA SELECTION-SCREEN
    The selection screen of the called executable program (report) appears. If you transfer values to the program using one or more of the other options, the corresponding input fields in the selections screen are filled. The user can change these values. By default, the system does not display a selection screen after SUBMIT.
    USING SELECTION-SET <var>
    This option tells the system to start the called program with the variant <var>.
    WITH <sel> <criterion>
    Use this option to fill individual elements <sel> of the selection screen (selection tables and parameters). Use one of the elements <criterion>:
    <op> <f> [SIGN <s>], for single value selection
    If <sel> is a selection criterion, use <op> to fill the OPTION field, <f> to fill the LOW field, and <s> to fill the SIGN field of the selection table <sel> in the called program.
    If <sel> is a parameter, you can use any operator for <op>. The parameter <sel> is always filled with <f>.
    [NOT] BETWEEN <f1> AND <f2> [SIGN <s>], for interval selection
    <f1> is transferred into the LOW field, <f2> into the HIGH field, and <s> into the SIGN field of the selection table <sel> in the called program. If you omit the NOT option, the system places the value BT into the OPTION field; if you use NOT, the system fills OPTION with NB.
    IN <seltab>, transferring a selection table
    This addition fills the selection table <sel> in the called program with the values of the table <seltab> in the calling program. Table <seltab> must have the structure of a selection table. Use the RANGES statement to create selection tables.
    WITH FREE SELECTION <freesel>, user dialog for dynamic selections
    To use this option, the called program must be connected to a logical database that supports dynamic selections. In the calling program, use the function modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG. They allow the user to enter dynamic selections on a selection screen. One export parameter of these function modules has structure RSDS_TEXPR from the RSDS type group. Transfer the values of this export parameter by means of the internal table <freesel> of the same structure to the called report.
    WITH SELECTION-TABLE <rspar>, dynamic transfer of values
    You need an internal table <rspar> with the Dictionary structure RSPARAMS. The table then consists of the following six fields:
    SELNAME (type C, length 8) for the name of the selection criterion or parameter
    KIND (type C, length 1) for the selection type (S for selection criterion, P for parameter)
    SIGN, OPTION, LOW, HIGH as in a normal selection table, except that LOW and HIGH both have type C and length 45.
    This table can be filled dynamically in the calling program with all of the required values for the selection screen of the called program. If the name of a selection criterion appears more than once, the system creates a multiple-line selection table for that criterion in the called program. If the name of a parameter appears more than once, the system uses the last value. Note that LOW and HIGH have type C, so that the system executes type conversions to the criteria of the called program. This is important for date fields, for example. Before your program is used in a live context, you should check it using the VIA SELECTION-SCREEN addition.
    Except for WITH SELECTION-TABLE, you can use any of the above options several times and in any combination within a SUBMIT statement. In particular, you can use the WITH <sel> option several times for one single criterion <sel>. In the called program, the system appends the corresponding lines to the selection tables used. For parameters, it uses the last value specified. The only combination possible for the WITH SELECTION-TABLE option is USING SELECTION-SET.
    If the input fields on the selection screen are linked to SPA/GPA parameters, you can also use this technique to pass values to the selection screen (see Passing Data Between Programs).
    The following executable program (report) creates a selection screen containing the parameter PARAMET and the selection criterion SELECTO:
    REPORT  demo_program_submit_rep1.
    DATA number TYPE i.
    PARAMETERS      paramet(14) TYPE c.
    SELECT-OPTIONS  selecto FOR number.
    The program DEMO_PROGRAM_SUBMIT_REP1 is called by the following program using various parameters:
    REPORT demo_program_submit_sel_screen NO STANDARD PAGE HEADING.
    DATA: int TYPE i,
          rspar TYPE TABLE OF rsparams,
          wa_rspar LIKE LINE OF rspar.
    RANGES seltab FOR int.
    WRITE: 'Select a Selection!',
    SKIP.
    FORMAT HOTSPOT COLOR 5 INVERSE ON.
    WRITE: 'Selection 1',
         / 'Selection 2'.
    AT LINE-SELECTION.
      CASE sy-lilli.
        WHEN 4.
          seltab-sign = 'I'. seltab-option = 'BT'.
          seltab-low  = 1.   seltab-high   = 5.
          APPEND seltab.
          SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
                          WITH paramet eq 'Selection 1'
                          WITH selecto IN seltab
                          WITH selecto ne 3
                          AND RETURN.
        WHEN 5.
          wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
          wa_rspar-sign = 'E'. wa_rspar-option = 'BT'.
          wa_rspar-low  = 14.  wa_rspar-high = 17.
          APPEND wa_rspar TO rspar.
          wa_rspar-selname = 'PARAMET'. wa_rspar-kind = 'P'.
          wa_rspar-low  = 'Selection 2'.
          APPEND wa_rspar TO rspar.
          wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
          wa_rspar-sign = 'I'. wa_rspar-option = 'GT'.
          wa_rspar-low  = 10.
          APPEND wa_rspar TO rspar.
          SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
                          WITH SELECTION-TABLE rspar
                          AND RETURN.
      ENDCASE.
    Pls. reward if useful...

  • How can I pass field value betwen view in ICWC?

    Hi experts,
    I am new to this BSP programming. I have some requirements to modify standard ICWC in CRM 5.0
    Hope can get some advices and helps here.
    I have added a new field called <status> to context note SEARCHCUSTOMER in BupaSearchB2B view and also the same field name to context note CUSTOMER in BupaCreate view.
    I have added the field into both the HTM views and able to execute thru WebClient. However, I have one problem in passing the <status> value from BupaSearchB2B view  to the BupaCreate view when I click on the 'create' button.
    I do search and saw this thread How can I pass field value beetwen view in IC Web Client? , but i cant figure out how it works.
    Do I need to create the field <status> to context note CUSTOMER in BupaSearchB2B? Currently the context note does not have any attributes.
    Really appreciate for any help.
    Edited by: mervyn tay on Apr 7, 2009 11:42 AM

    solved by myself...
    code in the CREATE_ACCOUNT method.
            ev_entity->set_property( iv_attr_name = 'ZZICNO'
                                     iv_value = lv_icnum1 ).

  • Error while passing prompt value in Column Formula

    Hi All,
    I have created a dashboard and added a dashboard prompt on that with a presentation variable named "promptdyn" that is basically showing bank names.
    Now i want to calculate the market value based on this prompt selection, so i edited the column formula as
    "WM FACT Sec"."MARKET VALUE" * EVALUATE('getBankBaseCurrencyValue(%2)' As Double,@{promptdyn},"Industry Type".INSTRUMENT_CCY)
    But it is throwing this error:
    \nQSError: 10058] A general error has occurred.
    \nQSError: 22051] The argument number 1 is not referenced in this evaluate expression: getBankBaseCurrencyValue(%2). (HY000)
    SQL Issued: SELECT "Industry Type".INDUSTRY_NAME, "Industry Type".INDUSTRY_TYPE, "WM FACT Sec"."MARKET VALUE" * EVALUATE('getBankBaseCurrencyValue(%2)' As Double,0,"Industry Type".INSTRUMENT_CCY) FROM WMAdHocReportingBMMSec
    I don't know what is wrong here.Here i tried to pass the value of the prompt to the function.
    Basically I have created a function in the database with two parameter as "bank name " and "Currency" and calling it with the help of evaluate function.
    How could we store the prompt value and pass it to some other function?
    Pls help me as it is urgent for me to solve.
    Thanks

    He Solved.
    Just i missed out to write %1,%2 in the evaluate function.
    But one thing i need to know that how can we store the value that is selected in a prompt say in dashboard prompt so that it can be used in query. Because i need to select a value first from the prompt and based on that i need to manipulate the values of the other request of the dashboard.
    Please Reply.
    Thanks

  • Passing Multiple Values from Multi Select

    Hi,
    My requirement is simple. I have created a simple Multi Select Option in parameter form and i want to send multiple selected values from the multi select option (in parameter form) to reports.
    eg:
    I want to send multiple countries code as input .........'US', 'CA', 'IND', 'UK'
    Can i do it in Oracle 6i reports, Thanks in Advance.
    Regards,
    Asgar

    Hi Thanks Again,
    For such a nice response. I got the Lexical Where condition properly running but still getting problems in catching the multiple values to be passed from form. just i will give u an insight of wat i have done:
    SQL:
    SELECT ALL FROM EMPLOYEES &cond_1* -- Working FIne
    in my Html Parameter Form i have an Multi Select component (the Problem is here) it is not passing more than i value from the form once i am accessing it from web or running it in paper report. In paper report layout it is not allowing me to select more than one value. but in HTML it is allowing to select multiple values but at the server end (After Parameter Form Trigger) it is giving a single value not multiple values.
    In PL/SQL when i checking the length of country_id i m getting it as one.
    Here is my SQL code
    srw.message(10, LENGTH(:country_id_1));
    :cond_1 := 'where country_id = '''|| :country_id_1 ||'''';
    This is passing the condition properly to SQL but only with single value but i want to pass multiple values
    I am struck in this+_
    WHERE CONTRY_COLUMN IN ('USA','UAE') -- This variable you have to pass from you form...
    Here as you said you gave multiple selection in your parameter form to generate report. So before generation report just prepare variable like this as it is bold above.
    and pass parameter through your runtime form to the report as you pass the normal parameter...liket this i gave you example...
    ADD_PARAMETER(PARAMETER_LIST_NAME,'P_CONT_PARAM',TEXT_PARAMETER,vString);
    Sorry for troubling you for a small thing but please help me to solve this issue.
    Thanks Again............
    Asgar.

Maybe you are looking for