IntelliJ open source
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JDBC
 
RSS feed
 
New topic
Author

OUT as Table in StoreProcedure

Prashant Saraf
Ranch Hand

Joined: Sep 25, 2006
Messages: 30

Hi,
I have an oracle store procedure which return TABLE RECORD
here is procedure



I want to know how to read OUT of above procedure.

Thanks


This message was edited 1 time. Last update was at by Prashant Saraf

Jan Cumps
Bartender

Joined: Dec 20, 2006
Messages: 1112

Do you want to know how to read this OUT parameter in Java, with JDBC?

tune in turn on phase out
ITIL Foundation
OMG UML Fundamental
Prashant Saraf
Ranch Hand

Joined: Sep 25, 2006
Messages: 30

Jan Cumps wrote:Do you want to know how to read this OUT parameter in Java, with JDBC?


I do know how to read OUT for Procedure. I want to know how to read the OUT of RECORD TABLE type?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Messages: 1112

Prashant,

my excuses, but I still don't understand it.
Where do you want to read the OUT parameter?
  • In a pl/sql program?
  • In a java program?
  • Somewhere else?


  • Can you post the piece of code where you are trying to read the OUT parameter?

    This message was edited 1 time. Last update was at by Jan Cumps


    tune in turn on phase out
    ITIL Foundation
    OMG UML Fundamental
    Prashant Saraf
    Ranch Hand

    Joined: Sep 25, 2006
    Messages: 30

    Jan Cumps wrote:Prashant,

    my excuses, but I still don't understand it.
    Where do you want to read the OUT parameter?
  • In a pl/sql program?
  • In a java program?
  • Somewhere else?


  • Can you post the piece of code where you are trying to read the OUT parameter?


    Sorry Jan, I am using JDBC to read the OUT Parameter.

    Java Code is




    I want to know what Type to use in registerOutParameter method.

    Thanks
    Prashant

    This message was edited 1 time. Last update was at by Prashant Saraf

    Jan Cumps
    Bartender

    Joined: Dec 20, 2006
    Messages: 1112

    The procedure has 2 parameters and is called getChildRelationsByInstanceId , and the JDBC code shows three parameters (question marks) and is called proc3.

    tune in turn on phase out
    ITIL Foundation
    OMG UML Fundamental
    Jan Cumps
    Bartender

    Joined: Dec 20, 2006
    Messages: 1112

    Here is the way to retrieve user defined types:
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/objects/ObjectTypes.html

    If you can write your stored procedure so that it returns a cursor to that table, you can programs your JBDC like this:
    http://www.enterprisedt.com/publications/oracle/result_set.html

    tune in turn on phase out
    ITIL Foundation
    OMG UML Fundamental
    Prashant Saraf
    Ranch Hand

    Joined: Sep 25, 2006
    Messages: 30

    hi
    here is my code



    On cstmt.execute(); it throws following exception.

    java.sql.SQLException: ORA-03115: unsupported network datatype or representation


    my procedure returns TABLE of RECORD.

    Please help
     
     
     
    Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JDBC
     
    RSS feed
     
    New topic

    .