Calling a package.procedure that accepts a type table.

I'm getting the error "Error(45,20): PLS-00330: invalid use of type name or subtype name" when I run the procedure SP when it calls the d.is_date procedure that accepts a table as the second parameter.
below is the Abbreviated code for the package.procedures that contain the "is_date".
I've tried several things and can't seem to get SP to compile.
thanks.
create or replace
PROCEDURE SP AS
valid_out boolean;
date_out date;
date_fmt_out varchar2(30);
type Mask_Tabtype is
table of varchar2( 30 )
index by binary_integer;
Fmts Mask_Tabtype;
BEGIN
Fmts( 1 ) := 'fxDD-MON-RR';
Fmts( 2 ) := 'fxDD-MON-YYYY';
Fmts( 3 ) := 'fxDD-MON';
Fmts( 4 ) := 'fxMM/DD';
Fmts( 5 ) := 'fxMM/RRRR';
d.Is_Date( 'test', Mask_Tabtype, Valid_out, Date_out, Date_Fmt_out);
END SP;
create or replace package d as
type Mask_Tabtype is
table of varchar2( 30 )
index by binary_integer;
Fmts Mask_Tabtype;
Procedure Is_Date( Value_in in varchar2,
Tab in Mask_Tabtype,
Valid_out out boolean,
Date_out out date,
Date_Fmt_out out varchar2);
end d;
create or replace package body d as
Fmt_Count integer;
Date_Val date := null;
Date_Fmt varchar2( 30 ) := 'fxMM/DD/YYYY';
Procedure Is_Date(value_in in varchar2, Tab In Mask_Tabtype,
Valid_out out boolean, Date_out out date, Date_Fmt_Out out varchar2)
is
begin
/* Logic here removed to make post smaller
End Is_date;
End d;

Here...
d.Is_Date( 'test', Mask_Tabtype, Valid_out, Date_out, Date_Fmt_out);you are passing in Mast_Tabtype, which is a type declaration, rather than a variable of that type.
Try...
d.Is_Date( 'test', Fmts, Valid_out, Date_out, Date_Fmt_out);

Similar Messages

  • How to call a stored procedure that use a type defined in a package?

    Hi all,
    this is stored procedure:
    GET_GIORNATAEVENTO( in_nome_servizio IN VARCHAR2,
    out_dati_aggiornati OUT TAB_VARCHAR2);
    TAB VARCHAR2 is defined in the package specification:
    TYPE tab_varchar2 IS TABLE OF VARCHAR2(5) INDEX BY BINARY_INTEGER;
    and this is the name of the package: PKG_SERVIZI_MMSPUSH.
    This is my php script:
    <?php
    // Connect to database...
    $c=OCILogon("venus_vfl", "venus_vfl", "venvi");
    if ( ! $c ) {
    echo "Connessione non riuscita: " . var_dump( OCIError() );
    die();
    echo "<br>PKG_SERVIZI_MMSPUSH.GET_GIORNATAEVENTO</br> ";
    echo "<br> </br>";
    // Call database procedure...
    $in_servizio = "MOTO";
    $s = OCIParse($c, "begin PKG_SERVIZI_MMSPUSH.GET_GIORNATAEVENTO(:bind1, :bind2); end;");
    OCIBindByName($s, ":bind1", $in_servizio);
    OCIBindByName($s, ":bind2", $out_esito);
    OCIExecute($s,OCI_DEFAULT);
    echo "OUT_DATI_AGGIORNATI= " . $out_esito;
    // Logoff from Oracle
    OCILogoff($c);
    ?>
    How to test stored procedure to get the output parameter?
    Thanks in advance.

    Thanks,
    but I need to test stored procedures that uses type defined in the package.
    e.g.
    if I have s.p.
    PROCEDURE get_risultati_squadra
    ( in_squadra IN VARCHAR2,
    out_serie OUT tab_varchar2_5,
    out_tiporisultato OUT tab_varchar2_5,
    out_n_giornata OUT tab_varchar2_5,
    out_squadre OUT tab_varchar2_200,
    out_risultato OUT tab_varchar2_10,
    out_marcatore OUT tab_varchar2_50,
    out_punti OUT tab_varchar2_3,
    out_rimbalzista OUT tab_varchar2_50,
    out_rimbalzi OUT tab_varchar2_3,
    out_esito OUT tab_varchar2_2);
    I have to define every type external to the package, in this case five new TYPE !!
    Is there another way to solve this problem?
    Thanks

  • How to call a stored procedure that has Table Of data types in VB6?

    Hi everyone,
    I need to call a stored procedure that has a Table Of data type as an input parameter (possibly even several Table Of input parameters). I can't seem to find any example of how to do this in VB6 using ODBC. Is this even possible?
    Thanks you!
    Steve

    Thanks,
    but I need to test stored procedures that uses type defined in the package.
    e.g.
    if I have s.p.
    PROCEDURE get_risultati_squadra
    ( in_squadra IN VARCHAR2,
    out_serie OUT tab_varchar2_5,
    out_tiporisultato OUT tab_varchar2_5,
    out_n_giornata OUT tab_varchar2_5,
    out_squadre OUT tab_varchar2_200,
    out_risultato OUT tab_varchar2_10,
    out_marcatore OUT tab_varchar2_50,
    out_punti OUT tab_varchar2_3,
    out_rimbalzista OUT tab_varchar2_50,
    out_rimbalzi OUT tab_varchar2_3,
    out_esito OUT tab_varchar2_2);
    I have to define every type external to the package, in this case five new TYPE !!
    Is there another way to solve this problem?
    Thanks

  • How to create a stored procedure that accepts an array of args from Java?

    I am to be creating a stored procedure that accepts an array of arguments from Java. How to create this? thanks
    Sam

    Not a PL/SQL question really, but a Java one. The client call is done via ThinJDBC/OCI to PL/SQL, This call must be valid and match the parameters and data types of the PL/SQL procedure.
    E.g. Let's say I define the following array (collection) structure in Oracle:
    SQL> create or replace type TStrings as table of varchar2(4000);
    Then I use this as dynamic array input for a PL/SQL proc:
    create or replace procedure foo( string_array IN TStrings )...
    The client making the call to PL/SQL needs to ensure that it passes a proper TStrings array structure.. The Oracle Call Interface (OCI) supports this on the client side - allowing the client to construct an OCI variable that can be passed as a TStrings data type to SQL. Unsure just what JDBC supports in this regard.
    An alternative method, and a bit of a dirty hack, is to construct the array dynamically - but as this does not use bind variables, it is not a great idea.
    E.g. the client does the call as follows: begin
      foo( TStrings( 'Tom', 'Dick', 'Harry' ) );
    end;Where the TStrings constructor is created by the client by stringing together variables to create a dynamic SQL statement. A bind var call would look like this instead (and scale much better on the Oracle server side):begin
      foo( :MYSTRINGS );
    end;I'm pretty sure these concepts are covered in the Oracle Java Developer manuals...

  • Call a Stored Procedure that returns a REFCURSOR using ODI Procedure

    Hi,
    I have a scenario wherein the stored procedure (TEST_PROC1) that returns a REFCURSOR. The second procedure(TEST_PROC2) will use the REFCURSOR as inpuut and insert it to a table.
    Now, I need to execute the test procedures (TEST_PROC1 and TEST_PROC2) using the ODI Procedure but I always get error. However, I was able to execute the test procedures using sqlplus. Here is the command I used for sqlplus:
                   var rc refcursor
                   exec TEST_PROC1(:rc);
                   exec TEST_PROC2(:rc);
    PL/SQL Stored Procedure:
    -- TEST_PROC1 --
    create or replace
    PROCEDURE TEST_PROC1 (p_cursor IN OUT SYS_REFCURSOR)
    AS
    BEGIN
    OPEN p_cursor FOR
    SELECT *
    FROM test_table1;
    END;
    -- TEST_PROC2 --
    create or replace
    procedure TEST_PROC2( rc in out sys_refcursor ) is
    FETCH_LIMIT constant integer := 100;
    type TFetchBuffer is table of test_table2%RowType;
    buffer TFetchBuffer;
    begin
    loop
    fetch rc bulk collect into buffer limit FETCH_LIMIT;
    forall i in 1..buffer.Count
    insert into test_table2(
    c1, c2
    ) values(
    buffer(i).c1, buffer(i).c2
    exit when rc%NotFound;
    end loop;
    end;
    Is there a way to call a PL/SQL Stored Procedure that returns a REFCURSOR using ODI Procedure?
    Thanks,
    Cathy

    Thanks for the reply actdi.
    The procedure TEST_PROC1 is just a sample procedure. The requirement is that I need to call a stored procedure that returns a cursor using ODI and fetch the data and insert into a table, which in this case is test_table2.
    I was able to execute a simple SQL procedure (without cursor) using ODI procedure. But when i try to execute the SQL procedure with cursor in ODI, I encountered error.
    Do you have any idea how to do this?

  • Calling a package procedure with Date parameter only

    Hi All,
    Please help me to call a package procedure with Date parameter from sql prompt.
    Arif

    Check the below procedure.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure procdate (p_date_in date)
      2  is
      3  p_date_out date;
      4  begin
      5  p_date_out := add_months(p_date_in,6);
      6  dbms_output.put_line(p_date_out);
      7* end;
    SQL> /
    Procedure created.
    SQL> exec procdate('01-JAN-2010');
    01-JUL-10
    PL/SQL procedure successfully completed.
    SQL> exec procdate(to_date('01/01/2010','DD-MM-YYYY'));
    01-JUL-10
    PL/SQL procedure successfully completed.
    SQL> exec procdate('31-DEC-2010');
    30-JUN-11
    PL/SQL procedure successfully completed.

  • Can I create a Stored Procedure That access data from tables of another servers?

    I'm developing a procedure and within it I'm trying to access another server and make a select into a table that belongs to this another server. When I compile this procedure I have this error message: " PLS-00904: insufficient privilege to access object BC.CADPAP", where BC.CADPAP is the problematic table.
    How can I use more than one connection into an Oracle Stored Procedure?
    How I can access tables of a server from a Stored Procedure since the moment I'm already connected with another server?
    Can I create a Stored Procedure That access data from tables of another servers?

    You need to have a Database Link between two servers. Then you could do execute that statement without any problem. Try to create a database link with the help of
    CREATE DATABASE LINK command. Refer Document for further details

  • Call to Package Procedure fails with wrong number or type of parameters

    I think its getting to the correct package and procedure since if I change the name slightly, I get an error about it not being defined.
    Here is my Parameter set up:
    OracleParameter[] theParams = new OracleParameter[26];
    theParams[0] = new OracleParameter("P1",OracleDbType.Char,2);
    theParams[1] = new OracleParameter("P2", OracleDbType.Char, 12);
    theParams[2] = new OracleParameter("P3", OracleDbType.Char, 12);
    theParams[3] = new OracleParameter("P4", OracleDbType.Char, 12);
    theParams[4] = new OracleParameter("P5", OracleDbType.Double);
    theParams[5] = new OracleParameter("P6", OracleDbType.Char, 12);
    theParams[6] = new OracleParameter("P7", OracleDbType.Char, 12);
    theParams[7] = new OracleParameter("P8", OracleDbType.Char, 12);
    theParams[8] = new OracleParameter("P9", OracleDbType.Char, 10);
    theParams[9] = new OracleParameter("P10", OracleDbType.Char, 3);
    theParams[10] = new OracleParameter("P11", OracleDbType.Char, 2);
    theParams[11] = new OracleParameter("P12", OracleDbType.Char, 2);
    theParams[12] = new OracleParameter("P13", OracleDbType.Char, 2);
    theParams[13] = new OracleParameter("P14", OracleDbType.Char, 6);
    theParams[14] = new OracleParameter("P15", OracleDbType.Char, 6);
    theParams[15] = new OracleParameter("P16", OracleDbType.Varchar2);
    theParams[16] = new OracleParameter("P17", OracleDbType.Char, 2);
    theParams[17] = new OracleParameter("P18", OracleDbType.Char, 16);
    theParams[17].Direction = System.Data.ParameterDirection.Output;
    theParams[18] = new OracleParameter("P19", OracleDbType.Char, 12);
    theParams[18].Direction = System.Data.ParameterDirection.Output;
    theParams[19] = new OracleParameter("P20", OracleDbType.Varchar2, 12);
    theParams[20] = new OracleParameter("P21", OracleDbType.Varchar2);
    theParams[21] = new OracleParameter("P22", OracleDbType.Char, 2);
    theParams[22] = new OracleParameter("P23", OracleDbType.Char, 2);
    theParams[23] = new OracleParameter("P24", OracleDbType.Char, 2);
    theParams[24] = new OracleParameter("P25", OracleDbType.Char, 2);
    theParams[25] = new OracleParameter("P26", OracleDbType.Char, 2);
    Now the problem is that the package definition is declared using types from database table columns, for the most part.
    So for those, I used the real types of those columns, like for CHAR(2) I used OracleDbType.Char with length 2.
    There are just a few odd balls that I'm not sure about.
    For new OracleParameter("P5", OracleDbType.Double);, this is a parameter defined usijng a column type, that is NUMBER(8). Not sure what to use here.
    For the line theParams[15] = new OracleParameter("P16", OracleDbType.Varchar2);, the parameter definition for the procedure parameter is VARCHAR2. So I used that with no length specified. Is that correct?
    The oddest is this one, theParams[19] = new OracleParameter("P20", OracleDbType.Varchar2, 12);, where the procedure parameter is defined as a type from another package. That in turn is defined as a RECORD:
    TYPE t_log_rec IS RECORD (
    log_seq t_handle -- VARCHAR2(12)
    and t_handle is defined in terms of another table column, and that is defined as VARCHAR2(12).
    Any help on how to map those Oracle types back to .Net Oracle data types and parameter definitions is appreciated.

    PLSQL Record types cannot be passed directly via OCI (read client) apps, and can only be instantiated/passed from other PLSQL procedures.
    You could create a wrapper procedure in the database that accepts all scalar types, which then converts the varchar2 into a t_log_rec and then calls the "real" procedure.
    Or, you could instantiate a t_log_rec inside an anonymous block and call the real procedure via that anonymous block.
    Varchar2 parameters need size defined. When you assign an IN param a value, size is implicitly defined. OUT parameters need to have size explicitly defined.
    Hope it helps
    Greg

  • Newbie Region SQL calling a package Procedure

    I have a region on a page with PL/SQL selected.
    Below is the code I have for "REGION SOURCE"
    begin
    htp.p('Help me');
    WILD4BLIFE.TESTA();
    end;
    ==============
    I have a Package WILD4BLIFE with a procedure TESTA.
    I'm using APEX 3.0 on Oracle 9i.
    I've tried it various ways. No luck..
    How can I get this PL/SQL to call a package stored procedure?
    TIA
    Steve

    Steve,
    Good that you provided the package code. I believe the problem is that you put double-quotes around the procedure name and signature.
    procedure "TESTA(ci_sql in varchar2)" ...So you made the name of your procedure "TESTA(ci_sql in varchar2)", and it takes no parameters.
    So when you call it from Apex with parameters, Oracle can't find a procedure simply named TESTA, especially one that accepts a single parameter.
    Here's what I wrote:
    CREATE OR REPLACE PACKAGE BODY test_apex IS
        PROCEDURE display_line(show_value IN VARCHAR2)
        IS
        BEGIN
            htp.p(show_value);
        END display_line;
    END test_apex;I only got to thinking about this because I realized that your procedure was not displaying the value of the parameter you're passing in (as I am above).
    For me, putting double-quotes around my procedure names are extraneous. In your case, they're disastrous! ;-)
    Good luck,
    Stew
    My Oracle Community blog:
    http://www.oraclecommunity.net/profiles/blog/list?user=stewstryker

  • Getting error calling a package/procedure from DB

    I'm on 11.1.1.6 and I'm trying to execute a procedure in a package in the DB my ADF application is connected to.  I get the following error  "Could not find saved view state for token".  If I comment out the execution of the method that is calling the procedure the error goes away.  The error shows up under the log for the application on the EM console.  The procedure does not get executed.  Can anyone tell me what it could be?  I am using the tool Oracle provided to gain access to the EBS database without using the apps password.  I wonder if that may be causing the issue?  Can it be related to a security or grant issue of some kind?  The package procedure is under the apps schema.

    Hi,
    I don't think that on this forum we know enough about EBS to be helpful with security privileges. But if you read this here ADF &amp;amp; Weblogic How To: TROUBLESHOOTING: Could not find saved view state for token ...
    then it seems that there are some sort of access problem
    Frank

  • [perl] How call function/procedure that returns SYS_REFCURSOR type?

    I've got some simple procedure which returns record(s):
    CREATE OR REPLACE PROCEDURE "GET_SYS_DATE"
    RESULTSET IN OUT SYS_REFCURSOR
    IS
    BEGIN
         OPEN RESULTSET FOR
              SELECT SYSDATE FROM DUAL;
    END;
    In perl i invoke it with somthing like this:
    my $ret;
    my $s= "BEGIN GET_SYS_DATE(:1); END;";
    my $sth = $dbh->prepare($s);
    $sth->bind_param_inout(1, \$ret, 0 { TYPE => XXX}); # tried to use many DBD::SQL_* types (SQL_ROW, SQL_REF, etc.)
    $sth->execute(); #... but without luck
    I always get:
    DBD::ODBC::st execute failed: [Oracle][ODBC][Ora]ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'GET_SYS_DATE'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Of course if i use other datatype in SP (e.g. VARCHAR2) and bind it as SQL_VARCHAR it works well... Moreover, if i use DBD::Oracle and bind it as ORA_RSET type it also works.
    Is it possible that ODBC doesn't know SYS_REFCURSOR type? Then, is there any way to call SP and retrieve cursor from perl without using DBD::Oracle?
    Or, if it is possible, then how to retrieve that cursor and data stored within it? Any help?

    Hi,
    I have not one eensy teensy bit of knowledge about PERL, other than how to spell it.
    I do however, know about ref cursors, and ODBC, so maybe this will help.
    ODBC has nothing for REF CURSOR built in. ODBC is made to the lowest common denoninator of databases, and a refcur is an Oracle thing. So, what that means is that you can't BIND anythign to the ref cursor, as there is no appropriate ODBC type to bind.
    Does that mean you can't call a refcur via ODBC? No, it doesnt.
    What happens is that Oracle's ODBC driver kinda "magically" goes out behind the scenes and describes the procedure or pacakge to determine if any of the parameters are ref cursors, and if so automatically sets up the bind for them.
    Here's a complete working example using VB and ADO rather than PERL, but maybe you can port it over and get it working. Note that the proc takes two params, but we only bind one (for the IN number)
    Hope it helps,
    Greg
    'create or replace package testrefcur as
    '  type mycur is ref cursor;
    ' procedure getemps(dno in number, ecur out mycur);
    ' end;
    'create or replace package body testrefcur as
    'procedure getemps(dno in number, ecur out mycur) is
    '  begin
    '     open ecur for select * from emp where deptno = dno;
    '  end;
    'end;
    Private Sub Command1_Click()
    Dim con As New ADODB.Connection
    Dim cmd As New ADODB.Command
    Dim rst As New ADODB.Recordset
    strcnn = "dsn=orcl;uid=scott;pwd=tiger"
    con.Open strcnn
    cmd.CommandText = "{call testrefcur.getemps(?)}"
    Set cmd.ActiveConnection = con
    Set param1 = cmd.CreateParameter("param1", adNumeric, adParamInput, 4)
    param1.Value = 10
    param1.Precision = 4
    cmd.Parameters.Append param1
    Set rst = cmd.Execute  
    While Not rst.EOF
    strrslt = strrslt & rst.Fields("ename").Value & " "
    rst.MoveNext
    Wend
    MsgBox strrslt
    End Sub

  • Unable to compile a package calling a package procedure in different schema

    Hello,
    I'm unable to compile a package referencing a package located in another schema. I get the message: PLS-00201: identifier 'pkg1' must be declared
    Facts:
    0. I'm running Oracle DB 10.2.0.4.0 Enterprise Edition
    1. There is one schema ('schema1') containing a package ('pkg1').
    2. This package 'pkg1' has a public synonym ('pkg1' as well).
    3. The EXECUTE grant is given to a role ('role1').
    4. There is another schema 'schema2', which is granted the role 'role1' (and set as default).
    5. This schema 'schema2' contains a package ('pkg2').
    6. This package 'pkg2' calls a procedure of 'pkg1'.
    7. When compiling 'pkg2', I get error message saying 'pkg1' does not exist.
    Of course, if I execute 'GRANT EXECUTE ON pkg1 TO PUBLIC' or 'GRANT EXECUTE ON pkg1 TO schema2', I can compile the package 'pkg2'. But I don't want this.
    And what's weird is that, connected as 'schema2', I can execute the statement 'execute pkg1.proc1' without any trouble. So I guess the role setup is okay.
    What would let me compile 'pkg2' properly?
    Regards,
    Arnaud

    user3347638 wrote:
    Hello,
    I'm unable to compile a package referencing a package located in another schema. I get the message: PLS-00201: identifier 'pkg1' must be declared
    Facts:
    0. I'm running Oracle DB 10.2.0.4.0 Enterprise Edition
    1. There is one schema ('schema1') containing a package ('pkg1').
    2. This package 'pkg1' has a public synonym ('pkg1' as well).
    3. The EXECUTE grant is given to a role ('role1').
    4. There is another schema 'schema2', which is granted the role 'role1' (and set as default).
    5. This schema 'schema2' contains a package ('pkg2').
    6. This package 'pkg2' calls a procedure of 'pkg1'.
    7. When compiling 'pkg2', I get error message saying 'pkg1' does not exist.
    Of course, if I execute 'GRANT EXECUTE ON pkg1 TO PUBLIC' or 'GRANT EXECUTE ON pkg1 TO schema2', I can compile the package 'pkg2'. But I don't want this.
    And what's weird is that, connected as 'schema2', I can execute the statement 'execute pkg1.proc1' without any trouble. So I guess the role setup is okay.
    What would let me compile 'pkg2' properly?
    Regards,
    Arnaudprivileges acquired via ROLE do NOT apply within named PL/SQL procedures.
    above is just a restriction built into PL/SQL.
    accept it & get on with reality

  • Sending data to mssql stored procedure that accepts variable of text  data

    Hi all
    i have a stored procedure in mssql 2000 whole input parameter is of type text
    how can i send data of type string from java class while calling storedprocedure using callable statement
    if ui use setString() function it gives an exception that data will be trunctated
    com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated.
         at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
         at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.sendExecute(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecute(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(Unknown Source)
         at com.clearcube.util.DMLLayer.processClientRequest(DMLLayer.java:49)
         at com.clearcube.discovery.PushDiscoveryHandler.init(PushDiscoveryHandler.java:90)
         at com.clearcube.discovery.PushDiscoveryController$1.run(PushDiscoveryController.java:113)
         at java.util.TimerThread.mainLoop(Unknown Source)
         at java.util.TimerThread.run(Unknown Source)
    c
    if any one have solution to this problem plz reply me

    my stored procedure accepts input of type text
    i use text type becouse nvarchar is not enough to
    place data.
    and i want to send data that is greater than the
    length of varcharUnder setString in the API:
    "The driver converts this to an SQL VARCHAR or LONGVARCHAR value (depending on the argument's size relative to the driver's limits on VARCHAR values) when it sends it to the database."
    I am not sure what you should use then? Maybe setCharacterStream?

  • Calling PL/SQL procedure that returns boolean in java

    Hi All,
    Was not sure weather to post this on Java forum threads or PL/SQL forum threads. So posting at both locations.
    I have to call a PL/SQL procedure from java. This PL/SQL has IN/OUT parameters as well as return a Boolean value.
    The procedure definition is as follows:
    FUNCTION GET_NEXT(O_error_message IN OUT VARCHAR2,
    IO_item_no IN OUT ITEM_MASTER.ITEM%TYPE,
    I_item_type IN ITEM_MASTER.ITEM_NUMBER_TYPE%TYPE)
    return BOOLEAN;
    END ITEM_NUMBER_TYPE_SQL;
    And the java function I am using is as follows:
    This is in the ADF Application module impl code
    public String callNextItem(){
    CallableStatement callableStmt = null;
    String rmsUser = getDBTransaction().getConnectionMetadata().getUserName();
    String callableStatement = "begin ? := ITEM_NUMBER_TYPE_SQL.VALIDATE_FORMAT(?,?,?); end;";
    System.out.println("callableStatement "+callableStatement);
    try{
    callableStmt = getDBTransaction().createCallableStatement(callableStatement,0);
    callableStmt.registerOutParameter(1, Types.*BIT*);
    callableStmt.registerOutParameter(2, Types.VARCHAR);
    callableStmt.registerOutParameter(3, Types.VARCHAR);
    callableStmt.registerOutParameter(4, Types.VARCHAR);
    callableStmt.setBoolean(1, false);
    callableStmt.setString(2, "");
    callableStmt.setString(3, "");
    callableStmt.setString(4, "UPC-A");
    callableStmt.executeUpdate();
    System.out.println("STATUS : " + callableStmt.getString(3));
    System.out.println("ERROR : " + callableStmt.getString(2));
    String status = "";
    getDBTransaction().commit();
    System.out.println("commited ");
    callableStmt.close();
    return status;
    }catch(SQLException e){
    System.out.println("Error:" +e);
    throw new JboException(e);
    But this function never works. Throws "not valid expression type" error.
    I have called several PL/SQL procedures before, only difference being
    they never used to return any value. Particularly I feel the cause of the
    error is the Boolean type that is returned from the procedure.
    If you have any idea, please help.

    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html#34_05

  • How to handle the procedure that reutrn object types as out parameter

    I have a procedure where it returns object(CREATE OR REPLACE TYPE xyz AS OBJECT) as a OUT parameter.
    Now i have to pull the data from this type and need to send the data in excel.
    Procedure will fetch data and assign it to object with lot of validations and local parameters variables..
    How can i push the data from the out parameter and need to send that in excel..Its an oracle database 10g..

    here's a basic example...
    SQL> set serveroutput on;
    SQL> create or replace type t_obj as object (x number, y number);
      2  /
    Type created.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace package mypkg as
      2    procedure testit(p_obj out t_obj);
      3    procedure callme;
      4* end;
      5  /
    Package created.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace package body mypkg as
      2    procedure testit(p_obj out t_obj) is
      3    begin
      4      p_obj := t_obj(1,2);
      5    end;
      6    procedure callme is
      7      v_obj t_obj;
      8    begin
      9      testit(v_obj);
    10      dbms_output.put_line('X='||v_obj.x||' Y='||v_obj.y);
    11    end;
    12* end;
    SQL> /
    Package body created.
    SQL> exec mypkg.callme;
    X=1 Y=2
    PL/SQL procedure successfully completed.
    SQL>

Maybe you are looking for