Call a pl/sql function froma jsp

I need to call an pl/sql function which basically returns true or false depending on the count. based on the return value I have to alert a message. how can i call the pl/sql fucntion in a jsp?
thanks for ur help.

You call the function the same way you would from anywhere, although i don't recommend you call database functions directly from a JSP page as it's bad form.

Similar Messages

  • Calling a PL/SQL function from java

    I would like to call a pl/sql function from java. My pl/sql function is taking arrays of records as parameters. How do i proceed? Which specific oracle packages do I have to import?
    Please send an example.
    TIA,
    Darko Guberina

    Documentation here: http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref185
    says JPublisher can publish records too.
    But when I change the example given at http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref190 as following:
    PACKAGE "COMPANY" AS
    type emp_rec is record (empno number, ename varchar2(10));
    type emp_list is varray(5) of emp_rec;
    type factory is record (
    name varchar(10),
    emps emp_list
    function get_factory(p_name varchar) return factory;
    END;
    then I see <unknown type or type not found> at sql or java files generated. Any ideas?

  • How to call PL/SQL function from JSP ?

    We have the JSP application developed using the JDeveloper 3.0. I am trying to call the PL/SQL DB function. I'm trying to use the method of ApplicationModule:
    .getTransaction().executeCommand(sCommand)
    The problem is that I can not get the function result back to JSP. The executeCommand() does not seem to accept any host variables.
    What to do ? Did anyone manage to get the feedback from DB ?
    Here is the code in the JSP page:
    <%! String res=" ";%>
    <jsp:useBean id="rsn"
    class="oracle.jbo.html.databeans.TRSRowSetNavigator"
    scope="request" >
    <%
    rsn.initialize(application,session, request,response,
    out,"theIMO_trs_bc4J_Bc4JModule.AuctionsListView");
    rsn.setReleaseApplicationResources(true);
    // this is the ID to be copied
    String copy_id = request.getParameter(TRS.LOOK_UP_PK_FIELD);
    if( copy_id != null) {
    // call the PL/SQL procedure to create copy of this auction
    String sCommand = "DECLARE a NUMBER; BEGIN :res:=Copy_Auction("
    copy_id"); END;";
    rsn.getRowSet().getApplicationModule().getTransaction().executeCommand(sCommand);
    rsn.getRowSet().getApplicationModule().getTransaction().commit();
    I receive the following error:
    Error Message: JBO-27121: SQL error during statement execution. Statement: DECLARE a NUMBER; BEGIN :res:=Copy_Auction(45); END;
    JBO Error:JBO-27121: SQL error during statement execution. Statement: DECLARE a NUMBER; BEGIN :res:=Copy_Auction(45); END;: ORA-01008: not all variables bound
    What criteria has the host variable meet to be used in the executeCommand(sCommand) method ?
    Thanks,
    Michael
    null

    I could be wrong there, but I have experienced similar problem on tru64 unix, with sticky bit not in place for the following files: $ORACLE_HOME/bin/oracle and $ORACLE_HOME/bin/oracleO. Once you restore those files via tar command (this is what happened to me), the sticky bit disappears, and you have to re-introduce it by issuing unix command: chmod 1777 on those files.
    What it does for you - it allows you to execute the sql statements as an oracle user & group!
    Otherwise, if this bit is lost, whenever you try to connect to sqlplus via user / password it hits you back with:
    ORA-01034 ORACLE not available
    ORA-27121 unable to determine size of shared memory segment
    Compaq Tru64 UNIX Error: 13:Permission denied
    This should not be a problem if you try and execute the same sql statements using listener (connecting to the server by using @ statement).
    I could be late in response to you, but maybe not for other people.

  • Calling pl/sql function from JSP to get data

    Hi,
    Ideally I want to pass the results of a PL/SQL function or procedure to my JSP page as a resultset or an array.
    I've manage to pass all the data as a string like this:
    // this works for a function that returns a string
    String str;
         CallableStatement cstmt = conn.prepareCall("begin ?:= temp_package.pass_string(); end;");
         cstmt.registerOutParameter(1,Types.VARCHAR);
         cstmt.execute();
         str = cstmt.getString(1);
    but if I try to pass a collection or Varray or Ref Cursor like this:
    // LETS TRY A PROCEDURE THAT ALTERS THE CONTENTS OF AN ARRAY
         CallableStatement cstmt = conn.prepareCall(" begin ?:= temp_package.pass_varray(); end;");
         cstmt.registerOutParameter(1,Types.ARRAY);
         cstmt.execute();
    or this:
    CallableStatement cstmt = conn.prepareCall(" begin ?:= temp_package.pass_cursor(); end;");
         cstmt.registerOutParameter(1,Types.CURSOR);
         cstmt.execute();
    or this:
    CallableStatement cstmt = conn.prepareCall(" begin ?:= temp_package.pass_cursor(); end;");
         cstmt.registerOutParameter(1,OracleTypes.CURSOR);
         cstmt.execute();
    I get an error saying that the type can�t be translated or something similar. It seems happy with VARCHAR but not with ARRAY,VARRAY or CURSOR.
    Can anyone help please as this has driven me crazy for hours surfing google and various forums. Thanks.

    Ok, I made the changes, but I'm now getting the following error:
    Error code = 1403
    Error message = ORA-01403: no data found
    ORA-06512: at "IOBOARD.GETSTATUS", line 6
    ORA-06512: at line 1
    The ora-01403 I don't understand because there is data for the name Kelly.Brace.
    ora-06512 error: at string line string.
    Here's what the code looks like after I made the changes:
    String sql = "{?=call ioboard.GetStatus(?)}";
          // create a Statement object
          myStatement = myConnection.prepareCall( sql );
          myStatement.setString( 1, "Kelly.Brace" );
          myStatement.registerOutParameter(2, java.sql.Types.LONGVARCHAR );
          // create a ResultSet object, and populate it with the
          // result of a SELECT statement
          ResultSet myResultSet = myStatement.executeQuery();
          // retrieve the row from the ResultSet using the
          // next() method
          myResultSet.next();
          // retrieve the user from the row in the ResultSet using the
          // getString() method
          String status = myResultSet.getString(1);
          System.out.println("Hello Kelly, your status is: " + status);
          // close this ResultSet object using the close() method
          myResultSet.close();Here's what the function looks like:
    CREATE OR REPLACE FUNCTION GetStatus( user_name in varchar2)
    RETURN VARCHAR2
    is
    v_status varchar2(10);
    BEGIN
    select iob_location into v_status
    from ioboard.iob_user
    where iob_username = user_name;
      RETURN( v_status);
    END;This works perfectly in the SQL Window:
    select iob_location
    from ioboard.iob_user
    where iob_username = 'Kelly.Brace';

  • Calling a pl/sql function from oracle forms

    I have written a pl/sql function in a package.
    package name- sup
    function name - func
    I have written a when-button-pressed trigger .from here I want to call this function.
    How can I do that?
    Please help..

    Thanks a lot..
    User may select 20-30 check boxes for respective name & id...then at the end , user will hit OK...from here when-button-click will call a procedure....that will update/insert/delete a table data.The procedure I have written is:-
    DECLARE
    N_CNT Number(1);
    D_SYSDATE Constant date :=sysdate;
    Begin
    select count(1)
    into N_CNT
    from dbtable L
    where L.land_id = :BLK1.LAND_ID and
    L.Operatoer_id = :BLK1.Operatoer_id and
    L.suppl_id = :BLK1.suppl_id and
    L.suppl_prof_id = :BLK1.suppl_prof_id;
    if ((N_CNT = 0) and (:LANDLISTE.state = 'A')) then
    insert into dbtable
    LAND_ID,
    STATE,
    suppl_prof_id,
    suppl_id,
    OPERATOER_ID,
    SIDST_OPD_DATO,
    SIDST_OPD_INIT
    values
    :BLK1.LAND_ID,
    'Y',
    :BLK1.suppl_prof_id,
    :BLK1.suppl_id,
    :BLK1.Operatoer_id,
    D_SYSDATE,
    :BLK1.SIDST_OPD_INIT
    elseif
    ((N_CNT>0 )and (:LANDLISTE.state = 'A')) then
    update dbtable L
    set L.SIDST_OPD_DATO = D_SYSDATE,
    L.SIDST_OPD_INIT = :BLK1.SIDST_OPD_INIT
    where L.land_id = :BLK1.LAND_ID and
    L.Operatoer_id = :BLK1.Operatoer_id and
    L.suppl_id = :BLK1.suppl_id and
    L.suppl_prof_id = :BLK1.suppl_prof_id;
    elseif ((N_CNT>0 ) and (:LANDLISTE.state = 'D')) then
    delete from dbtable L
    where L.land_id = :BLK1.LAND_ID and
    L.Operatoer_id = :BLK1.Operatoer_id and
    L.suppl_id = :BLK1.suppl_id and
    L.suppl_prof_id = :BLK1.suppl_prof_id;
    end if;
    end;
    Will it be able to load multiple data(20-30 at a time) to the table?
    Should I write anything to commit the data in the table?
    I am very new to oracle forms...please help..

  • CALLING a STORED SQL FUNCTION from  Java 1.1.8

    I am trying to execute a stored function in JAVA 1.1.8, from an Oracle
    8i Database. My stored function is simple, it converts an Input Number to an output TIME string. I am unsure how to code the call from Java. Are SQL STORED PROCEDURES treated the same as SQL STORED FUNCTIONS? Do you use the CallableProcdure class or something else?
    Thanks for your input.

    yep - same way. Except no return value.

  • Calling PL/SQL function from external Java class

    I was wondering if I was able to call a pl/sql function from an external java class? If so, would you be able to tell me briefly on how to go about it. I know I can call java methods that are internally stored in the db from pl/sql, but I was hoping I could call pl/sql from external java. Thanks,
    Kelly

    Ok, I made the changes, but I'm now getting the following error:
    Error code = 1403
    Error message = ORA-01403: no data found
    ORA-06512: at "IOBOARD.GETSTATUS", line 6
    ORA-06512: at line 1
    The ora-01403 I don't understand because there is data for the name Kelly.Brace.
    ora-06512 error: at string line string.
    Here's what the code looks like after I made the changes:
    String sql = "{?=call ioboard.GetStatus(?)}";
          // create a Statement object
          myStatement = myConnection.prepareCall( sql );
          myStatement.setString( 1, "Kelly.Brace" );
          myStatement.registerOutParameter(2, java.sql.Types.LONGVARCHAR );
          // create a ResultSet object, and populate it with the
          // result of a SELECT statement
          ResultSet myResultSet = myStatement.executeQuery();
          // retrieve the row from the ResultSet using the
          // next() method
          myResultSet.next();
          // retrieve the user from the row in the ResultSet using the
          // getString() method
          String status = myResultSet.getString(1);
          System.out.println("Hello Kelly, your status is: " + status);
          // close this ResultSet object using the close() method
          myResultSet.close();Here's what the function looks like:
    CREATE OR REPLACE FUNCTION GetStatus( user_name in varchar2)
    RETURN VARCHAR2
    is
    v_status varchar2(10);
    BEGIN
    select iob_location into v_status
    from ioboard.iob_user
    where iob_username = user_name;
      RETURN( v_status);
    END;This works perfectly in the SQL Window:
    select iob_location
    from ioboard.iob_user
    where iob_username = 'Kelly.Brace';

  • How to call a SQL function from an XSL expression

    Hi
    In R12, in Payroll Deposit adivce/Check writer, We need to sort the earnings tag <AC_Earnings> in to two different categories as regular and other earnings. In the DB and form level of element defintiion we have a DFF which differentiates between the two kinds of earnings. But the seeded XML that is gerneated by the check writer does not have this field.
    The seeded template displays all the earnings in one column. How can we achieve this in the template without modifying the seeded XML.
    The one approach i have is to write a function and based on the return value sort the data. For this I need to know :
    1) How to call a SQL function from an XSL expression that is allowed in BI template.
    If anyone ahs faced similar requirements please share your approach.
    Thanks
    Srimathi

    Thank u..
    but i'd seen that link wen i searched in google..
    Is it possible without using any 3rd party JARs and all?
    and more importantly plz tell me what should be preferred way to call a javascript function?
    Do it using addLoadEvent() or Windows.Load etc
    OR
    Call it thru Xsl? (I donno how to do dis)
    Thanks in Advance..
    Edited by: ranjjose on Jun 3, 2008 8:21 AM

  • How to call java script function from JSP ?

    how to call java script function from JSP ?

    i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks

  • How to call pl/sql function from element values

    EBS 11.5.10.2
    XMLP 5.6.3
    Hello,
    I noticed that the output of the rdf-to-data template conversion process makes use of an undocumented feature of data templates, and I would like to get input from experts as to which situations this feature is usable.
    The closest thing I can find in the documentation is a sample in the user guide. There is a "General Ledger Journals Data Template Example" that has a <dataStructure> section that contains <element> nodes which are NOT children of a <group> node. I can't find any explanation of this in the user guide.
    I've noticed from converted templates that in these un-grouped elements you can make calls to PL/SQL functions in the "value" attribute, like this:
    <dataStructure>
      <group name="G_LINES" source="Q_MAIN">
        <element name="Line_Num"           value="Line_Num"/>
      </group>
      <element name="C_CALCULATED_VALUE" dataType="number" value="XX_CUSTOMPROCS.SOME_FUNCTION"/>
    </dataStructure>Has anyone had any success being able to call PL/SQL functions from grouped elements? Whenever I try, it doesn't seem to work.
    When I try something like this:
    <dataStructure>
      <group name="G_LINES" source="Q_MAIN">
        <element name="Line_Num"           value="Line_Num"/>
        <element name="some_calculation"   value="XX_CUSTOMPROCS.SOME_FUNCTION"/>
        <element name="some_calculation_b" value="XX_CUSTOMPROCS.SOME_FUNCTION_B(:Line_Num)"/>
      </group>
      <element name="C_CALCULATED_VALUE" dataType="number" value="XX_CUSTOMPROCS.SOME_FUNCTION"/>
    </dataStructure>The <SOME_CALCULATION/> and <SOME_CALCULATION_B/> nodes come out empty in the output data xml file, but <C_CALCULATED_VALUE> would have a value as desired.

    ah - perfect. That makes sense. Thank you for the response!
    But what about when we need to pass parameters to those functions whos values are the results of aggregate element values?
    This happens a lot in the converted data templates, where pl/sql package functions are meant to replace formula columns from the original Oracle Report. Take this example from the conversion of ARXAGMW.rdf (Aging Report, 7 Buckets):
    (note the function call in the value of "Set_Percent_Inv_Inv" is using aggregate results from subgroups)
      <group name="G_INV_INV" dataType="varchar2" source="Q_Invoice">
        <element name="Total_Inv_Inv_Amt" function="sum" dataType="number" value="G_Invoice.C_Amt_Due_Rem_Inv"/>
        <element name="Total_Inv_Inv_B0" function="sum" dataType="number" value="G_Invoice.C_Inv_B0"/>
        <element name="Total_Inv_Inv_B1" function="sum" dataType="number" value="G_Invoice.C_Inv_B1"/>
        <element name="Total_Inv_Inv_B2" function="sum" dataType="number" value="G_Invoice.C_Inv_B2"/>
        <element name="Total_Inv_Inv_B3" function="sum" dataType="number" value="G_Invoice.C_Inv_B3"/>
        <element name="Total_Inv_Inv_B4" function="sum" dataType="number" value="G_Invoice.C_Inv_B4"/>
        <element name="Total_Inv_Inv_B5" function="sum" dataType="number" value="G_Invoice.C_Inv_B5"/>
        <element name="Total_Inv_Inv_B6" function="sum" dataType="number" value="G_Invoice.C_Inv_B6"/>
        <element name="Set_Percent_Inv_Inv"  dataType="number"  value="XX_CUSTOMPROCS.XXC_ARXAGMW.set_percent_inv_invformula(:Total_Inv_Inv_Amt, :Total_Inv_Inv_B0, :Total_Inv_Inv_B1, :Total_Inv_Inv_B2, :Total_Inv_Inv_B3, :Total_Inv_Inv_B4, :Total_Inv_Inv_B5, :Total_Inv_Inv_B6)"/>
        <element name="Sum_Percent_B0_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B0_Inv_p"/>
        <element name="Sum_Percent_B1_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B1_Inv_p"/>
        <element name="Sum_Percent_B2_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B2_Inv_p"/>
        <element name="Sum_Percent_B3_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B3_Inv_p"/>
        <element name="Sum_Percent_B4_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B4_Inv_p"/>
        <element name="Sum_Percent_B5_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B5_Inv_p"/>
        <element name="Sum_Percent_B6_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B6_Inv_p"/>
        <group name="G_Cust_Inv" dataType="varchar2" source="Q_Invoice">
          <group name="G_Site_Inv" dataType="varchar2" source="Q_Invoice">
            <group name="G_1" dataType="varchar2" source="Q_Invoice">
              <group name="G_Invoice" dataType="varchar2" source="Q_Invoice">
                <element name="C_Amt_Due_Rem_Inv" dataType="number" value="C_Amt_Due_Rem_Inv"/>
                <element name="C_Inv_B0" dataType="number" value="C_Inv_B0"/>
                <element name="C_Inv_B1" dataType="number" value="C_Inv_B1"/>
                <element name="C_Inv_B2" dataType="number" value="C_Inv_B2"/>
                <element name="C_Inv_B3" dataType="number" value="C_Inv_B3"/>
                <element name="C_Inv_B4" dataType="number" value="C_Inv_B4"/>
                <element name="C_Inv_B5" dataType="number" value="C_Inv_B5"/>
                <element name="C_Inv_B6" dataType="number" value="C_Inv_B6"/>
              </group>
            </group>
          </group>
        </group>
      </group>
      ...All of these groups and sub-groups are based on one single query, so I am not sure how I would move the function call into the query without changing the results of the function.
    In the example above, elements Sum_Percent_B0_Inv through Sum_Percent_B6_Inv grab the results of the calculation done in set_percent_inv_invformula. Here is the essence of that function:
      sum_percent_b0_inv := ROUND ((total_inv_inv_b0 / total_inv_inv_amt) * 100, 2);
      sum_percent_b1_inv := ROUND ((total_inv_inv_b1 / total_inv_inv_amt) * 100, 2);
      sum_percent_b2_inv := ROUND ((total_inv_inv_b2 / total_inv_inv_amt) * 100, 2);
      sum_percent_b3_inv := ROUND ((total_inv_inv_b3 / total_inv_inv_amt) * 100, 2);
      sum_percent_b4_inv := ROUND ((total_inv_inv_b4 / total_inv_inv_amt) * 100, 2);
      sum_percent_b5_inv := ROUND ((total_inv_inv_b5 / total_inv_inv_amt) * 100, 2);
      sum_percent_b6_inv := ROUND ((total_inv_inv_b6 / total_inv_inv_amt) * 100, 2);The only solution I can think of is to have separate queries, one for each subgroup, that do the "sum" in sql; but that seems terribly inefficient.

  • Error PLS-00306 during calling PL/SQL function from Java

    Hi all,
    I am facing a problem during call of oracle PL/SQL function from java using CallableStatement.
    I receive following error message.
    java.sql.SQLException: ORA-06550: line 1, column 13:
    PLS-00306: wrong number or types of arguments in call to 'EXPORT_HIST_ALARMS_FUNC'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    As per above error EXPORT_HIST_ALARMS_FUNC in oracle has this signature.
    CREATE OR REPLACE FUNCTION EXPORT_HIST_ALARMS_FUNC(startDateTime VARCHAR2, endDateTime VARCHAR2, meType VARCHAR2) RETURN VARCHAR2 IS
    END EXPORT_HIST_ALARMS_FUNC;
    Above function I have called following way in java.
    String sql = "begin ?:= EXPORT_HIST_ALARMS_FUNC(?, ?, ?); end;" ;
    CallableStatement cStatement = null;
    cStatement = connection.prepareCall(sql);
    cStatement.registerOutParameter(1,Types.VARCHAR);
    cStatement.setString(2,startDateTime);
    cStatement.setString(3,endDateTime);
    cStatement.setString(4,meType);
    cStatement.execute();
    msg = cStatement.getString(1);
    Actually above function requires three input parameters and one return parameter.
    During execution of above java code it throws SQLException and shows PLS-00306: wrong number or types of arguments in call to 'EXPORT_HIST_ALARMS_FUNC' error.
    I have run this function directly from oracle with three parameters and run successfully and finally it returns string.
    But I am unable to figure out why it doesn't run from above java code.
    Please help regarding this.
    Thanks.
    Regards,
    Shardul Banker

    Try this:
    String sql = "begin ?:= EXPORT_HIST_ALARMS_FUNC(?, ?, ?); end;" ;
    CallableStatement cStatement = null;
    cStatement = connection.prepareCall(sql);
    cStatement.registerOutParameter(1,Types.VARCHAR);
    cStatement.setString(1,startDateTime);
    cStatement.setString(2,endDateTime);
    cStatement.setString(3,meType);
    cStatement.execute();
    msg = cStatement.getString(1);Regards,
    Martijn Teigeler
    Edited by: mTeigeler on Oct 13, 2007 10:22 AM

  • Calling PL/SQL function from OCI?

    Hi,
    How do I execute a PL/SQL function from OCI?
    My test function:
    CREATE OR REPLACE FUNCTION GetNodeQuery(TypeId IN INTEGER) RETURN VARCHAR2 IS
    Query VARCHAR2(500);
    BEGIN
    Query := 'Select * from Logical_Name';
    RETURN Query;
    END GetNodeQuery;
    char SQL[16];
    strcpy(SQL, "GetNodeQuery(1)");
    char ColumnVariable[500];
    int VariableSize = 500;
    OCIStmtPrepare(qHandle, hError, SQL, (ub4)strlen(SQL),
    (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);
    OCIDefineByPos(qHandle, &pDefine, hError, 1,
    (dvoid*)ColumnVariable, (sb4)VariableSize,
    1,(dvoid*)0, (ub2*)0, (ub2*)0,
    OCI_DEFAULT);
    OCIStmtExecute(svchp, qHandle, hError, (ub4)1, (ub4)0,
    (CONST OCISnapshot *)NULL, (OCISnapshot*)NULL,
    OCI_DEFAULT);
    On the Execute I get an error saying that ORA-00900: invalid SQL statement
    Any Help would be appreciated.
    Thank You,
    Scott Metzger
    null

    Ok, I made a mistake the
    select GetNodeQuery(1) from dual
    only works with a simple function. My real life function has a cursor via DBMS_SQL.
    I presume I would need to pass the following in my OCIStmtPrepare call:
    Define
    tmp Varchar2[256];
    begin
    tmp := GetNodeQuery(1);
    end;
    Now how do I get the value of tmp out?
    I couldn't find any examples for calling functions from OCI. If you know of some could you post the url or send them to me?
    Thanks,
    *:> Scott
    [email protected]
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Tiago Nodari ([email protected]):
    you need to modify the sqlstatement to look something like this...
    begin
    GetNodeQuery(1)
    end;
    look into the OCI documentation, there are various examples of how to do it, including, binding and defining variables...
    <HR></BLOCKQUOTE>
    null

  • Calling pl/sql procedure from jsp

    Hi:
    Could anyone tell me how to call a pl/sql procedure from a jsp page by passing args or without . Is there any specific method to use.
    Thanks.

    Like from any other java code
    <%
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(); END;");
    cs.execute();
    %>
    With params:
    <%
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(?, ?); END;");
    cs.setInt(1, 10);
    cs.setString(2,"aaaa");
    cs.execute();
    %>
    to return some value as out param
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(?, ?, 3); END;");
    cs.setInt(1, 10);
    cs.setString(2,"aaaa");
    cs.registerOutParameter(3, Types.VARCHAR);
    cs.execute();
    out.println("Returned value: " + cs.getString(3));
    %>
    Of course after all close statement and connection to free resources.

  • Calling stored pl/sql functions

    Hello,
    Any suggestions on calling a stored pl/sql function from a UIX page and returning the output of the function to the same page?
    Thanks,
    -Jeff

    Hi Jaap,
    I followed the instructions on the link you gave me and when I ran my test application I received this error:
    C:\jdev903\jdk\bin\javaw.exe -ojvm -classpath C:\msdapp_jeff\web\WEB-INF\classes;C:\msdapp_jeff\web\WEB-INF\lib\CopyProjectLibs.bat;C:\msdapp_jeff\web\WEB-INF\lib\bc4jmt.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jct.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jdomorcl.jar;C:\msdapp_jeff\web\WEB-INF\lib\collections.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jdatum.jar;C:\msdapp_jeff\web\WEB-INF\lib\classes12.jar;C:\msdapp_jeff\web\WEB-INF\lib\nls_charset12.jar;C:\msdapp_jeff\web\WEB-INF\lib\xmlparserv2.jar;C:\msdapp_jeff\web\WEB-INF\lib\uix2-dbg.jar;C:\msdapp_jeff\web\WEB-INF\lib\share-dbg.jar;C:\msdapp_jeff\web\WEB-INF\lib\regexp.jar;C:\msdapp_jeff\web\WEB-INF\lib\cle.jar;C:\msdapp_jeff\web\WEB-INF\lib\jhsruntime.jar;C:\jdev903\BC4J\lib\bc4jmt.jar;C:\jdev903\BC4J\lib\collections.jar;C:\jdev903\BC4J\lib\bc4jct.jar;C:\jdev903\lib\xmlparserv2.jar;C:\jdev903\jlib\jdev-cm.jar;C:\jdev903\j2ee\home\lib\jndi.jar;C:\jdev903\BC4J\lib\bc4jdomorcl.jar;C:\jdev903\BC4J\jlib\bc4jdatum.jar;C:\jdev903\jdbc\lib\classes12.jar;C:\jdev903\jdbc\lib\nls_charset12.jar;C:\jdev903\jlib\jdev-cm.jar;C:\jdev903\jdev\lib\jdev-rt.jar;C:\jdev903\BC4J\jlib\bc4jtester.jar;C:\jdev903\jlib\jdev-cm.jar;C:\jdev903\lib\xmlparserv2.jar;C:\jdev903\jlib\help4-nls.jar;C:\jdev903\jlib\help4.jar;C:\jdev903\jlib\share.jar;C:\jdev903\jlib\jewt4-nls.jar;C:\jdev903\jlib\jewt4.jar;C:\jdev903\jlib\oracle_ice5.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jct.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jdatum.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jdomorcl.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jmt.jar;C:\msdapp_jeff\web\WEB-INF\lib\classes12.jar;C:\msdapp_jeff\web\WEB-INF\lib\cle.jar;C:\msdapp_jeff\web\WEB-INF\lib\collections.jar;C:\msdapp_jeff\web\WEB-INF\lib\jhsruntime.jar;C:\msdapp_jeff\web\WEB-INF\lib\nls_charset12.jar;C:\msdapp_jeff\web\WEB-INF\lib\regexp.jar;C:\msdapp_jeff\web\WEB-INF\lib\share-dbg.jar;C:\msdapp_jeff\web\WEB-INF\lib\uix2-dbg.jar;C:\msdapp_jeff\web\WEB-INF\lib\xmlparserv2.jar;C:\jdev903\lib\xmlparserv2.jar;C:\jdev903\jlib\regexp.jar;C:\jdev903\jlib\share.jar;C:\jdev903\jlib\uix2.jar;C:\jdev903\j2ee\home\lib\ojsp.jar;C:\jdev903\j2ee\home\jsp\lib\taglib\ojsputil.jar;C:\jdev903\j2ee\home\oc4j.jar;C:\jdev903\j2ee\home\lib\servlet.jar;C:\jdev903\jdev\lib\ojc.jar;C:\jdev903\BC4J\lib\bc4jhtml.jar;C:\jdev903\BC4J\lib\datatags.jar;C:\jdev903\BC4J\lib\bc4juixtags.jar;C:\jdev903\BC4J\lib\bc4j_jclient_common.jar -Djbo.project=empdep0 -Dhttp.proxyHost=http -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=*.oasas.state.ny.us test.test
    oracle.jbo.JboException: STRINGMANAGER: StringManager oracle.jbo.common.CommonMessageBundle (33001) exception oracle.jbo.NoXMLFileException: JBO-26001: XML File not found for the Container empdep0.jpx
         void oracle.jbo.client.Configuration.loadFromClassPath(java.lang.String)
              Configuration.java:301
         oracle.jbo.ApplicationModule oracle.jbo.client.Configuration.createRootApplicationModule(java.lang.String, java.lang.String, oracle.jbo.common.ampool.EnvInfoProvider)
              Configuration.java:1090
         oracle.jbo.ApplicationModule oracle.jbo.client.Configuration.createRootApplicationModule(java.lang.String, java.lang.String)
              Configuration.java:1073
         void test.test.main(java.lang.String[])
    I'm pretty clueless on this one. What do you think?
    -Jeff

  • Calling a PL/SQL function in the SQL statement

    I have a PL/SQL function which i should call in a SQL statement.
    Let's say the function is func1(parameter1,parameter2),
    it should be called like this :- SELECT func1() FROM mytable ;
    Can any one help me out on this ?
    ---Thanx in advance

    you can call pl/sql functions from pl/sql using
    select fn1('param1','param2') from table;
    if you dont want to pass paramters, you have to specify default
    value while creating function like below
    create function fn1(p1 number default null,p2 varchar2 default
    null) return...
    now you can call using
    select fn1 from table;

Maybe you are looking for

  • My iPhone no longer gives me audible alerts for email and text messages.  Just stopped. Help.

    My iPhone just stopped giving me audible notifications for email and text messages.  It still rings for calls.  I have checked the settings for "Sounds" and they have not changed.  However, in these settings when I try to change the sound I get only

  • Desktop Office Integration in SAP GUI for HTML - dont works?

    Hello all, my program reads an Excel-File with multiple Worksheets into SAP by using class: CL_GUI_CUSTOM_CONTAINER and intefaces: I_OI_CONTAINER_CONTROL, I_OI_DOCUMENT_PROXY AND I_OI_SPREADSHEET. All works fine, but when I integrated the SAP Transac

  • Comlaints about I tunes 12.1.1.4

    There are many complaints on I Tunes 12.1.1.4 version which is unable to connect Apple TV with ITunes on windows 7 PC Is someone in Apple team going to fix the problem? Apple support web sites does not provide an answer to the problem. 

  • J2ee_admin

    Hi , In ECC DEV(Ehp3) system having Dual Stack . now i am upgrading it into EHP4 , abap phase has been completed , now it asking j2ee_pwd and SDM pwd in java phase , now don't know pwd for j2ee_admin , is there any way to reset PWD for J2EE_admin , p

  • LR 2.6 64 bit update problem

    Hi all I wonder if anyone can help.  I'm trying to apply the LR 2.6 update to my computer.  I'm using the 64 bit installer on my Vista 64 bit machine.  I get to to the "Ready to Install" screen, click the Install button, the screen closes and .......