Help required in changing to str for dynamic sql

Hi
I am trying to make this to string for dynamic sql, this is a part of the sql which is giving problem with p_..as parameters from proc. Help me in this , iam also seeing dbms _output but stil unable to format it to required error free string.
|| ' AND ( po.abbreviationprojectopportid LIKE '
|| '%'
|| 'NVL'
|| '('
|| p_opp_code
|| ', ''NULL'')'
|| '%'
|| ' OR co.companyname LIKE '
|| '%'
|| 'NVL'
|| '('
|| p_client_name
|| ', '' NULL'')'
|| '%'
|| ' OR le.line_item_amount = NVL '
|| ' ('
|| p_booking_amt
|| ', -0.197) '
|| 'OR po.dealcurrency = NVL '
|| '('
|| p_currency
|| ',''NULL'')'
|| 'OR be.booking_entry_id LIKE '
|| '%'
|| 'NVL ('
|| p_entry_id
|| ',''NULL'')'
|| '%'
|| ' OR le.line_item_id LIKE '
|| '%'
|| 'NVL ('
|| p_line_item
|| ',''null'')'
|| '%'
|| ' OR be.ticket_num LIKE '
|| '%'
|| 'NVL ('
|| p_ticket_num
|| ',''NULL'')'
|| '%'
|| ' OR be.updatedby LIKE '
|| '%'
|| 'NVL ('
|| p_user_name
|| ',''NULL'')'
|| '%'
|| ' OR credittransaction.acct_code ='
|| 'NVL ('
|| p_gl_account
|| ','
|| '-0.197)'
|| 'OR debittransaction.acct_code ='
|| 'NVL ('
|| p_gl_account
|| ', '
|| '-0.197) '
|| 'OR credittransaction.profit_ctr_code ='
|| 'NVL ('
|| p_profit_center
|| ','
|| ' -0.197)'
|| 'OR debittransaction.profit_ctr_code ='
|| 'NVL ('
|| p_profit_center
|| ','
|| '-0.197)'
|| ' OR le.sap_posting = NVL ('
|| p_sap_posting
|| ',''$'')'
|| 'OR cmis.cmis_code = NVL ('
|| p_cmis_nominal
|| ','' -0.197)'
|| 'OR sa.sap_code = NVL ('
|| p_sap_booking_entity
|| ', -0.197)'
|| ' OR (be.booking_date BETWEEN '
|| v_booking_date_from
|| 'AND '
|| v_booking_date_to
|| ')'
|| ' )'
|| 'ORDER BY '
|| p_sort_by
|| ' '
|| p_order;

some errors.. Try this...
' SELECT be.booking_date bookingdate, '
|| ' be.booking_entry_id entryid, le.line_item_id itemid,'
|| ' po.abbreviationprojectopportid opportunitycode,'
|| ' co.companyname clientname, '
|| ' le.line_item_amount bookingamount,'
|| ' be.ticket_num ticketnum, po.dealcurrency currency,'
|| ' cmis.cmis_code cmis_nominal,'
|| ' sa.sap_code sap_booking_entity,'
|| ' (SELECT full_name '
|| ' FROM iba_employee '
|| ' WHERE TO_CHAR (employeeid) = be.updatedby) updatedby,'
|| ' be.updateddate updateddate, '
|| ' (SELECT le.line_item_amount * rate '
|| ' FROM iba_currencyconversion '
|| ' WHERE tocurrencycd = '
|| 'USD'
|| ' AND currencycd = po.dealcurrency '
|| ' AND conversiondate = be.booking_date) amountusd,'
|| 'debittransaction.acct_code debitglaccount,'
|| ' credittransaction.acct_code creditglaccount,'
|| ' debittransaction.profit_ctr_code debitprofitcenter,'
|| ' credittransaction.profit_ctr_code creditprofitcenter,'
|| ' debittransaction.amt debitamount,'
|| ' credittransaction.amt creditamount'
|| ' FROM rb_booking_entry be, '
|| ' rb_line_item le, '
|| ' rb_booking_period bp,'
|| ' rb_cmis_gl_account cmisgl,'
|| ' rb_cmis_account cmis,'
|| ' iba_projectopportunity po,'
|| ' iba_company co,'
|| ' rb_sap_account sa,'
|| ' (SELECT acctr.line_item_id line_item,'
|| ' sapgl_acc.account_code acct_code,'
|| ' acctr.amount amt,'
|| ' sappr.profit_center_code profit_ctr_code'
|| ' FROM rb_account_transaction acctr,'
|| ' rb_sap_profit_center sappr,'
|| ' rb_sap_gl_account sapgl_acc'
|| ' WHERE acctr.profit_center_id = sappr.profit_center_id '
|| ' AND acctr.gl_account_id = sapgl_acc.gl_account_id '
|| ' AND acctr.transaction_type = ''D'') debittransaction,'
|| ' (SELECT acctr.line_item_id line_item,'
|| ' sapgl_acc.account_code acct_code,'
|| ' acctr.amount amt,'
|| ' sappr.profit_center_code profit_ctr_code '
|| ' FROM rb_account_transaction acctr, '
|| ' rb_sap_profit_center sappr, '
|| ' rb_sap_gl_account sapgl_acc '
|| ' WHERE acctr.profit_center_id =sappr.profit_center_id '
|| ' AND acctr.gl_account_id = sapgl_acc.gl_account_id '
|| ' AND acctr.transaction_type = ''C'') credittransaction '
|| ' WHERE po.projectopportunityid = be.projectopportunityid '
|| ' AND be.booking_entry_id = le.booking_entry_id '
|| ' AND po.companyid = co.companyid '
|| ' AND bp.booking_period_id = be.booking_period_id '
|| ' AND cmis.cmis_id = cmisgl.cmis_id '
|| ' AND le.sap_id = sa.sap_id '
|| ' AND le.cmis_id = cmis.cmis_id '
|| ' AND debittransaction.line_item(+) = le.line_item_id '
|| ' AND credittransaction.line_item(+) = le.line_item_id '
|| ' AND ( po.abbreviationprojectopportid LIKE ' || '''%' || NVL(p_opp_code,'NULL') || '%'''
|| ' OR le.line_item_id LIKE '
|| '''%'
|| NVL (
|| p_line_item
|| ,'null')
|| '%'''
| ' OR le.line_item_amount = '
||NVL(|| p_booking_amt, -0.197)
|| ' OR po.dealcurrency ='
|| NVL(p_currency,'NULL')
|| ' OR be.booking_entry_id LIKE '
|| '''%'
|| NVL (p_entry_id,'NULL')
|| '%'''
|| ' OR be.ticket_num LIKE '
|| '''%'
|| NVL (p_ticket_num,'NULL')
|| '%'''
|| ' OR be.updatedby LIKE '
|| '''%'
|| NVL (p_user_name,'NULL')
|| '%'''
|| ' OR credittransaction.acct_code ='
|| NVL (p_gl_account,-0.197)
|| ' OR debittransaction.acct_code ='
|| NVL (p_gl_account,  -0.197)
|| ' OR credittransaction.profit_ctr_code ='
|| NVL (p_profit_center, -0.197)
|| ' OR debittransaction.profit_ctr_code ='
|| NVL (p_profit_center, -0.197)
|| '  OR le.sap_posting = '
||NVL (p_sap_posting,'$')
|| ' OR cmis.cmis_code = '
||NVL (p_cmis_nominal, -0.197)
|| ' OR sa.sap_code = '
|| NVL (p_sap_booking_entity, -0.197)
|| '  OR (be.booking_date BETWEEN to_date('''
|| v_booking_date_from
|| ''') AND  to_date('''
|| v_booking_date_to
|| ''')'
|| ' OR co.companyname LIKE '
|| '''%'
|| NVL(p_client_name,'NULL')
|| '%'''
|| ' )'
|| 'ORDER BY  ' || p_sort_by || ',' || p_order;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Can anyone help me with changing email address for resetting password notification

    Can anyone help me with changing email address for resetting password notification?

    If you know the answers to your security questions, you can change your rescue email address as shown in step 6 in this article: http://support.apple.com/kb/HT5312.
    If you don't kow the answers to your security questions or need other assistance doing this, either contact Apple for assistance by going to https://expresslane.apple.com, then click More Products and Services>Apple ID>Other Apple ID Topics>Lost or forgotten Apple ID password, or contact the Apple account security team: http://support.apple.com/kb/HT5699.

  • How can I open a cursor for dynamic sql statement

    Hi,
    I'm facing issues opening a cursor for dynamic sql statement : PLS-00455: cursor 'RESULT1' cannot be used in dynamic SQL OPEN statement.
    CREATE OR REPLACE FUNCTION DEMO
    (MN_I in VARCHAR)
    return AB_OWNER.ABC_Type.NonCurTyp is
    RESULT1 AB_OWNER.ABC_Type.NonCurTyp;
    sql_stmt VARCHAR2(4000);
    BEGIN
    sql_stmt := 'SELECT * FROM AB_OWNER.DUN WHERE JZ_I in ('||mn_i||') ORDER BY app.ACC_I';
    OPEN RESULT1 FOR sql_stmt;
    END IF;
    return RESULT1;
    END DEMO;
    What changes should I make in the code so that it doesn't fail? I can't change the definition of RESULT1 cursor though.

    Gangadhar Reddy wrote:
    I used SYS REFCURSOR and was able to implement successfully.How many times did you run this successful implementation that does not use bind variables?
    Because this is what will happen when it runs a lot.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17766/e2100.htm#sthref1874
    http://forums.oracle.com/forums/search.jspa?q=%2BORA-04031%20%2Bbind&objID=c84&dateRange=all&rankBy=10001&start=30
    And you will have to regularly restart the server, or possibly slightly less invasive, flush the shared pool.
    Flushing Shared Pool regularly
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1516005546092
    >
    Ok, this is an easy one to diagnose.
    You are not using bind variables. This is terrible. Flushing the shared pool is a bad
    solution -- you are literally killing the performance on your box by not using them.
    If I was to write a book on how to build “non scalable applications in Oracle”, this
    would be the first and last chapter. This is a major cause of performance issues and a
    major inhibitor of scalability in Oracle. The way the Oracle shared pool (a very
    important shared memory data structure) operates is predicated on developers using bind
    variables. If you want to make Oracle run slowly, even grind to a total halt – just
    refuse to use them.
    >
    But, please feel free to go ahead with this successful implementation.
    I just hope anyone else who reads this doesn't make the same mistake.

  • Help required in reading freight price for PO item. See below code.

    H All,
    I have a requirement to read frieght cost for each PO item.
    Please see the below code and let me know is this approach is correct or not.
    * Fetch PO header details for selected criteria
      SELECT ebeln                         "Purchasing document
             bstyp
             bsart
             loekz
             lifnr                         "Vendor
             ekgrp                         "Purchasing group
             bedat                         "Document date
             knumv
        INTO TABLE t_ekko
        FROM ekko
       WHERE ebeln IN s_ebeln
         AND lifnr IN s_lifnr
         AND ekgrp IN s_ekgrp
         AND bedat IN s_bedat.
      IF sy-subrc EQ 0.
        DELETE t_ekko
         WHERE ( bstyp NE c_bstyp_f
           AND bsart NE c_bsart_nb
           AND loekz NE space ).
        SELECT knumv
               kposn
               kdatu
               kbetr
               kwert
               lifnr
          INTO TABLE t_konv
          FROM konv
           FOR ALL ENTRIES IN t_ekko
         WHERE knumv EQ t_ekko-knumv
           AND lifnr EQ t_ekko-lifnr
           AND kdatu EQ t_ekko-bedat
           AND kappl EQ c_kappl_m
           AND kschl EQ c_kschl_frc1.
    *  Fetch PO item details for the retrieved purchase orders
        SELECT ebeln                       "Purchasing document
               ebelp                       "PO item
               txz01                       "Short text
               matnr                       "Material
               matkl                       "Material group
               menge                       "PO quantity
               meins                       "UOM
               netpr                       "Net price
               netwr                       "Net value
         INTO TABLE t_ekpo
         FROM ekpo
          FOR ALL ENTRIES IN t_ekko
        WHERE ebeln EQ t_ekko-ebeln
          AND matnr IN s_matnr
          AND loekz EQ space
          AND matkl IN s_matkl.
    LOOP AT t_ekpo INTO fs_ekpo.
    * Read header details from EKKO for each PO item
        READ TABLE t_ekko
              INTO fs_ekko
              WITH KEY ebeln = fs_ekpo-ebeln.
        IF sy-subrc EQ 0.
          MOVE:
            fs_ekpo-ebeln TO fs_poitems-ebeln,
            fs_ekpo-ebelp TO fs_poitems-ebelp,
            fs_ekko-lifnr TO fs_poitems-lifnr,
            fs_ekko-ekgrp TO fs_poitems-ekgrp,
            fs_ekko-bedat TO fs_poitems-bedat,
            fs_ekpo-txz01 TO fs_poitems-txz01,
            fs_ekpo-matnr TO fs_poitems-matnr,
            fs_ekpo-menge TO fs_poitems-menge,
            fs_ekpo-meins TO fs_poitems-meins,
            fs_ekpo-netpr TO fs_poitems-netpr,
            fs_ekpo-netwr TO fs_poitems-netwr.
    * Read table KONV for fetching fieght charge
          READ TABLE t_konv
                INTO fs_konv
                WITH KEY  kposn = fs_poitems-ebelp
                          kdatu = fs_poitems-bedat
                          lifnr = fs_poitems-lifnr.
          IF sy-subrc EQ 0.
            MOVE:
              fs_konv-kwert TO fs_poitems-fri_val.
          ENDIF.                           " if sy-subrc eq 0.
    Please suggest me.
    Thanks,
    Jwala
    Edited by: Rob Burbank on Mar 12, 2009 12:09 PM
    Please use code tags

    Hi,
    I believe the approach is good, I would have done similar.
    Regards,
    Gilberto Li
    Edited by: Gilberto Li on Mar 12, 2009 5:13 PM

  • Open cursor for dynamic sql

    Hi
    I am using oracle 8.1.7 on solaris.
    I have created
    SQL> CREATE OR REPLACE PACKAGE TEST_PKG AS
    2 TYPE row_cursor IS REF CURSOR RETURN TEMP_TAB%ROWTYPE;
    3 PROCEDURE Return_Columns_proc (c_return IN OUT row_cursor);
    4 END TEST_PKG;
    5 /
    Package created.
    now i am trying to create the procedure Return_Columns_proc by
    CREATE OR REPLACE PACKAGE BODY TEST_PKG AS
    PROCEDURE Return_Columns_proc (c_return IN OUT row_cursor) AS
    QUERY_STR VARCHAR2(850);
    x number ;
    BEGIN
    x:=1;
    QUERY_STR :='SELECT * FROM temp_tab where order_line_id = '||x;
    OPEN c_return FOR QUERY_STR;
    END Return_Columns_proc;
    END TEST_PKG;
    I am getting following error.
    SQL> show error
    Errors for PACKAGE BODY TEST_PKG:
    LINE/COL ERROR
    8/4 PL/SQL: Statement ignored
    8/9 PLS-00455: cursor 'C_RETURN' cannot be used in dynamic SQL OPEN
    statement
    any help for this error.

    The error says it all. You have defined a strong ref cursor and it cannot be used with dynamic sql. However, that does not mean you cannot use the query directly in the OPEN clause
    OPEN c_Return FOR SELECT * FROM temp_tab where order_line_id = X ;

  • Dynamic fetch for dynamic sql query

    Hi All,
    I want to dynamically create a query and fetch it into a dynamic cursor record...The structure of the record should be the same as that of the query...
    Can you suggest any method to do that.
    eg
    OPEN <dynamic cur> FOR <dynamic stmt>;
    LOOP
    FETCH <dynamic cur> INTO <dynamic rec>;
    END LOOP;
    CLOSE <dynamic cur>;
    How do I declare the dynamic rec here?I would not know the columns in the query beforehand either.
    Thanks,
    Merz
    Edited by: merz on Sep 12, 2011 5:02 PM
    Edited by: merz on Sep 12, 2011 5:03 PM

    merz wrote:
    Hi All,
    I want to dynamically create a query and fetch it into a dynamic cursor record...The structure of the record should be the same as that of the query...
    Can you suggest any method to do that.And how are you expecting to write an application around a dynamic query and dynamic structure that you don't know?
    Saying that, as others have said, there is the DBMS_SQL package which can be used for certain valid reasons such as the following example....
    As sys user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /As myuser:
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;This allows for the header row and the data to be written to seperate files if required.
    e.g.
    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    PL/SQL procedure successfully completed.Output.txt file contains:
    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
    Adapt to output different datatypes and styles are required.

  • Open SYS_REFCURSOR for DYNAMIC SQL

    Hi!
    I have stored procedure like below:
    CREATE OR REPLACE
    PROCEDURE MYPROCEDURE
    cv_r OUT SYS_REFCURSOR
    AS
    lv_ExecuteString varchar(2000);
    BEGIN
      lv_ExecuteString := 'select 1 from dual';
      open cv_r for lv_ExecuteString;
      END MYPROCEDURE;and then
    SQL> var y refcursor
    SQL> execute myprocedure(:y);
    BEGIN myprocedure(:y); END;
    ERROR at line 1:
    ORA-00911: invalid character
    ORA-06512: at "BPATEL.MYPROCEDURE", line 9
    ORA-06512: at line 1shouldnt it suppose to work??? If not then How can I fill up OUT SYS_REFCURSOR with dynamic sql string ???
    although If I modify this below in my stored procedure it works fine:
    -- open cv_r for lv_ExecuteString;
    open cv_r for select 1 from dual;
    SQL> var y refcursor
    SQL> execute myprocedure(:y);
    PL/SQL procedure successfully completed.
    SQL> print y
             1
             1any idea?? why is it doing so???

    What version are you on? Works fine for me....
    ME_XE?CREATE OR REPLACE
      2  PROCEDURE MYPROCEDURE
      3  (
      4  cv_r OUT SYS_REFCURSOR
      5  )
      6  AS
      7  lv_ExecuteString varchar(2000);
      8  BEGIN
      9    lv_ExecuteString := 'select 1 from dual';
    10    open cv_r for lv_ExecuteString;
    11    END MYPROCEDURE;
    12  /
    Procedure created.
    Elapsed: 00:00:00.71
    ME_XE?var y refcursor
    ME_XE?execute myprocedure(:y);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.03
    ME_XE?print :y
                     1
                     1
    1 row selected.
    Elapsed: 00:00:00.00
    ME_XE?@version
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    5 rows selected.
    Elapsed: 00:00:00.10

  • Concatenate problem for Dynamic SQL statements

    Hi Experts ,
    I am building Dynamic SQL statements depending on the values which the user enters into the select option parameters .This dynamic query is passed to cl_sql_connection object for querying from another databasse
    So i wrote dynamic values for one select option spointof for the database field ppointofdelivery.
    loop at spointof.
    CONCATENATE ' pointofdelivery between ''' spointof-low''''
    ' AND ''' spointof-high''''
    INTO where_clause .
    endloop.
    The whereclause has value pointofdelivery between '123' and '124'.(if the user has entered 123 and 124 as values)
    This works fine . But my problem is I have to pass the fieldnames and operator dynamically into where_clause depending on User input.
    when i am writing code like the below
    field_name = ' pointofdelivery '.
    operator = '='.
    CONCATENATE field_name operator '''spointof-low''' INTO where_clause .
    the where_clause contains value
    pointofdelivery = ' spointof-low '
    and not pointofdelivery = ' 123 ' as expected .
    Do you know why this is haapening as it is not taking the value.
    Thanks
    Arshad

    Hi,
    there are lot of function modules..available...to build a where clause based on the select-options..
    check the FM FREE_SELECTIONS_RANGE_2_WHERE
    Thanks
    Naren

  • Help required in creation of Dictionary table dynamically

    Hello All,
    I have created DDIC table created dynamically.
    But what i require is! the dictionary table which i have created should be under the package name as given by the customer.
    I have seen in FM DDIF_TABL_PUT  the parameter dd02v-APPLCLASS is the write parameter to create the table under the required package. This field is of length char 4 only.
    Normally the package name will be greater than char4 and also it happend in my case that the package name is more than char4.
    Now i am unable to create the table dynamically under the specified pacakage of the customer
    How can i solve this problem?
    Can any one help me in this issue?
    Regards,
    Gupta

    Hi Lakshman,
    Thank you for your reply,
    I have used the FM which you have mentioned but i didn't work. I mean when i see the attributes of the table, package is still empty.
    Can you help me to solve the problem.
      CALL FUNCTION 'TR_TADIR_INTERFACE'
        EXPORTING
    *     WI_DELETE_TADIR_ENTRY                = ' '
    *     WI_REMOVE_REPAIR_FLAG                = ' '
    *     WI_SET_REPAIR_FLAG                   = ' '
    *     WI_TEST_MODUS                        = 'X'
          wi_tadir_pgmid                       = 'R3TR'
          wi_tadir_object                      = 'TABL'
          wi_tadir_obj_name                    = lv_objname
    *     WI_TADIR_KORRNUM                     = ' '
    *     WI_TADIR_SRCSYSTEM                   = ' '
    *     WI_TADIR_AUTHOR                      = ' '
         wi_tadir_devclass                    = 'ZV/HF/PLANNING'
    *     WI_TADIR_MASTERLANG                  = ' '
    *     WI_TADIR_CPROJECT                    = ' '
    *     WI_TADIR_VERSID                      = ' '
    *     WI_REMOVE_GENFLAG                    = ' '
    *     WI_SET_GENFLAG                       = ' '
    *     WI_READ_ONLY                         = ' '
    *     IV_SET_EDTFLAG                       = ' '
    *   IMPORTING
    *     NEW_GTADIR_ENTRY                     =
    *     NEW_TADIR_ENTRY                      =
       EXCEPTIONS
         tadir_entry_not_existing             = 1
         tadir_entry_ill_type                 = 2
         no_systemname                        = 3
         no_systemtype                        = 4
         original_system_conflict             = 5
         object_reserved_for_devclass         = 6
         object_exists_global                 = 7
         object_exists_local                  = 8
         object_is_distributed                = 9
         obj_specification_not_unique         = 10
         no_authorization_to_delete           = 11
         devclass_not_existing                = 12
         simultanious_set_remove_repair       = 13
         order_missing                        = 14
         no_modification_of_head_syst         = 15
         pgmid_object_not_allowed             = 16
         masterlanguage_not_specified         = 17
         devclass_not_specified               = 18
         specify_owner_unique                 = 19
         loc_priv_objs_no_repair              = 20
         gtadir_not_reached                   = 21
         object_locked_for_order              = 22
         change_of_class_not_allowed          = 23
         no_change_from_sap_to_tmp            = 24
         OTHERS                               = 25
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Regards,
    Lisa
    Edited by: Lisa Roy on Apr 9, 2008 11:37 AM

  • Urgent help required - linked subreport keeps asking for parameter value

    Greetings,
    I have developed a report in the Crystal Reports bundled with Visual Studio 2005. The data is obtained from a stored procedure. One of the fields in the result set is named "Id".
    I have embedded a subreport in the details row of the main report. The subreport also gets its information from a stored procedure. This stored procedure has one parameter named "OpportunityId". This field is linked to the field named "Id" above. the subreport has been set to supress blank subreports.
    In the development environment and running the executable of the application on the development machine the report works perfectly. The subreport displays as it should and all is well.
    When I deploy the report onto user machines where they have the crystal runtime installed, the report keeps asking for a parameter value for the subreport.
    I cannot get this to stop happening.
    This report is urgently required. PLEASE could someone help me out here.
    I am at my wits end.
    I have attached a zipe file containing the following:
    - the two stored procedure
    - the rpt file
    - a sample report
    - a screen showing the report having just been generated
    Thanks in advance,
    Robert Lancaster

    <p>Hi Robert,</p><p>I see your report template and stored procedures. All seems to be ok. <br /></p><p>The most important is to assign the report parameters for all linked subreports (only one in your case).</p><p> </p><p>Try this (in C#, in VB.NET the code are very similary): </p><p>ReportDocument report = new ReportDocument(@"TopFortyReport.rpt");</p><p>AssignParameters(report, paramCollection);</p><p>// and now assign parameters to all linked subreports </p><p>foreach( CrystalDecisions.CrystalReports.Engine.Section section in report.ReportDefinition.Sections)</p><p>{</p><p>    foreach (CrystalDecisions.CrystalReports.Engine.ReportObject reportObject in section.ReportObjects)<br />    {</p><p>        if (reportObject.Kind == ReportObjectKind.SubreportObject) </p><p>        {</p><p>            SubreportObject subReport = (SubreportObject)reportObject;</p><p>            ReportDocument subDocument = subReport.OpenSubreport(subReport.SubreportName);                                               AssignParameters(subDocument, paramsCollection);</p><p>        }</p><p>} </p><p> </p><p>void AssignParameters(ReportDocument report, object[] paramsCollection)</p><p>{</p><p>    int nParams = paramsCollection.Length;</p><p>    for (int iParamIndex = 0; iParamIndex < nParams; iParamIndex++)</p><p>    {</p><p>        if (report.DataDefinition.ParameterFields[iParamIndex].IsLinked())</p><p>            continue;</p><p>        report.SetParameterValue(iParamIndex, paramsCollection[iParamIndex]);</p><p>    }</p><p>}</p><p> </p><p> </p>

  • Help required : Back to back printing for line items.......

    I have a critical requirement:
    Mulitple Handling units are to be printed, with every new handling unit to be printed on a new page and if the line items for a particular handling unit exceeds the page then it should be printed back to back.... PLease help it very urgent. points will be rewarded.....

    go to basic settings an select print mode as "D" means duplex printing..now you will get back top back printing.

  • Bug in Data Collection Changes By Row for Dynamic domains?

    Hello,
    I was using the Data Collection Changes By Row? option on one of my dynamic domains.
    This resulted in a nullpointer exception for selected items on the jspx page.
    After some searching I found this was because the appmodule was null.
    And this was cause by the generated domains beans.xml.
    The generated code was:
    <property-name>applicationModule</property-name>
    <value>#{data.<appmodule datacontrol name>.dataProvider}</value>While it should have been:
    <property-name>applicationModule</property-name>
    <value>#{data.<appmodulename>DataControl.dataProvider}</value>I think this is related to me setting the datacontrolname on the appmodule under custom properties. But I think JHS should be able to detect that?
    Anton

    Anton,
    Currently JHeadstart has no support for customized data control names. However, I have added it to our list of enhancement requests.
    As a workaround, you can customize the Generator Template for the domains bean.
    kind regards,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Urgent Help Required !!!! For using Netscape to open Form on the Intranet

    Hi ,
    I am successfully able to open Form application in a seperate window using IE 5.0.
    I would like to do the same with Netscape Navigator 4.7. The Navigator justshows a page which asks me to download the plugin and then even after I install the plugin it does the same thing over and over again.
    Please help !!!!!
    Regards,
    Rinas

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Andrew Timpone ([email protected]):
    Which version of the JInitiator are you using. In any case, your HTML must specify the correct classid and version in the HTML section for IE as well as the HTML section for Netscape.
    Below is a sample for JInitiator 1.1.7.27 running forms v6.0
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=iso-8859-1">
    <meta name="GENERATOR" content="">
    <title></title>
    <!-- FILE: static.html -->
    <!-- Oracle Static (Non-Cartridge) HTML File Template (Windows NT) -->
    <!-- Rename, and modify tags and parameter values as needed -->
    </head>
    <body bgcolor="#FFFCE8">
    <p><font size="1"><br>
    <br>
    <br>
    </font></p>
    <p align="center">
    <object classid="clsid:093501ce-d290-11d3-a3d6-00c04fa32518"
    codebase="<<your server and path of JInitiator Plug-in goes here>>jinit11727.exe#Version=1,1,7,27"
    align="baseline" border="0" width="1024" height="786">
    <PARAM NAME="CODE" value="oracle.forms.engine.Main">
    <PARAM NAME="CODEBASE" value="/web_code/">
    <PARAM NAME="ARCHIVE" value="/web_code/f60all.jar">
    <PARAM NAME="type" value="application/x-jinit-applet;version=1.1.7.27">
    <PARAM NAME="serverPort" value="4321">
    <PARAM NAME="serverArgs" value="module=<<your form path and name goes here>>">
    <PARAM NAME="serverApp" value="default">
    <PARAM NAME="lookAndFeel" value="oracle">
    <PARAM NAME="separateFrame" value="true">
    <font size="1">
    <COMMENT>
    <embed align="baseline" border="0" width="800" height="600" type="application/x-jinit-applet;version=1.1.7.27"
    java_code="oracle.forms.engine.Main"
    java_codebase="/web_code/"
    java_archive="/web_code/f60all.jar"
    serverport="4321"
    serverargs="module=<<your form path and name goes here>>"
    serverapp="default"
    pluginspage="<<your server and path of JInitiator Plug-in goes here>>"
    colorscheme="Titanium"
    lookAndFeel="oracle"
    separateframe="true">
    <NOEMBED>
    </COMMENT>
    </NOEMBED> </font></object><font size="1"> </font></p>
    </body>
    </html>
    Below is a sample with JInitiator 1.1.5.21 with forms v5.0
    <HTML>
    <!-- FILE: static.html -->
    <!-- Oracle Static (Non-Cartridge) HTML File Template (Windows NT) -->
    <!-- Rename, and modify tags and parameter values as needed -->
    <HEAD><TITLE></TITLE></HEAD>
    <P>
    <OBJECT classid="clsid:9F77a997-F0F3-11d1-9195-00C04FC990DC"
    WIDTH=20
    HEIGHT=20
    codebase="<<your server name and path for JInitiator Plug-in goes here>>jinit115211.exe#Version=1,1,5,21">
    <PARAM NAME="CODE" VALUE="oracle.forms.uiClient.v1_4.engine.Main" >
    <PARAM NAME="CODEBASE" VALUE="/web_code/" >
    <PARAM NAME="ARCHIVE" VALUE="/web_code/f50all.jar" >
    <PARAM NAME="type" VALUE="application/x-jinit-applet;version=1.1.5.21">
    <PARAM NAME="serverPort" VALUE="4321">
    <PARAM NAME="serverArgs" VALUE="module=<<your form path and name goes here>>">
    <PARAM NAME="serverApp" VALUE="default">
    <COMMENT>
    <EMBED type="application/x-jinit-applet;version=1.1.5.21"
    java_CODE="oracle.forms.uiClient.v1_4.engine.Main"
    java_CODEBASE="/web_code/"
    java_ARCHIVE="/web_code/f50all.jar"
    WIDTH=20
    HEIGHT=20
    serverPort="4321"
    serverArgs="module=<<your form path and name goes here>>"
    serverApp="default"
    pluginspage="<<your server name and path for JInitiator Plug-in goes here>>">
    <NOEMBED>
    </COMMENT>
    </NOEMBED></EMBED>
    </OBJECT>
    </BODY>
    </HTML>
    Hi Andy,
    Thanks a lot !!!
    Its working perfectly fine now.
    Regards,
    Rinas
    Hope this helps<HR></BLOCKQUOTE>
    null

  • Help required: class assignment and values for functional location

    Hi All,
    My requirement is to get classification data for a functional location as in IL03.
    Can any one let me know where in the standard program are they getting the assigned classes
    and class values. So that I can use the same logic.
    Thanks.

    FM BAPI_OBJCL_GETDETAIL
    OBJECTKEY                       ?0100000000000011643
    OBJECTTABLE                     IFLOT              
    CLASSNUM                        ZPMI_BLDG          
    CLASSTYPE                       003                
    KEYDATE                         29.07.2009         
    UNVALUATED_CHARS                                   
    LANGUAGE                        EN                 
    Cheers!

  • Help required: Classes and class values for Func Loc

    Dear All,
    I have a requirement to get the classes and values associated with a functional location.
    Any idea how to get this data, as in IL03.
    Thanks,
    nsp.

    Hello nsp,
    You can try to check out the Function module ALM_ME_TOB_CLASSES to see how they fetched class, characteristics and their values.
    You can keep a break-point in this module and run MAM30_031_GETDETAIL and check how we can pass the appropriate values.
    However, above FMs are available from PI 2004.1 SP 14 of release 4.6c, 4.7 and 5.0.
    If you are in ERP 6.0, the FM's are available.
    Hope this helps
    Best Regards,
    Subhakanth

Maybe you are looking for

  • Windows 64 bit cannot be installed

    I Have MacBook Pro Retina display 13 inch dual-core i5 2.4GHz 8GB 256GB, When i'm installing windows 7 on Bootcamp show message error windows 64 bit cannot be installed i need to advise me a solution to this case ???? Mac OSX 10.9.1

  • HT3180 netflix is not appearing in menu

    do I reset my box?

  • Pre shared wep key

    i have recently  joined btfon community and have successfully connected to local hotspots using a nokia 5800 expressmusic mobile phone. while i have been away from home i tried to connect to avavailable hotspots but my phone tells me i require a pre-

  • Naviation buttons on site won't load

    Hi there! I goto a website and the navigation buttons like left and right within the website don't display the arrows? Come sup with E008 or something? I go on safari and it's fine? Is it a script issue or add on? on maybe clearing the cache? Please

  • SecurityException after making client request

    Hi, I have a web application that makes an HTTPS client request to another server using SSL/certificates. I'm using WebLogic classes for the client calls and modelled my code off the WebLogic examples. After making the request (successfully), I get a