Callable Statement Error

Hello EveryBody,
I'm developing a swing application with SQL Server 2000 on back-end. All of my store procedures are working fine Except the following one
CREATE PROCEDURE sp_CheckStock( @product varchar(20), @colour varchar(20),@size varchar(20),@qty int,@result int OUT)
AS
IF Not Exists(Select * from Stock where Product=@product AND
Size=@size AND
Colour=@colour AND
Total_Qty>=@qty)
     Begin
          Set @result=0
          return @result;
     End
else
     Begin
          Select @result=1
          return @result;
     End
Go
I have checked the output of this procedure in SQL Query Analyzer and it is giving me required output, but whenever i try to call it from my application with the following code it throws this exception.
Caused by: java.sql.SQLException: No ResultSet was produced
                                   IConnection con=new ConnectionManager();
                         CallableStatement cstmt = con.open().prepareCall
                                   ( "{call sp_CheckStock(?,?,?,?,?)}");
                                                                 cstmt.setString(1,product);
                                   cstmt.setString(2,color);
                                   cstmt.setString(3,size);
                                   cstmt.setInt(4,qty);
                                   cstmt.registerOutParameter(5, Types.INTEGER);
                              cstmt.executeQuery();
                                   int value= cstmt.getInt(5);
                                   if (value==0){
                                        System.out.println("Not Available");
     else if(value==1){
          System.out.println("Available");
Thanx in advance for advising me any solution.
Regards
Shani

Try using cstmt.execute(); rather than cstmt.executeQuery();

Similar Messages

  • What may be the cause of this error java.sql.SQLException: invalid sql type passed to callable statement in iplanet ussing JNDI

     

    Hi,
    The possibilities can be of various reasons, with the sql statements,
    xml descriptors, data sources, improper drivers anything. To crack down
    the solution, kindly let me know the error messages and what exactly are
    you trying to accomplish.
    Thanks & Regards
    Raj
    manimaran t wrote:
    what may be the cause of this error java.sql.SQLException: invalid sql
    type passed to callable statement in iplanet ussing JNDI
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Error executing a callable statement on a pooled connection

    Hi,
    I have an Oracle function that returns a number:
    create or replace function
    S2B_STOP_STAGE (DOC_ID number, ST_ID number)
    return number ...
    and the following Java code:
    Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:weblogic:pool:madrigalPool");
    String sql = "{? = call S2B_STOP_STAGE(401,1002)}";
    CallableStatement stmt = conn.prepareCall(sql);
    stmt.registerOutParameter(1, Types.INTEGER);
    stmt.execute(sql);
    res = stmt.getInt(1);
    When the execute(sql) statement is executed, a SQLException is thrown:
    java.sql.SQLException: ORA-01008: not all variables bound
    at weblogic.jdbc.pool.PreparedStatement.execute(PreparedStatement.java:121)
    Does anybody have an idea about what may be wrong? I am using Oracle
    8.1.6, the thin driver classes12-81620.zip, and WebLogic 6.0 sp2.
    Thanks,
    Vladimir

    I found out what was wrong. I should have used execute() instead of execute(sql)
    on the callable statement...
    Sorry for the problem.
    Vladimir
    "vladimir" <[email protected]> wrote:
    >
    Hi,
    I have an Oracle function that returns a number:
    create or replace function
    S2B_STOP_STAGE (DOC_ID number, ST_ID number)
    return number ...
    and the following Java code:
    Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:weblogic:pool:madrigalPool");
    String sql = "{? = call S2B_STOP_STAGE(401,1002)}";
    CallableStatement stmt = conn.prepareCall(sql);
    stmt.registerOutParameter(1, Types.INTEGER);
    stmt.execute(sql);
    res = stmt.getInt(1);
    When the execute(sql) statement is executed, a SQLException is thrown:
    java.sql.SQLException: ORA-01008: not all variables bound
    at weblogic.jdbc.pool.PreparedStatement.execute(PreparedStatement.java:121)
    Does anybody have an idea about what may be wrong? I am using Oracle
    8.1.6, the thin driver classes12-81620.zip, and WebLogic 6.0 sp2.
    Thanks,
    Vladimir

  • Statement closed when using callable statements with oracle xe

    hi all, i've got this problem with oracle express edition 10g. I am using also oc4j v10.1.2.0.2. When working with a normal oracle database it was working fine (i think the code was the same, it's some time since i last tried, but you can see the code is very simple).
    So i just create a callable statement like this:
    CallableStatement cs = con.prepareCall(sentencia.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE, ResultSet.HOLD_CURSORS_OVER_COMMIT);
    and then when trying to access the statement to register an out parameter like this
    cs.registerOutParameter(1, parámetros[0].getTipo());
    it gives this error:
    java.sql.SQLException: Statement was closed
    It's puzzling me because, as i said before, i think the same code was working ok with a normal oracle database.
    Any idea what can it be?
    cheers

    Ah okay, sorry I've re-read your post.
    I believe you need to create a clob object that encapsulates your xml file.
    I've never done this but I would image it involves creating a class that implements the clob interface and passing an instantiation of this class to the callablestatement.
    Let me know how you get on.

  • Callable Statement throws exception..pls help

    When I use Callable Statement calling my function which returns Y if person is employee or nothing if not I get this error..
    Procedure not createdORA-06550: line 1, column 22:
    PLS-00103: Encountered the symbol "CHCK_EMP_STATUS" when expecting one of
    the following:
    . ( * @ % & = - + ; < / > at in mod not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like
    between is null is not || is dangling
    The symbol "." was substituted for "CHCK_EMP_STATUS" to continue.
    Here is my code..
    import java.sql.*;
    import java.io.*;
    public class FunctionTest
         public static void main(String args[])
              Connection conn = null;
              CallableStatement stmt = null;
              ResultSet rs=null;
         try
         Class.forName("oracle.jdbc.driver.OracleDriver");
         conn = DriverManager.getConnection("........");
         stmt = conn.prepareCall("{call function chck_emp_status(?,?)}");
              stmt.setString(1,"137897");
              stmt.registerOutParameter(2,Types.VARCHAR);
              stmt.execute();
              String s = stmt.getString(1);
              stmt.close();
              conn.commit();
              conn.close();
              }//try
              catch(Exception e)
         System.out.println("Procedure not created"+e.getMessage());
              finally
         }//main
    Please help...

    This is the function
    CREATE OR REPLACE function chck_emp_status (id number) return varchar2
    as
    emp_id          number;
    results          varchar(2);
    cursor emp_status is
         select id
         from emp
         where emp_status = 'A'
    and emp_id = id;
    begin
         open emp_status;
         fetch emp_status into emp_id;
         if emp_id%notfound THEN
              results := '';
         else
              results := 'Y';
         end if;
         close emp_id;
         return results;
    end;

  • Callable Statement Exception

    Hi,
    I am very new to Java SQL Callable Statement.
    The following is the program that i wrote to execute a Stored Procedure stored in MS SQL Server 2000.
    In my program I am actually retrieving back the value that I've passed to the MS SQL Server.
    ========================================
    import java.sql.*;
    import java.sql.Types;
    public class CallableTester
         private Connection connection;
         public CallableTester(Connection conn)
              connection = conn;
         public void executeInsert ()
         CallableStatement stmt = null;
         String sqlstmt;
         int rows;
         try {
              sqlstmt = "{ ? = call product(?, ?, ?, ?) }";
              stmt = connection.prepareCall(sqlstmt);
              stmt.setString(1, "61");
              stmt.setString(2, "62");
              stmt.setString(3, "63");
              stmt.setString(4, "67");
              stmt.registerOutParameter(1, Types.VARCHAR);
              stmt.executeUpdate();
              connection.commit();
              System.out.println("The value inserted are " + stmt.getString(1));
              stmt.close();
              System.out.println(sqlstmt);
         catch (Exception e){
              e.printStackTrace();
    =========================================
    The is no syntax error.
    When I run the program, I've got the following exception
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect
    or syntax error
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:2567)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedState
    ment.java:217)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPrepare
    dStatement.java:139)
    at CallableTester.executeInsert(CallableTester.java:38)
    at DatabaseConnection.makeConnection(DatabaseConnection.java:22)
    at Start.main(Start.java:16)
    =========================================
    My database has a table named Product with the following fields and properties.
    Field id of type varchar
    Field name of type varchar
    Field costPrice of type decimal
    Field sellPrice of type decimal.
    =========================================
    The stored procedure for this table is
    CREATE PROCEDURE product @id varchar(8) = 8, @name varchar(50) = "productName", @costprice decimal = 88, @sellprice decimal =168 AS
    INSERT INTO PRODUCT VALUES(@id, @name, @costprice, @sellprice, @desc)
    GO
    =========================================
    Can anyone please to help me? I have been trying to solve this problem few days but I really can't.
    Your help will be appreciated.
    Thank you very much.

    I've reproduced your code with some modifications to make it work, I've tested it against a Sybase DB which is close enough to MS SQL Server.
    First the procedure. Note that I create and write to a temp table you can ignore this.
    create proc dmjtest
      @id varchar(8) = '8',
      @name varchar(50) = 'Dave Jenkins',
      @costPrice decimal = 1.23,
      @sellPrice decimal = 4.56
    as
    begin
      declare @rc int
      select @rc = 0
      create table #t (
        id varchar(8),
        name varchar(50),
        costPrice decimal,
        sellPrice decimal
      insert #t values (@id, @name, @costPrice, @sellPrice)
      if @@error = 0 select @rc = 1
      drop table #t
      return @rc
    endNow for the java code
    import java.sql.*;
    import java.sql.Types;
    public class CallableTester
      private Connection connection;
      public CallableTester(Connection conn) {
        connection = conn;
      public void executeInsert () {
        CallableStatement stmt = null;
        String sqlstmt;
        int rows;
        try {
          stmt = connection.prepareCall("{ ? = call dmjtest(?, ?, ?, ?) }");
          stmt.registerOutParameter(1, Types.INTEGER);
          stmt.setString(2, "1");
          stmt.setString(3, "product 1");
          stmt.setDouble(4, 63.0);
          stmt.setDouble(5, 67.0);
          stmt.executeUpdate();
          connection.commit();
          System.out.println("The return value is " + stmt.getInt(1));
          stmt.close();
        catch (Exception e){
          e.printStackTrace();
    }

  • Callable statement doubt-urgent

    hi all,i got a problem in callable statements.i know how to pass parameters to a procedure using a callable statement.but this time i need to pass a table name as a parameter.the problem is if i get that variable as a IN parameter in the procedure then how do you put that parameter in place of table name inside the procedure.heres a example,the pocedure is in oracle
    i am passing variable a from java
    create or replace procedure (a in varchar2)
    begin
    select * from <the parameter passed through a> where <condition>
    end;
    how can this be done.the select statement is given only as a example.the errors in the select are not emphasized here.the focus is on the table name.if there is any other way to do this do let me know.please reply fast.this is urgent.any kind of help is welcome.bye thiyagu.

    In some databases the SQL used in your stored procedure can reference 'variables' that contain the values to be used at statement execution time. This will be covered in your database's SQL reference. If this is not supported by your database you will have to perform a 'switch' based on the table name passed and select the SQL statement to be executed.

  • Problems with Callable Statement

    Hi All,
    I have a problem with the callable statement that contains stored procedure.Here main thing i want to know is that can a stored procedure can be used for a database like Access.Because i am using Access as a database here.In which i have created the table Students.
    The table Students contains 3 fields they are name,amount & balance.
    The program is compiling well but during the runtime it is showing an error:-
    "Syntax error in Create Table" .
    For ur reference i have posted the code:-
    import java.io.*;
    import java.sql.*;
    public class CallStatDemo
    public static void main(String arg[])
    Connection con;
    CallableStatement cs;
    Driver dr;
    String str1,str2;
    int in1,in2;
    double d1;
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:Ananth"); //the dsn name is Ananth
    init(con);
    if(con==null)
    System.out.println("Connection not Established");
    else
    cs=con.prepareCall("{call Payment(?,?)}");
    cs.setString(1,"Raman"); //name
    cs.setString(2,"2000"); //amount
    cs.execute();
    catch(Exception e)
    System.out.println("Error Message : "+e);
    static void init(Connection con)
    throws SQLException
    Statement stmt = con.createStatement();
    stmt.execute ("create or replace procedure Payment(name in text,amount in text)is " +
    " begin"+
    " update Students set balance=balance-amount where name =name;"+
    "end Payment;");
    stmt.close();
    Thanx,
    m.ananthu

    I have no clue if Access supports stored procedures, and this surely isn't related to JDBC at all. Did you check your Access documentation?
    Your posted code does not contain any CREATE TABLE statement, so where do you get your error (which line)
    Most probably Access does not support stored procedures. To verify that, you should execute your CREATE PROCEDURE statement from within Access, to verify that it is a supported statement.

  • Help with Callable Statements

    Hi,
    I am working on a problem which requires me to insert record into the database (mySQL) using Callable Statements.
    For this I have written 2 Stored Procedures (SP) which are as follows:
    CREATE DEFINER=`root`@`localhost` PROCEDURE `GeneratePcId`()
    BEGIN
    select max(pc_id)+1 from price;
    END $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `InsertPrice`(pc_id INT, pc_level INT, price INT, from_date DATE, to_date DATE)
    BEGIN
    INSERT INTO price VALUES (pc_id, pc_level, price, from_date, to_date);
    END $$
    The frist SP returns a number that adds 1 to the max of pc_id column which is the PK and max means the last row value.
    This value I want to use as a value for inserting the new row into the table. I have worked on this and the program chunk is here:
               // Create CallableStatement object 
                CallableStatement genid = conn.prepareCall("{? = call GeneratePcId()}");
                genid.registerOutParameter(1, Types.INTEGER);
                //ResultSet rs = (ResultSet)genid.executeQuery();
                //rs.next();
                genid.executeUpdate();
                int number = genid.getInt(1);
                CallableStatement cstmt = conn.prepareCall("{call InsertPrice (?, ?, ?, ?, ?)}");     
                // Bind values to the parameters           
                cstmt.setInt(1, number );           
                cstmt.setInt(2, 8);           
                cstmt.setInt(3, 600);           
                cstmt.setDate(4, Date.valueOf("2008-01-01"));           
                cstmt.setDate(5, Date.valueOf("2008-02-02"));       But when I run this program I get the following error:
    java.lang.NullPointerException at com.mysql.jdbc.CallableStatement$CallableStatementParamInfo.iterator(CallableStatement.java:324)
    at com.mysql.jdbc.CallableStatement.setInOutParamsOnServer(CallableStatement.java:1938)
    at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:749)
    at com.mysql.jdbc.CallableStatement.executeUpdate(CallableStatement.java:808)
    at CallableStatementExercise.query(CallableStatementExercise.java:36)
    at CallableStatementExercise.main(CallableStatementExercise.java:13)
    Line 13 points to genid.executeUpdate();
    Can anybody please advise me what the problem is?
    Shall be really grateful.
    Templar_Knight
    Message was edited by:
    templar_knight

    mervin,
    Find the following sample code regarding your issue,
    CallableStatement cstmt = (java.sql.Connection).prepareCall("{call getTestData(?)}");
                   cstmt.registerOutParameter(1, java.sql.Types.INTEGER);
                   cstmt.registerOutParameter(2, java.sql.Types.DECIMAL);
                   ResultSet rs = cstmt.executeQuery();
    //. . . retrieve result set values with rs.getter methods
                   java.lang.Integer x = cstmt.getInt(1);
                   java.math.BigDecimal n = cstmt.getBigDecimal(2);
    I think your issue is resolved.

  • Regarding callable statement

    Hi all,
    I have a stored procedure which executes in sql query analyzer in 2 seconds.
    It executes without any error. after execution of the stored procedure i get near about 4000 records.
    Now i am trying to call the stored procedure using the callable statement.
    It hangs on the line :
    callablestatement.prepareCall("{call myproc}");at this lines nothing happens, nor i get any kind of exception. but my page just hangs. and nothing happens.

    Hi
    Do u write callablestatement.prepareCall or sqlConnection.prepareCall ();
    Have a look at the syntax for this at the following link.
    http://java.sun.com/j2se/1.3/docs/api/java/sql/CallableStatement.html
    Further you need to register any out parameters using registerOutParameter ()
    and use
    callablestmt.execute () to execute your stored proc.
    HTH, Do revert back.
    VJ

  • Naming the parameters of a callable statement

    Hi!
    I am having some kind of a problem here. I am currently working on a software with a database.OK, simple.
    The problem is that we have different kind of databases (oracle, Sybase, DB2) AND different schema!
    We are obviously trying to keep the persistence layer as cut from the rest as possible.
    The problem is that in some cases, we may call a callable statement but the actual callable statement in the database is not the same as the one that would be called in a similar case with another schema.
    Therefore, we are looking for a way to set the parameters of a callable statement by a name, not an index.
    Instead of
    setString(1,"aValue");
    some
    setString("FirstParameter", "aValue");
    PLease help!
    Cheers!
    Chris

    I think there is a driver that does that.Thanks for replying so quickly, could you tell me what
    that driver would be ?Like I said I don't think it is going to help because it is for a specific data base. I you need to support more than one.
    I think it is either Oracle (if you use the Oracle specific JDBC classes - cast to them) or one of the third party drivers.
    >
    I was thinking of the wrapper too but I, as the
    (different)schemas are still changing and the callable
    statement too, I think it will be very error prone
    during the developpement cycle.
    So I'd like to avoid to have to maintain a
    "correspondance table" between each callable statement
    and it's parameters...
    And that is my idea. Developement cycles are always error prone so I am not sure that it matters.

  • TABLE ILLEGAL STATEMENT  error with MODIFY command

    Hi gurus,
    i want you to inform me about table illegal statement error. The error occurs when i use modify as below.
    loop at itab.
       select .......
             where xxx eq itab-xxxx.
           MODIFY itab.
      endselect.
    endloop.
    i know that i have to give the sy-tabix as INDEX parameter to the modify command. but i want to know why i have to do this?
    cause when i debug, i follow the sy-tabix field and it have not a change in select endselect.
    may the reason of the error about cursor in select and cursor effects modify command?
    or why?
    Thx,

    Hello,
    I guess this is because your MODIFY statement is inside the SELECT ... ENDSELECT & not inside the LOOP ... ENDLOOP.
    SAP documentation says:
    Within a LOOP loop, the INDEX addition can be ommitted. In this case the current table line of the LOOP loop is changed.
    You have to change the coding:
    DATA: v_index TYPE i.
    loop at itab.
    v_index = sy-index.
    select .......
    where xxx eq itab-xxxx.
    MODIFY itab INDEX v_index.
    endselect.
    endloop.
    BR,
    Suhas
    PS: The coding practice followed is not very performance oriented as well. May be you should have a look around in some blogs, wikis in SCN & change the code accordingly.
    Edited by: Suhas Saha on Nov 19, 2009 9:41 AM

  • Using A callable statement in java

    Hi all im trying to get results back from the database using a callable statement the problem is that it is placing / infront of single quotes.I need to get rid of this because it's not returning anything
    here is my code
    CallableStatement statementOne;
    statementOne = ComparitiveAnalysisGUI.conn.prepareCall("{call graphProc(?,?,?,?,?,?,?)}");
    statementOne.setString(1,"\"date_format(calldate, '%Y-%m-%d H:59:59'),avg(billsec)\"");
    statementOne.setString(2,"Clovercdr");
    statementOne.setString(3,start);
    statementOne.setString(4,end);
    statementOne.setString(5,"Boksburg");
    statementOne.setString(6,"\"billsec > 0 and Network = " + network + "\"");
    statementOne.setString(7,"\"date_format(calldate, '%Y-%m-%d %H:M:S')\"");
    System.out.println(statementOne.toString());
    rs = statementOne.executeQuery();
    the result of the println is
    com.mysql.jdbc.CallableStatement@ec4a87: CALL graphProc('"date_format(calldate, \'%Y-%m-%d %H:59:59\'),avg(billsec)"','Clovercdr','\'2006-03-14 00:00:01\'','\'2006-03-14 23:59:59\'','Boksburg','"billsec > 0 and Network = \'SAMobile\'"','"date_format(calldate, \'%Y-%m-%d %H:M:S\')"')
    as you can see quite a mess please help if you can get the statement to look as follows
    CALL graphProc("date_format(calldate, '%Y-%m-%d %H:59:59'),avg(billsec)",'Clovercdr','2006-03-14 00:00:01','2006-03-14 23:59:59','Boksburg',"billsec > 0 and Network = 'SAMobile'","date_format(calldate, '%Y-%m-%d %H:M:S')")
    thanks Brian

    Ok in order to understand why I did what I did parhaps it would be best if you saw my Stored procedure
    create procedure graphProc(col varchar(100),company varchar(20),startTime datetime,endTime datetime,branchName varchar(20),andSection varchar(200),groupSec varchar(100))
    BEGIN
    SET @stmt := CONCAT("SELECT ",col," from ",company," where calldate between '",startTime,"' and '",endTime,"' and branchName = '",branchName,"' and ",andSection," Group by ",groupSec);
    PREPARE stmt1 from @stmt;
    EXECUTE stmt1;
    the call is for example
    call graphProc("date_format(calldate, '%Y-%m-%d %H:59:59'),avg(billsec)",'Clovercdr','2006-03-01 00:00:01','2006-03-14 23:59:59','Boksburg',"billsec > 0 and date_format(calldate, '%k') BETWEEN 7 AND 19 and Network = 'SAMobile'","date_format(calldate, '%Y-%m-%d %H:M:S')")//
    as you can see In MySQL the "date_format(calldate, '%Y-%m-%d %H:59:59'),avg(billsec)" has to be quoted like this, so it can recognise it as a single parameter, since , '%Y-%m-%d %H:59:59' is viewed as another parameter
    thaks for your reply
    Brian

  • Return records from Stored Procedure to Callable Statement

    Hi All,
    I am createing a web application to display a students score card.
    I have written a stored procedure in oracle that accepts the student roll number as input and returns a set of records as output containing the students scoring back to the JSP page where it has to be put into a table format.
    how do i register the output type of "records" from the stored function in oracle in the "registerOutParameter" method of the "callable" statement in the JSP page.
    if not by this way is there any method using which a "stored function/procedure" returning "record(s)" to the jsp page called using "callable" statement be retrieved to be used in the page. let me know any method other that writing a query for the database in the JSP page itself.

    I have a question for you:
    If the stored procedure is doing nothing more than generating a set of results why are you even using one?
    You could create a view or write a simple query like you mentioned.
    If you're intent on going the stored procedure route, then I have a suggestion. Part of the JDBC 2.0 spec allows you to basically return an object from a CallableStatement. Its a little involved but can be done. An article that I ran across a while back really helped me to figure out how to do this. There URL to it is as follows:
    http://www.fawcette.com/archives/premier/mgznarch/javapro/2000/03mar00/bs0003/bs0003.asp
    Pay close attention to the last section of the article: Persistence of Structured Types.
    Here's some important snippets of code:
    String UDT_NAME = "SCHEMA_NAME.PRODUCT_TYPE_OBJ";
    cstmt.setLong(1, value1);
    cstmt.setLong(2, value2);
    cstmt.setLong(3, value3);
    // By updating the type map in the connection object
    // the Driver will be able to convert the array being returned
    // into an array of LikeProductsInfo[] objects.
    java.util.Map map = cstmt.getConnection().getTypeMap();
    map.put(UDT_NAME, ProductTypeObject.class);
    super.cstmt.registerOutParameter(4, java.sql.Types.STRUCT, UDT_NAME);
    * This is the class that is being mapped to the oracle object. 
    * There are two methods in the SQLData interface.
    public class ProductTypeObject implements java.sql.SQLData, java.io.Serializable
        * Implementation of method declared in the SQLData interface.  This method
        * is called by the JDBC driver when mapping the UDT, SCHEMA_NAME.Product_Type_Obj,
        * to this class.
        * The object being returned contains a slew of objects defined as tables,
        * these are retrieved as java.sql.Array objects.
         public void readSQL(SQLInput stream, String typeName) throws SQLException
            String[] value1 = (String[])stream.readArray().getArray();
            String[] value2 = (String[])stream.readArray().getArray();
         public void writeSQL(SQLOutput stream) throws SQLException
    }You'll also need to create Oracles Object. The specification for mine follows:
    TYPE Detail_Type IS TABLE OF VARCHAR2(1024);
    TYPE Product_Type_Obj AS OBJECT (
      value1  Detail_Type,
      value2 Detail_Type,
      value3 Detail_Type,
      value4 Detail_Type,
      value5 Detail_Type,
      value6 Detail_Type,
      value7 Detail_Type,
      value8 Detail_Type);Hope this helps,
    Zac

  • How to get the returned value from Functions with Callable statement?

    I was glad to find that stored procedures can be invoke with Java class code by the object of Callable statement like :
    String stmt = "BEGIN departments_pkg.do_select(?,?,?); END;";
    and getting the output variables by
    populateAttribute(DEPARTMENTNAME,st.getString(2),true,false);
    But i would like to get values returned from FUNCTION other than stored procedure, how can i achieve it? Thanks a lot!

    Here is  my code
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_1202.
      MODULE subscreen_find.
      CALL SUBSCREEN SUBSEARCH INCLUDING sy-cprog dynnr.
    PROCESS AFTER INPUT.
      MODULE USER_COMMAND_1202.
      CALL SUBSCREEN SUBSEARCH.
    MODULE subscreen_find.
      case sy-ucomm.
        when 'SELECTED'.             "fcode
          case 'ZSKILL_SEARCH'.     "data element
            when '01'.                       " value range
              dynnr = 0110.
            when '02'.
              dynnr = 0111.
          endcase.
      endcase.
    ENDMODULE.
    kindly tell me what is wrong
    Edited by: Raji Thomas on Feb 8, 2010 10:20 AM

Maybe you are looking for

  • My iPod Won't Restore

    OK, so I plug in my iPod Touch to my computer (Windows Vista) and its in recovery mode at the moment and i have to restore it but every time i try it doesn't work, i comes up with an error and then goes back to recovery mode. Any help? Ed

  • Upscaled dv for anamorphic and want to know about adjusting gamma etc.

    I took my dv ntsc 4:3 (3:2 really shot on dvcam on the dvx100a) timeline and nested it in an anamorphic sequence to render out a quicktime with the 1:85 matte on it and to apply an rgb limiter as when it upscales some of my broadcast safe get hot aga

  • Is it possible to just upgrade to the next version?

    I have version 3.1 of Aperture and just bought a MacBook Pro with Retina would like to upgrade to the latest version, but cannot find an upgrade option. Does anyone know if this is possible? Thanks Shirley

  • Removing all Folding At Home app files.

    I've been running Folding @ Home on my iMac for over a year and decided to stop and remove the application. Following FAH instructions on their web site, I stopped the work it was doing, closed the program and dragged the FAH app folder into the tras

  • Java for Mac OS X 10.5 Update 2

    Software Update keeps telling me that this update is available, even after multiple "successful" installations and reboots. Any ideas why? $ java -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-28