Problem in Stored Procedure...

Hi All,
I'm using oracle 8. When i run this procedure i'm not getting any value from the 'test' table(though i have values 'yikes', 'foo', 'test'.. in 'test1' table). What could be the reason? Can someone tell where i'm making the mistake?
This procedure will be called from the java.
Thanks in advance.
Code :
CREATE OR REPLACE PROCEDURE test_repl
is
tid number;
dum number := 1;
len number;
temp varchar2(500) := 'yikes foo test test1 test2 test3';
str varchar2(500) := null;
flag boolean := TRUE;
tstr varchar2(500) := null;
tstr1 varchar2(500) := null;
TYPE stab is TABLE OF varchar2(500)
INDEX BY BINARY_INTEGER;
strtab stab;
tctr number := 1;
CURSOR C1 IS
SELECT DISTINCT(WORD_OID)
FROM TEST KT
WHERE EXISTS (
SELECT WORD_OID
FROM TEST1
WHERE WORD_OID = KT.WORD_OID AND
( UPPER(WORD_TEXT) IN (tstr) OR
UPPER(WORD_TEXT) = UPPER(tstr1) )
BEGIN
tstr1 := temp;
SELECT LENGTH(temp) INTO len FROM DUAL;
WHILE flag
LOOP
IF NVL(dum,0) > 0 THEN
SELECT INSTR(rtrim(temp),' ',1) INTO dum FROM DUAL;
IF NVL(dum,0) > 0 THEN
SELECT UPPER(SUBSTR(temp,1,(dum-1))), UPPER(SUBSTR(temp,(dum+1),len))
INTO str, temp
FROM DUAL;
DBMS_OUTPUT.PUT_LINE('str :' | | str);
IF (str IS NOT NULL) THEN
strtab(tctr) := '''' | | str | | '''';
END IF;
tctr := tctr + 1;
ELSE
SELECT UPPER(temp) INTO str FROM DUAL;
flag := FALSE;
DBMS_OUTPUT.PUT_LINE('str :' | |str);
IF (str IS NOT NULL) THEN
strtab(tctr) := '''' | | str | | '''';
END IF;
tctr := tctr + 1;
END IF;
ELSE
flag := FALSE;
END IF;
END LOOP;
BEGIN
flag := TRUE;
tctr := 1;
WHILE flag
LOOP
IF (strtab(tctr) IS NOT NULL) THEN
IF tctr = 1 THEN
tstr := tstr | | strtab(tctr);
ELSE
tstr := tstr | | ',' | | strtab(tctr);
END IF;
tctr := tctr + 1;
END IF;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
DBMS_OUTPUT.PUT_LINE('Final string : ' | |tstr);
OPEN C1;
LOOP
FETCH C1 INTO tid;
EXIT WHEN C1%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('TID : ' | | tid);
END LOOP;
CLOSE C1;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END test_repl;
null

Hmm.... I'm curious, you have an "IN" statement which contains a variable... like you are dynamically creating the 'list'. Have you done this before and had it work?
I think that it actually creates one big string as far as the SQL parser is concerned... not several strings separated by commas like I think you think it is doing... ie...
IN ("'hello','test','123'")
not
IN ('hello','test','123')
I could be wrong....

Similar Messages

  • Crystal report ReportPageViewer problem using Stored Procedure

    Hi,
    I'm using the ReportPageViewer component in my jsf page, to visualize cystal reports on my web application.
    Everything is working fine when my crystal report queries a table. But, for performances issues, we've changed this to use a stored procedure.
    However, when trying to run the report from my jsf pages, I obtained the following error:
    The QE parameter ''{0}'' could not be found.
    The parameters are exactly the same as before. I can see in the Reportsource that I'm passing to the ReportPageviewer that all the parameters are set with the proper values.
    When running the report from crystal report, I obatin the results, using the same database login/password than my web application.
    Any help would be really appreciated!
    Thanks,
    M�lanie

    Hi Andy Hendrickson,
    Let me understand your problem correctly.
    1) When you run the procedure from command prompt the table gets populated. It is clear.
    2)When you run the procedure in before report trigger you get nothing. Let us analyze why but for now it is clear.
    3) What you mean by "I run the procedure from the command line and leave the data, then run the report I get updated data in the table, but nothing returned to the report."
    Can you please explain a bit more and also update code snippets of what you are using ?
    Thanks,
    Vinod
    Oracle Reports Team

  • Problem with Stored Procedure exection in Sender and Receiver side of JDBC

    Hi All,
    I am facing problem while executing Stored Procedures using sender and receiver sides of JDBC adapter.
    Here is my SP in Oracle DB :
    PROCEDURE EMP                           
    ( ID IN VARCHAR2,NAME IN VARCHAR2,PROCESSED IN VARCHAR2  ) AS                                                          
    BEGIN                                                         
       INSERT INTO EMPLOYEE VALUES (ID, NAME, PROCESSED);COMMIT;END EMP;
    Now I want to execute this SP using sender JDBC channel and receiver JDBC channel.
    Can anyone please help me executing this SP?
    Regards,
    Soorya

    Hi Soorya,
    The receiver Data type should be like this:
    <StatementName>
    <storedProcedureName action=u201D EXECUTEu201D>
        <table>realStoredProcedureeName</table>
    <param1 [isInput=u201Dtrueu201D] [isOutput=true] type=SQLDatatype>val1</param1>
    </storedProcedureName >
      </StatementName>
    Check the link http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    Which DB  are you using?? The sender structure will be like
    <resultset>
    <row>
    <field1></field1>
    <field2></field2>
    <field3></ field3>
    </row>
    </resultset>
    Search SDN you will get lot of examples
    Regards
    Suraj

  • Problem in Stored Procedure with DBMS_OUTPUT statement

    Hi All,
    I am facing a problem in the stored procedure.
    In the stored procedure I am picking records from the table and displaying them in the screen using dbms_output.put_line statement. This works fine if my query fetches few records but in case of many records(84000 records) then the oracle application gets hanged.

    1) How (if at all) does this relate to SQLJ/JDBC? I assume there is some relationship because of the forum you're posting to, so I'm trying to understand whether that relationship is germane to the problem you are having.
    2) Why are you writing 86,000 rows of output to the dbms_output buffer? Why wouldn't your stored procedure return a REF CURSOR to your Java application and just have the Java application iterate through those rows?
    Justin

  • Problem with stored procedure in DB2

    Hi,
    Rigth now im havin a little problem trying to CALL a DB2 SP
    I have a DB2 SP, something like this:
    CREATE PROCEDURE ordenes.XXMOR_GuardaEncabezado
    in p_ORDID     INTEGER,
    in p_ADVID     CHAR     (6),
    in p_ACCTHDRID     CHAR     (6),
    in p_STNID     CHAR     (6),
    in p_ORDTYP     SMALLINT,
    in p_STRDT     varchar(10),
    in p_EDT     char(10),
    in p_MCONTID     CHAR     (16),
    in p_AGYESTNUM     CHAR     (20),
    IN p_PRDID1 CHAR(4),
    in p_RTCRD     CHAR     (6),
    in p_USRFLD1     CHAR     (6),
    in p_USRFL10     SMALLINT,
    in p_TOTSPTORD     INTEGER,
    in p_CMT char(136),
    in p_ROTID CHAR(20),
    in p_Aux1 varchar(15),
    in p_Aux2 varchar(15),     
    in p_Aux3 varchar(15),      
    in p_Aux4 varchar(15),
    in p_Aux5 varchar(15),
    out o_ORDID varchar(15)
    And i calling the SP from my AppModuleImpl java class like this:
    getDBTransaction().createStatement(0).getConnection().prepareCall("CALL ordenes.XXMOR_Ords(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
    i am using this convention to pass the parameters:
    Integer = setInt
    Smallint = setShort
    Char and Varchar = setString
    and getString for the output:
    But i only recibe this exception everytime i try to run the SP: java.sql.SQLException: Parameter type not valid.
    Can anyone help me ! ?
    Ty, regards from Mexico.

    I am using Stored procedure and that is working fine in Oracle
    This is my XI Request structure :
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:read_PROC_GET_ACTIVE_ESIIDS xmlns:ns0="http://reliant.com/xi/BMFR2">
    - <statement>
    - <PROC_GET_ACTIVE_ESIIDS action="EXECUTE">
      <table>TCS.PKG_BMF_MANAGE_SERVICE_DATA.PROC_GET_ACTIVE_MF_ESIIDS</table>
      <in_bmf_partner_id isInput="true" type="VARCHAR">994</in_bmf_partner_id>
      <in_esids isInput="true" type="CLOB">1008901001155950587100:1008901001155950545100:1008901001155950671100:1008901001155950114100</in_esids>
      </PROC_GET_ACTIVE_ESIIDS>
      </statement>
      </ns0:read_PROC_GET_ACTIVE_ESIIDS>
    This is oracle Stored procedure signature :
    PROCEDURE PROC_GET_ACTIVE_ESIIDS
    in_bmf_partner_id           IN   kss_activity_stg_curr_stat.BMF_PARTNER_ID%TYPE,
    in_esids                    IN   CLOB,
    out_recordset               OUT  sys_refcursor
    Let me know if you need any further information.
    Thanks,
    Hetal

  • Problems calling stored procedure with out ref cursors

    Hi,
    I am calling an oracle stored procedure and having problems. This is the code:
    ResultSet cursor1, cursor2, cursor3, cursor4,cursor5,cursor6;
    String sql = "BEGIN SYSADM.PKG_SERVICE.SERV_MAIN(:1,:2,:3,:4,:5,:6,:7,:8,:9) \n; END;";
    CallableStatement call = null;
    try
    call = conn.prepareCall(sql);
    call.setString(1,blah1);
    call.setString(2,blah2);
    call.setString(3,blah3);
    call.registerOutParameter(4,OracleTypes.CURSOR);
    call.registerOutParameter(5,OracleTypes.CURSOR);
    call.registerOutParameter(6,OracleTypes.CURSOR);
    call.registerOutParameter(7,OracleTypes.CURSOR);
    call.registerOutParameter(8,OracleTypes.CURSOR);
    call.registerOutParameter(9,OracleTypes.CURSOR);
    call.execute();
    cursor1 = ((OracleCallableStatement) call).getCursor(4);
    cursor2 = ((OracleCallableStatement) call).getCursor(5);
    cursor3 = ((OracleCallableStatement) call).getCursor(6);
    cursor4 = ((OracleCallableStatement) call).getCursor(7);
    cursor5 = ((OracleCallableStatement) call).getCursor(8);
    cursor6 = ((OracleCallableStatement) call).getCursor(9);
    on the cursor1 = line I get this exception:
    06/08/08 15:07:01 java.lang.ClassCastException: com.evermind.sql.FilterCallableStatement
    this is a web service running in JDeveloper 10.1.2
    Dennis

    Dennis,
    There is only one "data-sources.xml" file in my JDeveloper 10.1.3. It is in the "\j2ee\home\config" subdirectory.
    But the again, I have not used my JDeveloper to create any Web services.
    I really think you should try the JDeveloper and ADF forum.
    Also, there are several debug properties you can set for OC4J.
    Since you say you are using 10.1.2, the following Web page may be helpful:
    http://www.oracle.com/technology/tech/java/oc4j/htdocs/oc4j-logging-debugging-technote.html
    Good Luck,
    Avi.

  • Weird Problem calling Stored Procedure using JDBC

    Scenario is..
    I have J2EE application and calling stored procedure using JDBC.
    My application connects to instance "A" of testDB.
    Schema "A" does NOT own any packages/procedure but granted execute on oracle packages/procedures that reside in schema "B" of testDB.
    In java code I call procedure(proc1) in package(pac1) which internally calls procedure(proc2) in package(pac2).
    The problem occurs when procedure pac2.proc2 is modified. After the modification, my java code fails and throws an exception "User-Defined Exception" and I am also getting "ORA-06508: PL/SQL: could not find program unit being called". This clears up only if I bounce the web container. (This doesn't happen if I modify pac1.proc1 and run my application)
    Has any one faced this problem? Please suggest if any thing can be changed in jdbc code to fix this problem.
    Thanks

    Hi,
    I assume these are PL/SQL packages and that the changes are made at the package specification level?
    If so, it looks like you are hitting the PL/SQL dependencies rules. In other words, if the spec of proc2 is changed, then proc1 is invalidated, since proc1 still depends on the old version of proc2's spec. As a result, if you try to run proc1, its spec must either be explicitly rewritten before it could run again or implicitly recompiled first, if the (implicit) recompilation fails, it won’t run.
    Kuassi http://db360.blogspot.com

  • Problem calling Stored Procedure returning SETOF UDT (Using Spring)

    I am using Spring's StoredProcedure class to call a stored procedure from a PostgreSql database. It returns a set of user defined data types. I'm having a problem in parsing the results returned.
    The user defined data type :
    CREATE TYPE process_states AS (
    process_name text,
    process_type text
    The stored procedure returns a SET of "process_state" :
    CREATE FUNTION inquire_process_state (.....)
    RETURNS SETOF process_state AS '
    SELECT ....
    I hava a Java class extending the Spring StoredProcedure classs.
    public MyProcStats extends StoredProcedure {
    private class ProcStateCallBackHandler implements RowCallBackHandler {
    public void processRow(ResultSet rs) throws SQLException {
    System.out.println(rs.getString(1));
    public MyProcStats (DataSource ds) {
    super(ds, "inquire_process_state");
    super.setFunction(true);
    declareParameter(new SqlOutparameter("rs", Types.OTHER, new ProcStateCallBackHandler());
    declareParameter(new SqlParameter("family_name", Types.VARCHAR) ;
    While testing this class, I get an errormessage
    "java.sql.SQLException:ERROR: cannot display a value of type record"
    I would appreciate if anyone can point out my mistakes. I tried declaring
    new SqlOutParameter("rs", Types.OTHER, "process_state"), but that didn't help.

    As the related posts suggest, you will need to use direct JDBC code for this.
    Also I'm not sure JDBC supports the RECORD type, so you may need to wrap your stored functions with ones that either flatten the record out, or take OBJECT types.

  • PLSQL portlet - problem calling stored procedure -

    Good day folks. My portal version 10.1.2. I have a dynamic page with multiple rows. For simplicity, example here has two columns => id and value. The initial dilemma - The stored procedure specified in the action attribute of the <form> tag has to have parameters that match in name and count to the fields on the html form. But, the number of rows is variable on the form. I currently use pl/sql to generate the page. I have two forms in the html - form A has two static fields id and value, with an action attribute of the stored procedure I want to run. The second html form is form B. It has id_1, value_1, id_2, value_2, id_3, value_3 and so on with a variable number of rows. SO, when the user clicks the "Submit" button at the bnottom of the page, I call a javascript passing in the number of rows. I then loop through the Form B, and for each row of data, I do a submit of Form A. My goal is to run the stored procedure in the database for each row of data in Form B. I use Form A to accomodate the requirement that the stored procedure has to match in name and number the parameters inthe form.
    This is to avoid an update button on each row of data, also.
    The problem - in my javascript, I set the values of Form A to the values from Form B correctly. However, only the last rowis successful in running the procedure. For example, if I have 3 rows in Form B, I want to submit form A 3 times, but, it only seems to submit once for row #3. The weird thing is if I put an alert message after the document.formA.submit(); command, the stored procedure is successfully called for each row in form B, but when I remove the alert, only the last row successfully calls the procedure!
    Thanks in advance if anybody has any ideas -
    Kent

    Let's continue the example of 3 rows.
    It sounds like that you submit the form 3 times in quick succession, and so before the Action for Form A has had time to run and respond for the first row, the second row has been submitted, and therefore the web page will stop trying to display the results from the submit of Row 1 (by this I mean it'll stop the http request, if you do this quick enough then the back-end function won't run). Then the same thing happens to Row 2's submit when Row 3 starts.
    What it sounds like you need to do is to use only 2 parameters, but repeat them on the HTML page, when the submit is run it's passed to oracle as a type 'owa_util.vc_arr'. There is a more comprehensive solution to this problem in another thread:
    passing variable number of arguments in a stored procedure
    Please note though that you have to be careful of the situations where your form only has one row to submit to the oracle function, in this case the data type of the parameter will be a VARCHAR2 rather than a owa_util.vc_arr. The solution to this problem is to always have a an extra dummy parameter which is empty and you skip over it during your processing. (Thought I'd better include this information in case you ran into this problem).
    Hope this helps.
    Cheers,
    Ron.

  • Type_ - Type problem in stored procedures

    From a previous thread:
    Helo Turloch,
    I wasn't precise: column names only translated to type from type_ in the Scratch Editor.
    But if I have a stored procedure, which references to that column (in a SELECT statement, for example) then type_ will be type in the sp only.
    Check out these screenshots:
    http://jutas.eet.bme.hu/~wirving/omwb/
    I used the same windows environment for SQL Developer (WinXP, SQL Server 2000, SQL Developer 1.5.1) but with an Oracle 10g Database under Linux (BIC2g VMware image)
    I hope this help to reproduce the problem.
    ======
    I've just tried this on MS Vista 32-bit, with 1.5.1 SQL Developer + Oracle XE, with this T-SQL schema: T-SQL source code: http://jutas.eet.bme.hu/~wirving/omwb/type_bug_tsql.sql
    After converting the captured model, the column "Type_" is "Type_" in the table, but the reference in sp_foo is "Type": SELECT Type FROM foo
    wirving

    Turloch already logged a bug for your issue:
    bug: 7334662 FORUMS:TRANSLATION SCRATCH EDITOR TYPE_ -> TYPE
    I've updated the bug with the new thread ID and I've also posted your sample code into the bug after I've reproduced the issue inhouse.
    Message was edited by:
    kgronau

  • Probleme with stored procedure in oracle 10 g

    I create a stored procedure for archiving successfully compile but when I select t_sql_statement i have 0 rows :( :(
    create or replace
    PROCEDURE p_archive_test(piv_owner varchar2)
    is
    lv_stmt varchar2(2000) := 'insert /*+ append */ into TABLE1 (COLUMNS)
                                                                     select INS_COLUMNS
                                                                     from TABLE2 tab2@db1
                                                                     where not exists (select null
                                                                                         from TABLE1 tab1
                                                                                         where PKCOLUMNS
    cursor c_tab is
    select tab.table_name,'ERR$_'||tab.table_name ERR_TABLE
    from all_tables tab
              where tab.owner = piv_owner
    -- and tab.table_name = 'action'
    --order by atb.TABLE_ORDER
    -- For each table get the primary key columns     
    cursor c_pk(civ_table_name in all_tables.TABLE_NAME%type)
    is
    select acl.COLUMN_NAME
    from all_cons_columns acl
    ,all_constraints acn
    where acn.OWNER = piv_owner
    and acn.CONSTRAINT_TYPE = 'P'
    and acn.TABLE_NAME = civ_table_name
    and acl.OWNER = acn.OWNER
    and acl.TABLE_NAME = acn.table_name
    and acl.CONSTRAINT_NAME = acn.CONSTRAINT_NAME
    order by acl.POSITION;
    -- For each table get the corresponding table columns names
    cursor c_ins_cols(civ_table_name in all_tab_columns.TABLE_NAME%type)
    is
    select 'tab2.'||atc.COLUMN_NAME column_name
    from all_tab_columns atc
    where atc.OWNER = piv_owner
    and atc.TABLE_NAME = civ_table_name
    order by atc.COLUMN_ID;
    -- For each table get the columns names excluding the primary key columns
    cursor c_upd_cols(civ_table_name in all_tab_columns.TABLE_NAME%type)
    is
    select 'tab1.'||atc.COLUMN_NAME||'=tab2.'||atc.column_name column_name
    from all_tab_columns atc
    where atc.OWNER = piv_owner
    and atc.TABLE_NAME = civ_table_name
    and not exists (select 1
    from all_cons_columns acl
    ,all_constraints acn
    where acl.OWNER = atc.owner
    and acl.TABLE_NAME = atc.TABLE_NAME
    and acl.column_name = atc.column_name
    and acn.OWNER = acl.OWNER
    and acn.TABLE_NAME = acl.TABLE_NAME
    and acn.constraint_type = 'P')
    order by atc.COLUMN_ID;
    -- For each table get the columns names
    cursor c_cols(civ_table_name in all_tab_columns.COLUMN_NAME%type)
    is
    select
    --'tab1.'||
    atc.COLUMN_NAME column_name
    from all_tab_columns atc
    where atc.owner = piv_owner
    and atc.TABLE_NAME = civ_table_name
    order by atc.COLUMN_ID;
    lv_cols varchar2(4000);
    lv_pk_cols varchar2(4000);
    lv_ins_cols varchar2(4000);
    lv_upd_cols varchar2(4000);
    BEGIN
    for r_tab in c_tab
    loop
    lv_cols := '';
    lv_pk_cols := '';
    lv_ins_cols := '';
    lv_upd_cols := '';
    for r_pk in c_pk(civ_table_name => r_tab.table_name)
         loop
    lv_pk_cols := lv_pk_cols||'tab1.'||r_pk.column_name||'=tab2.'||r_pk.column_name||' and ';
    end loop r_pk_loop;
    lv_pk_cols := substr(str1 => lv_pk_cols
    ,pos => 1
    ,len => length(ch => lv_pk_cols) - 5);
    for r_ins_cols in c_ins_cols(civ_table_name => r_tab.table_name)
    loop
    lv_ins_cols := lv_ins_cols||r_ins_cols.column_name||',';
    end loop r_ins_cols_loop;
    lv_ins_cols := substr(str1 => lv_ins_cols
    ,pos => 1
    ,len => length(ch => lv_ins_cols) - 1);
    for r_upd_cols in c_upd_cols(civ_table_name => r_tab.table_name)
         loop
    lv_upd_cols := lv_upd_cols||r_upd_cols.column_name||',';
    end loop r_upd_cols_loop;
    lv_upd_cols := substr(str1 => lv_upd_cols
    ,pos => 1
    ,len => length(ch => lv_upd_cols) - 1);
    for r_cols in c_cols(civ_table_name => r_tab.table_name)
         loop
    lv_cols := lv_cols||r_cols.column_name||',';
    end loop r_cols_loop;
    lv_cols := substr(str1 => lv_cols
    ,pos => 1
    ,len => length(ch => lv_cols) - 1);
    lv_stmt := replace(replace(replace(replace(replace(replace(replace(lv_stmt
    ,'TABLE1'
    ,r_tab.table_name)
    ,'TABLE2'
    ,'DIST_'||r_tab.table_name)
    ,'PKCOLUMNS'
    ,lv_pk_cols)
    ,'UPD_COLUMNS'
    ,lv_upd_cols)
    ,'INS_COLUMNS'
    ,lv_ins_cols)
    ,'COLUMNS'
    ,LV_COLS)
    ,'TABLE3'
    ,R_TAB.ERR_TABLE);
    -- here It highy advisable to store the sql statement that will be submitted
    -- to the SQL engine before executing it dynamically
    insert into t_sql_statement values (lv_stmt);
    execute immediate lv_stmt;
    end loop ;
    commit;
    exception
    when others then
    rollback;
    raise;
    end p_archive_test;

    Welcome to the forum!
    Unfortunately you have posted to the wrong forum. This question is not about sql developer and is more appropriate for the sql and pl/sql forum
    PL/SQL
    Please
    1. repost the question in the SQL and PL/SQL forum
    2. edit this question to tell people to followup in the other forum - post the link to the question in the other forum
    3. mark this question answered so people will followup in the other forum.
    Read the FAQ in the other forum (there will be link at the top right of the page) for how to post a question and the information you need to provide. In particular use 'code' tags (see FAQ for explanation) before and after posted code and always provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    Before you post the new thread I suggest you perform some additional testing by
    1. Modify your code so that it creates the statements but does not execute them. With dynamic sql the most common problem is incorrect syntax and until you have verified that the syntax is both correct and exactly what you want it is a waste of time to execute the statements.
    2. Modify your code to only create one statement (add WHERE ROWNUM = 1 to the main query). If the syntax is wrong it will be wrong for all of the statements so until the code works correctly for one loop it is a waste of time perform 10's or 100' of loops.
    3. Currently you are not committing the creation of the statement itself but only after it is executed. Thus if the execution fails the query that failed won't be available for you to examine. Either commit the INSERT or, at a minimum capture the query into a global variable and add a DBMS_OUTPUT to the exception handler to display the failed query so you can examine and test it to fix any problem.
    Also, by just blindly using the data in ALL_TAB_COLS you are not taking into account that Oracle creates hidden (see the hidden column) and virtual columns that will cause your processing to fail for any tables that use them since you cannot use them directly in queries like you are creating.

  • Problem with stored procedure usage when Toplink api is used

    In one of our applications we used the combination of JBoss4.0.2 application server, Oracle Toplink 10g (9.0.4.5), JDBC Driver Version is ..... 10.1.0.2.0, Database Product Version is Oracle9i Enterprise Edition Release 9.2.0.6.0, j2sdk1.4.2_08
    We faced problem in the application when it is trying to call stored procedure using Oracle Toplink api
    code snippet:
    public ByteArrayOutputStream baos = new ByteArrayOutputStream();
    public PrintStream pos = new PrintStream(baos);
    public String delete(String Id)
    String procedureName = "abc";
    try
    UnitOfWork uow = PersistenceManager.getCurrent().getUnitOfWork();
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName(procedureName);
    call.addUnamedArgumentValue(Id);
    uow.executeNonSelectingCall(call);
    uow.commit();
    catch (Exception e)
    message = e;
    e.printStackTrace(pos);
    message = message+ baos.toString();
    return message;
    Stack Trace:
    Exception [TOPLINK-4002] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.DatabaseException Exception Description: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier 'abc' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier 'abc' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored Error Code: 6550Local Exception Stack: Exception [TOPLINK-4002] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.DatabaseException Exception Description: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier 'abc' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier 'DELETE_LOADED_RESULT_SET' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored Error Code: 6550 at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:227) at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:733) at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:781) at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:642) at oracle.toplink.publicinterface.UnitOfWork.executeCall(UnitOfWork.java:1400) at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:131) at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:115) at oracle.toplink.internal.queryframework.CallQueryMechanism.executeNoSelectCall(CallQueryMechanism.java:164) at oracle.toplink.internal.queryframework.CallQueryMechanism.executeNoSelect(CallQueryMechanism.java:143) at oracle.toplink.queryframework.DataModifyQuery.execute(DataModifyQuery.java:41) at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:493) at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:1958) at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2236) at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1086) at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1038) at oracle.toplink.publicinterface.Session.executeNonSelectingCall(Session.java:816) at com.abc.de.fg.model.resultSet.ResultSetProvider.delete(ResultSetProvider.java:150) at
    Could anyone please let me know what might be the problem in this case.

    Tried and couldn't reproduce the problem using 9.0.4.7.
    Here's the code:
        System.out.println("storedProcedureUnamedValueTest");
        StoredProcedureCall call = new StoredProcedureCall();
        String lastName = "Jones";
        call.setProcedureName("STOREDPROCEDURE_IN");
        call.addUnamedArgumentValue(lastName);
        session.executeNonSelectingCall(call);stored procedure definition in data base:
    CREATE OR REPLACE  PROCEDURE "TEST_904"."STOREDPROCEDURE_IN"  (
         IN_PARAM VARCHAR2) AS
    BEGIN
      UPDATE EMPLOYEE SET F_NAME = 'Indiana' WHERE (L_NAME = IN_PARAM);
    END;log:
    storedProcedureUnamedValueTest
    DatabaseSession(15)--Execute query DataModifyQuery()
    DatabaseSession(15)--Connection(16)--BEGIN STOREDPROCEDURE_IN('Jones'); END;
    DatabaseSession(15)--Connection(16)--reconnecting to external connection poolAndrei

  • Problem using stored procedure to populate table for report

    I have a report that in one instance the user wants the quantity data pulled from a smaller subset of data. My thought was to create a global temporary table and then use a stored procedure to populate this table then pass the table name in a lexical that contains the table name. So my query in the report stays the same except for the lexical table name. This all seems to work except for the procedure populating the table. I thought it might be the global temporary table so I created a real table. When I run the procedure from the command prompt the table gets populated. When I run the procedure in the before report trigger I get nothing. When I run the procedure from the command line and leave the data, then run the report I get updated data in the table, but nothing returned to the report. Any ideas, questions, solutions?
    Thanks
    Andy Hendrickson

    Hi Andy Hendrickson,
    Let me understand your problem correctly.
    1) When you run the procedure from command prompt the table gets populated. It is clear.
    2)When you run the procedure in before report trigger you get nothing. Let us analyze why but for now it is clear.
    3) What you mean by "I run the procedure from the command line and leave the data, then run the report I get updated data in the table, but nothing returned to the report."
    Can you please explain a bit more and also update code snippets of what you are using ?
    Thanks,
    Vinod
    Oracle Reports Team

  • Problem call stored procedure from asp using oo4o

    I am having a problem calling a pl/sql stored procedure from ASP.
    Attached is the code. Any help would be appreciated. There are no errors returned on the page as far as I can tell.
    Sub add_cc_rec(p_location_rental_object_num, p_start_date, p_end_date, p_rate_code, p_quantity)
         'On Error Resume Next     
         Dim msg, stat, p_available, p_free_sell, p_cap_level, p_status_code, p_error_code
         Dim OraDatabase, PlSqlStmt
         Response.Write "In Function add_cc_rec<br>"
         msg = ""
         stat = ""
         p_available = "Y"
         p_free_sell = "Y"
         p_cap_level = "0"
         p_status_code = 2
         p_error_code = ""
         Set OraSession = Server.CreateObject("OracleInProcServer.XOraSession")
         Response.Write "Created OraSession<br>"
         Set OraDatabase = OraSession.OpenDatabase(ORADB, RUUID &"/"& RUPWD, 0)
         'Set OraDatabase = OraSession.DbOpenDatabase(ORADB, RUUID &"/"& RUPWD,cint(0))
         'Set OraDatabase = OraSession.DbOpenDatabase(ORADB, UID &"/"& PWD,cint(0))
         Response.Write "Created OraDatabase with the following parameters<br>"
         Response.Write "Database is " & ORADB & "<br>"
         Response.Write "UserId is " & RUUID & "<br><br>"
         OraDatabase.Parameters.Add "p_location_rental_object_num", p_location_rental_object_num, ORAPARM_INPUT, ORATYPE_VARCHAR2
         OraDatabase.Parameters.Add "p_available", p_available, ORAPARM_INPUT, ORATYPE_VARCHAR2
         OraDatabase.Parameters.Add "p_start_date", p_start_date, ORAPARM_INPUT, ORATYPE_VARCHAR2
         OraDatabase.Parameters.Add "p_end_date", p_end_date, ORAPARM_INPUT, ORATYPE_VARCHAR2
         OraDatabase.Parameters.Add "p_free_sell", p_free_sell, ORAPARM_INPUT, ORATYPE_VARCHAR2
         OraDatabase.Parameters.Add "p_quantity", p_quantity, ORAPARM_INPUT, ORATYPE_VARCHAR2
         OraDatabase.Parameters.Add "p_cap_level", p_cap_level, ORAPARM_INPUT, ORATYPE_VARCHAR2
         OraDatabase.Parameters.Add "p_rate_code", p_rate_code, ORAPARM_INPUT, ORATYPE_VARCHAR2
         OraDatabase.Parameters.Add "p_status_code", p_status_code, ORAPARM_OUTPUT, ORATYPE_NUMBER
         OraDatabase.Parameters.Add "p_error_code", p_error_code, ORAPARM_OUTPUT, ORATYPE_VARCHAR2
         Response.Write "Calling PL/SQL procedure cc_insert <br>"
         Set PlSqlStmt = OraDatabase.CreateSQL("Begin RATELINK_CAPACITY_CONTROL.cc_insert(:p_location_rental_object_num, :p_available, :p_start_date, :p_end_date, :p_free_sell, :p_quantity, :p_cap_level, :p_rate_code, :p_status_code, :p_error_code); end;", ORASQL_DEFAULT)
         Response.Write "PL/SQL procedure cc_insert has been called <br>"
         Response.Write "Status code from PL/SQL procedure cc_insert (" & OraDatabase.Parameters("p_status_code").value & ")<br>"
         Response.Write "Error code from PL/SQL procedure cc_insert (" & OraDatabase.Parameters("p_error_code").value & ")<br>"
         'Response.Write "Error code from PL/SQL procedure cc_insert (" & p_error_code & ")<br>"
         OraDatabase.Parameters.Remove "p_location_rental_object_num"
         OraDatabase.Parameters.Remove "p_available"
         OraDatabase.Parameters.Remove "p_start_date"
         OraDatabase.Parameters.Remove "p_end_date"
         OraDatabase.Parameters.Remove "p_free_sell"
         OraDatabase.Parameters.Remove "p_quantity"
         OraDatabase.Parameters.Remove "p_cap_level"
         OraDatabase.Parameters.Remove "p_rate_code"
         OraDatabase.Parameters.Remove "p_status_code"
         OraDatabase.Parameters.Remove "p_error_code"
         Set OraSession = Nothing
         Set OraDatabase = Nothing
    End Sub

    1 - Can I clear errors on the OraDatabase class. How do
    I do that?They store the last error, should clear itself.
    2. Is this a client side or server side error? If this
    is a client side error, how do I resolve it?Server side error only. Make sure the user you connect as can see 'RATELINK_CAPACITY_CONTROL.CC_INSERT' and has execute permissions on it. You may need to qualify it with a schema name if the connected user is not the schema owner.

  • Problem With Stored Procedure

    Post Author: Ranjith.403
    CA Forum: General
    Hi,
    Am new to crystal reports with stored procedures
    am created a report using a stored procedure in oracle. In that Stored Procedure am Using a temporary table.
    After inserting values into the table am assigning to ref cursor.
    Refcursor having fields like item,onhandstock,purchase rate
    This report working fine in oracle version 9.2.0.1.0 where comes to oracle version 9.2.0.8.0 it's giving the varchar values correctly.
    The Number values are showing as 0.
    Help me to solve it.
    Thanks in Advance,
    Ranjith

    Try modularising this large procedure into smaller procedures and functions, and determine which part is causing you trouble.

  • Problem with Stored procedure in JDBC Synch scenario

    Hello Experts,
    I am working on the scenario which is from HTTP <-> to <-> JDBC. It is a synchronouse scenario. We are using Stored procedure in this scenario.
    1) Please send the response structure for it.
    2) here when i am sending request to the Database it is giving me below error :
    Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'TCS.PKG_BMF_MANAGE_SERVICE_DATA.PROC_GET_ACTIVE_MF_ESIIDS' (structure 'statement'): java.sql.SQLException: Oracle CLOB Helper: java.lang.AbstractMethodError: java/sql/Clob.setString(JLjava/lang/String;)I. Setting message to status failed.
    One of the field in Database stored procedure is of type CLOB. So can you ppl guide me that what might be the solution for this.
    Any help appriciated.
    Thanks,
    Hetal

    I am using Stored procedure and that is working fine in Oracle
    This is my XI Request structure :
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:read_PROC_GET_ACTIVE_ESIIDS xmlns:ns0="http://reliant.com/xi/BMFR2">
    - <statement>
    - <PROC_GET_ACTIVE_ESIIDS action="EXECUTE">
      <table>TCS.PKG_BMF_MANAGE_SERVICE_DATA.PROC_GET_ACTIVE_MF_ESIIDS</table>
      <in_bmf_partner_id isInput="true" type="VARCHAR">994</in_bmf_partner_id>
      <in_esids isInput="true" type="CLOB">1008901001155950587100:1008901001155950545100:1008901001155950671100:1008901001155950114100</in_esids>
      </PROC_GET_ACTIVE_ESIIDS>
      </statement>
      </ns0:read_PROC_GET_ACTIVE_ESIIDS>
    This is oracle Stored procedure signature :
    PROCEDURE PROC_GET_ACTIVE_ESIIDS
    in_bmf_partner_id           IN   kss_activity_stg_curr_stat.BMF_PARTNER_ID%TYPE,
    in_esids                    IN   CLOB,
    out_recordset               OUT  sys_refcursor
    Let me know if you need any further information.
    Thanks,
    Hetal

Maybe you are looking for

  • Problem installing firmware update...

    My MacBook Pro no longer boots. Here's what happened... I downloaded and installed the new EFI firmware update. I shut down my MacBook and then held down the power button to begin the update process. Nothing happened. Nothing displayed on the screen.

  • How do I install mountain lion onto my 2009 macbook?

    Just bought my first Mac and not sure what I'm doing.

  • Sync itunes from laptop to ipad

    how do i sync itunes from laptop to ipad

  • Rest of Passwords for multiple users in 11i

    Hi Hussein, I need to reset the password for 10 Application Users in 11.5.10.2. Please let me know what is the best way. Is it possible to reset the user password from the frontend as well. Thanks -Samar-

  • Transition tutorial for as 3.0?

    so i started my first completely new, from the ground up project since the release of 3.0. i'm a dork, so i was kinda excited to create a new fla file and save 3.0 in the publish settings. so then i got about my business, create a movie clip that i w