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

Similar Messages

  • Without calling stored procedure or functions from database

    Hi,
    I am using Jdeveloper 11.1.1.5.0.
    =>How to do PL/SQL procedures and functions in ADF without calling stored procedure or function from DB?

    S, PL/SQL procedures and functions are done in Application Module class or in managed bean..By calling the stored procedures or functions from DB.
    But I am asking how to do if DB doesn't have any procedures,triggers and functions.

  • Need to obtain updateable ResultSet via call to PL/SQL function

    I'm using JDBC and the Oracle JDBC driver to call a PL/SQL function that returns a SYS_REFCURSOR. I do this via a CallableStatement object and then cast the output parameter to a ResultSet object. However, I want this ResultSet object I end up with to be updateable. The following code throws an exception stating "Invalid operation for read only resultset: updateString ":
    cstmt2 = con.prepareCall("{? = call get_upload_entry_for_update(?)}",
                             ResultSet.TYPE_FORWARD_ONLY,
                             ResultSet.CONCUR_UPDATABLE);
    cstmt2.registerOutParameter(1, OracleTypes.CURSOR);
    cstmt2.setInt(2, newUploadId);
    cstmt2.execute();
    rs = (ResultSet) cstmt2.getObject(1);
    rs.next();
    rs.updateString("UPLOAD_FILENAME", fileName);
    // . . .So even though, I create the CallableStatement such that ResultSets should be updateable, it's not allowing me to do any updates. Also, in case you're wondering, inside the PL/SQL function, the query on which the cursor is based is a select statement which does specify "for update" at the end.
    I can get it to work as follows using a Statement object that executes the SELECT statement directly instead of a CallableStatement that executes a PL/SQL function:
    Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
    rs = stmt.executeQuery("select UPLOAD_FILENAME, UPLOAD_FILE from rf_upload where upload_id = "+newUploadId+" for update");
    rs.next();
    rs.updateString("UPLOAD_FILENAME", fileName);
    //. . . Although this works, the project I'm working has a goal to encapsulate all SQL into Functions and Stored Procedures so I'd like to get it working that way instead.
    So the bottom-line question is: Using the Oracle JDBC driver, how can I call a PL/SQL function in such a way that I can obtain an updateable ResultSet object?
    Thanks for any suggestions. I'd be happy to clarify anything that's unclear.

    Hmmm...
    I'm still scratching my head about this one, just not sure it's doable, but I'll point out something, maybe it will give you a clue...
    In your code, you have:
    cstmt2 = con.prepareCall("{? = call get_upload_entry_for_update(?)}",
                             ResultSet.TYPE_FORWARD_ONLY,
                             ResultSet.CONCUR_UPDATABLE);I don't think the ResultSet parameters do anything towards your goal of getting an updatable result set via the returned cursor, those parameters affect the result set produced if you were to call:
    ResultSet rs2 = cstmt2.executeQuery();and not the result set generated by:
    rs = (ResultSet) cstmt2.getObject(1);Futhermore, while the "FOR UPDATE" is almost certainly something you want to do, it also doesn't affect the cursor (I think) but merely locks the affected rows in the DB.
    You might try calling rs.getType() and rs.getConcurrency() on the ResultSet you get from getObject, though I suspect they'll merely confirm the bad news that the cursor your getting back isn't right...
    You also might try the Oracle-specific getCursor call:
    rs = ((OracleCallableStatement)cstmt2).getCursor (1)instead of getObject, though I don't think it will help...
    I've been curious enough to dig around through most of my handy references and Oracle's docs and MetaLink and come up mostly empty, although almost 5 years ago Oracle Support said:
    " Reference Cursors from a pl/sql stored procedure are not updateable in any language."

  • SQL report region source to call a pl/sql function using DB link

    Hi - I have a pl/sql function fn_dbtype(id NUMBER) defined in database X. The pl/sql function executes couple DML statements and returns a string (a SELECT query). I am able to call this function using SQL Plus (Connected to Database X) as below and it works fine:
    declare
    vSQL VARCHAR2(100);
    begin
    vSQL := fn_dbtype(1);
    end;
    The DML operations completed fine and vSQL contains the "Select" query now.
    In APEX:
    I am trying to create a SQL report in APEX using SQL query(PL/SQL function returning a sql statement) option. I am trying to figure out what to put in the region source so that the output of the "Select" query is displayed in the report.
    Moreover APEX is hosted in a different database instance. So I would need to call this pl/sql function using a DB Link.
    Please let me know what I need to put in the region source to execute the pl/sql function which returns the "Select" query thereby displaying the query output in the report. Thanks.
    Edited by: user709584 on Mar 19, 2009 2:32 PM
    Edited by: user709584 on Mar 19, 2009 2:34 PM

    try something like this:
    return fn_dbtype(1)@dblink;

  • 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?

  • HTTP - Calling a PL/SQL Function

    I am wanting to call a PL/SQL Function over the web.
    Say if I am using Oracle APEX and my user is the standard "HR".
    How would I call a function from PL/SQL made by the user HR called EXAMPLE_FUNCTION.

    It depends on where you want to call the function. Easiest method would be to create a region based on the PLSQL function.
    If you want to do some plsql function after the page is rendered, then you should find out the event for the field such as onchange or onblurr and call
    a Javascript. The javascript can cal the plsql function...
    Also note that under the database forums there is a forum for Apex and u can see many samples
    Rajesh

  • Calling a pl/sql function.

    Hi,
    I couldn't manage to call a pl/sql function that takes some arguments or no arguments.
    I couldn't find an example but searching through previous topics / discussions I could write something like this :
    ExpressionBuilder expBuilder = new ExpressionBuilder();
    Vector args = new Vector();
    Vector parameters = new Vector();
    // dynamically fill these vectors if there are any arguments to the function
    Expression exp = expBuilder.getFunctionWithArguments(functionName, args);
    DataReadQuery query = new DataReadQuery();
    query.setSelectionCriteria(exp);
    Iterator iter = args.iterator();
    while (iter.hasNext())
    query.addArgument((String)iter.next());
    Object obj = getActiveUnitOfWork().executeQuery(query, parameters);
    at the end what I get is NullPointerException, probably I'm missing something.
    UnitOfWork(17384)--#executeQuery(DataReadQuery())
    UnitOfWork(17384)--java.lang.NullPointerExceptionjava.lang.NullPointerException
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.setCallFromStatement(Unknown Source)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.prepareExecuteSelect(Unknown Source)
         at oracle.toplink.queryframework.DataReadQuery.prepare(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.checkPrepare(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.ReadQuery.execute(Unknown Source)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at com.vnu.publitec.axis.toplink.PersistenceProvider.executeStoredProc(PersistenceProvider.java:420)
         at com.vnu.publitec.axis.dispatcher.AxisDispatcherLocalImpl.executeStoredProc(AxisDispatcherLocalImpl.java:280)
         at com.vnu.publitec.axis.dispatcher.AxisSessionBean.executeStoredProc(AxisSessionBean.java:215)
         at AxisSessionBeanRemote_StatefulSessionBeanWrapper0.executeStoredProc(AxisSessionBeanRemote_StatefulSessionBeanWrapper0.java:501)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:536)

    You must use SQL with DataReadQuery, you cannot use expressions. Since a single value is returned the ValueReadQuery can be used to filter the result.
    Example:
    ValueReadQuery query = new ValueReadQuery("Select My_func(#arg1, #arg2) from dual");
    query.addArgument("arg1");
    query.addArgument("arg2");
    Vector arguments = new Vector(2);
    arguments.add("1");
    arguments.add("2");
    Object result = session.executeQuery(query, arguments);
    or,
    Vector result = session.executeSelectingCall(new SQLCall("select my_func(1, 2) from dual"));

  • 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.

  • How to use sql call a pl/sql function

    Hi there,
    I have a pl/sql function package as below:
    Create or Replace package test10 as
    P_DESFORMAT VARCHAR2(10);
    DESFORMAT VARCHAR2(10);
    function m_tot_u1Formula(m_o_uns number,m_t_uns number,m_v_uns number)return NUMBER ;
         function m_tot_res1Formula(m_o_res number,m_t_res number)return NUMBER;
         function m_occ_u1Formula(m_o_uns number,m_t_uns number)return NUMBER ;
         function m_onrpun1Formula(m_o_uns in number,m_o_res in number)return NUMBER ;
         function m_tenpun1Formula(m_t_res in number,m_t_uns in number)return NUMBER ;
         function m_occpun1formula(m_occ_u in number, m_tot_res in number) return number ;
         function m_vac_rate1formula(m_v_uns in number,m_tot_u in number) return number;
         function m_onrpha1Formula(m_o_res in number,m_area in number) return NUMBER;
         function m_tenpha1Formula(m_t_res in number,m_area in number)return NUMBER ;
         function m_occpha1Formula(m_area in number,m_tot_res in number)return number;
         function P_DESFORMATValidTrigger return boolean;
    END test10;
    CREATE OR REPLACE PACKAGE BODY test10 AS
    function m_tot_u1Formula(m_o_uns number,m_t_uns number,m_v_uns number)return NUMBER is
    begin
    RETURN m_o_uns + m_t_uns + m_v_uns;
    end;
    function m_tot_res1Formula(m_o_res number,m_t_res number)return NUMBER is
    begin
    RETURN m_o_res + m_t_res;
    end;
    function m_occ_u1Formula(m_o_uns number,m_t_uns number)return NUMBER is
    begin
    RETURN m_o_uns + m_t_uns;
    end;
    function m_onrpun1Formula(m_o_uns in number,m_o_res in number)return NUMBER is
    begin
    IF m_o_uns > 0 THEN
    RETURN m_o_res / m_o_uns;
    ELSE
         RETURN NULL;
    END IF;
    end;
    function m_tenpun1Formula(m_t_res in number,m_t_uns in number)return NUMBER is
    begin
    IF m_t_uns > 0 THEN
    RETURN m_t_res/m_t_uns;
    ELSE
         RETURN NULL;
    END IF;
    end;
    function m_occpun1formula(m_occ_u in number,m_tot_res in number) return number is
    begin
    IF m_occ_u > 0 THEN
    RETURN m_tot_res / m_occ_u;
    ELSE
         RETURN NULL;
    END IF;
    end;
    function m_vac_rate1formula(m_v_uns in number,m_tot_u in number) return number is
    begin
    IF m_tot_u > 0 THEN
    RETURN 100 * m_v_uns / m_tot_u;
    ELSE
         RETURN NULL;
    END IF;
    end;
    function m_onrpha1Formula(m_o_res in number,m_area in number) return NUMBER is
    begin
    IF m_o_res > 0 THEN
    RETURN m_o_res / m_area;
    ELSE
         RETURN NULL;
    END IF;
    end;
    function m_tenpha1Formula(m_t_res in number,m_area in number)return NUMBER is
    begin
    IF m_t_res > 0 THEN
         RETURN m_t_res / m_area;
    ELSE
         RETURN NULL;
    END IF;
    end;
    function m_occpha1Formula(m_area in number,m_tot_res in number)return number is
    begin
    IF m_area > 0 THEN
    RETURN m_tot_res / m_area;
    ELSE
         RETURN NULL;
    END IF;
    end;
    function P_DESFORMATValidTrigger return boolean is
    begin
    DESFORMAT := P_DESFORMAT;
    return (TRUE);
    end;
    END test10 ;
    the package is compiled successfully.
    And my sql statement will call those function in this package such as:
    select test10.m_tot_u1Formula(m_o_uns ,m_t_uns ,m_v_uns) m_tot_u,
    test10.m_tot_res1Formula(m_o_res,m_t_res)m_tot_res,
    test.m_occ_u1Formula(m_o_uns ,m_t_uns)m_occ_u,
    test10.m_onrpun1Formula(m_o_uns ,m_o_res )m_onrpun,
    test10.m_tenpun1Formula(m_t_res ,m_t_uns )m_tenpun,
    test10.m_occpun1formula(:m_occ_u , :m_tot_res )m_occpun,
    test10.m_vac_rate1formula(m_v_uns ,m_tot_u ) m_vac_rate,
    test10.m_onrpha1Formula(m_o_res ,m_area ) m_onrpha,
    test10.m_tenpha1Formula(m_t_res ,m_area ) m_tenpha,
    test.m_occpha1Formula(m_area , :m_tot_res ) m_occpha
    from ..... where.....
    Is it right to call those functions? Thanks in advance.
    Appcat

    I spoke too soon on the impracticality of a function-based index on a view. My recollection was that the CBO wasn't smart enough to recognize that a FBI on an expression like (col1*col2) could be used to resolve queries that involved a simple transform (i.e. col2*col1), which tended to force you to have a user-defined function behind the FBI to make sure that someone cleaning up code didn't accidentally make the index unusable. Now that I've actually tested it, my recollection, at least on 10.2, is clearly incorrect.
    There's certainly a matter of personal taste here. If I knew what these variables were intended to represent, I'd have no problem maintaining either syntax because it should be relatively obvious whether either piece of code is suspect. I do have to confess that I had to look up the syntax for the NULLIF function yesterday in order to reply to this thread-- my wager is that if I had to look it up, a good fraction of the PL/SQL programmers out there would have had to look it up as well and might not immediately recognize this as an inverted division by 0 test.
    From a maintenance standpoint, I would personally rather have the package where I can zoom in on the particular function I'm interested in, rather than looking at a view that may be doing a dozen rather similar calculations. I'm a bit more confident that I (or some new maintenance programmer on my team) could change the logic in the function without inadvertently screwing up any of the other functions in the package than I would be that I (or they) would accidentally screw up the view. Clearly, robust test scripts and an automated test suite would help tremendously in either case, and neither change should be too difficult, but my experience is that the package is the easier construct to modify or add to. I certainly believe that other people/ organizations would have different experiences and other people might prefer the view approach. I certainly wouldn't oppose a view-based approach, just as I wouldn't oppose a package.
    There's also still the matter of having a table with every valid input if a view is to be practical. It's certainly possible that such a table exists, but it seems equally possible that there are either many such tables, that these functions are doing calculations on values that aren't stored in tables, etc., in which case a package would be the better solution.
    Justin

  • For each row of a table call a pl/sql function

    Hi,
    i have a search form in adf like this:
    parameter1:___
    parameter2:____
    buttonSearch
    Table with results
    field1 field2 field3
    row1 ------ --------- -------
    row2 ------ --------- -------
    row3 ------ --------- -------
    The user inputs the parameters 1 and 2 then press buttonSearch and the query execute and returns rows 1 to 3.
    What i need is for each row call pl/sql function and passed the parameter 1 and 2 and field 1 to 3 (plsql function recives 5 parameters (parameter1, parameter2, field1 , field2 and field3) )
    my buttonSearch call a java class that execute ExecuteWithParamters method.
    I create the call to my plsql function on Application module class and then export as a java interface.
    So i have the function to use in the viewcontroller layer, but i don't know where to use it, and how to pass the paramters: the parameter 1 and 2 that user inputs and the row fields.....
    any ideas....
    thanks!!

    Hi,
    for this you need to call the PLSQL function upon table rendering, which means that you need a field in the table referencing a managed bean. In the managed bean you can use #{row} and resolve it using a ValueExpression. #{row} gives you access to the current rendered row (this is why you need to do it when the table renders) and thus allows you to call getAttribute(name) to get the values of field 1 - 3. The search field value you should get through the bindings reference (assuming the search form uses ADF). Then you create an operation binding for the executeWithParameters and call operationBindingName.getParamsMap().put(argname, argvalue); on it.
    Frank
    Ps.: I am concerned about the performance you get and wonder if it isn't possible to create a transient attribute that executes the function and displays the results. As I understand, the search parameters are only to filter the result set, which you still can do

  • 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;

  • 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..

  • Stored PL/SQL function that returns REF CURSOR type

    Hello everyone,
    I've come through the following problem:
    1.- I created an PL/SQL stored procedure which returns a REF CURSOR element, definition looks like this:
    PACKAGE PKG_LISTADOS AS
    TYPE tuplas IS REF CURSOR;
    /* Procedimientos exportados por el paquete */
    PROCEDURE inicializarModuloListados;
    FUNCTION recaudacionUltimoMes(medioPago DEF_MEDIO_PAGO.MEDIO_PAGO%TYPE)
    RETURN tuplas;
    2.- Now I would like to call the stored procedure and retrieve the PL/SQL cursor as a ResultSet Java Object. The code I wrote is this:
    Connection conn;
    XmlDocument paramDef;
    conn=poolMgr.getConnection str_poolDBConnection);
    try
    CallableStatement cstmt=conn.prepareCall("{?=call PKG_LISTADOS.recaudacionUltimoMes(?)}");
    cstmt.registerOutParameter(1, java.sql.Types.OTHER);
    cstmt.setString(2, "MONEDA");
    cstmt.executeQuery();
    ResultSet rs=(ResultSet)cstmt.getObject(1);
    catch(SQLException sqlE)
    3.- However, I can't make it OK, all the time I get the following error:
    SQL Error(17004), java.sql.SQLException: Non valid column type
    May anyone help me with this, thanks in advance:
    Miguel-Angel

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by angelrip:
    Hello everyone,
    I've come through the following problem:
    1.- I created an PL/SQL stored procedure which returns a REF CURSOR element, definition looks like this:
    PACKAGE PKG_LISTADOS AS
    TYPE tuplas IS REF CURSOR;
    /* Procedimientos exportados por el paquete */
    PROCEDURE inicializarModuloListados;
    FUNCTION recaudacionUltimoMes(medioPago DEF_MEDIO_PAGO.MEDIO_PAGO%TYPE)
    RETURN tuplas;
    2.- Now I would like to call the stored procedure and retrieve the PL/SQL cursor as a ResultSet Java Object. The code I wrote is this:
    Connection conn;
    XmlDocument paramDef;
    conn=poolMgr.getConnection str_poolDBConnection);
    try
    CallableStatement cstmt=conn.prepareCall("{?=call PKG_LISTADOS.recaudacionUltimoMes(?)}");
    cstmt.registerOutParameter(1, java.sql.Types.OTHER);
    cstmt.setString(2, "MONEDA");
    cstmt.executeQuery();
    ResultSet rs=(ResultSet)cstmt.getObject(1);
    catch(SQLException sqlE)
    3.- However, I can't make it OK, all the time I get the following error:
    SQL Error(17004), java.sql.SQLException: Non valid column type
    May anyone help me with this, thanks in advance:
    Miguel-Angel<HR></BLOCKQUOTE>
    Do something like the following:
    cstmt = conn.prepareCall("{call customer_proc(?, ?)}");
    //Set the first parameter
    cstmt.setInt(1, 40);
    //Register to get the Cursor parameter back from the procedure
    cstmt.registerOutParameter(2, OracleTypes.CURSOR);
    cstmt.execute();
    ResultSet cursor = ((OracleCallableStatement)cstmt).getCursor(2);
    while(cursor.next())
    System.out.println("CUSTOMER NAME: " + cursor.getString(1));
    System.out.println("CUSTOMER AGE: " + cursor.getInt(2));
    cursor.close();
    null

  • Calling a PL/SQL function returning Netsed Table Rows

    Hi,
    I am trying to call a Function which returns Nested Table rows (as Out Parameter) in Java .
    When I am trying to use
    pstmt.registerOutParameter(3, OracleTypes.OTHER);
    to capture the Out parameter in Java code , I get the follwoing error :
    java.sql.SQLException: Invalid column type
    I have even tried using OracleTypes.JAVA_OBJECT ,but I get the same error.
    If I use OracleTypes.JAVA_STRUCT I get
    java.sql.SQLException: Parameter Type Conflict: sqlType=2008
    error.
    Please help .
    Am I doing the right thing ?
    Thanks in advance.
    Ninad

    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/jdbc20/jdbc20.html

  • Calling existing pl/sql

    Hi ,
    in my application I have pl/sql procedures which takes care of complex business logic ,can I call any existing pl/sql procedure from entity object validation layer of bc4j .
    please any one give some idea about this
    thanks
    Sathi

    Hi Sathi,
    This is not a UIX question. However, I see a similar posting at Re: calling stored pl/sql functions You can also try searching this forum and searching or posting to the JDev forum.
    Thanks,
    Jeanne

Maybe you are looking for

  • Windows Installer Service Error - Windows 7 + iTunes 10.2.2

    This is the same type of message posted in various places with the following error: The Windows Installer Service could not be accessed.  This can occur if you are running Windows in safe mode, or if the Windoews Installer is not correctly installer.

  • Error after compile Exception in thread "main" java.lang.NoClassDefFoundErr

    Hi I am very new to Java programming, right now I am using a mac os 10.49 I can create java documents using bbedit and then they compile when i type javac. But when i type java *.java I get the following error Exception in thread "main" java.lang.NoC

  • Firefox frequently hangs when loading websites with Flash video.

    Firefox frequently completely freezes when viewing Flash video and the only way to release it is to manually kill the plugin-container process. This have been verified with several Firefox versions, upto and including 3.6.10 and upto the lastest Flas

  • What does "internet ready" mean?

    I have seen the phrase "internet ready" applied to photos. I have some ideas as to what this might mean, but what DOES it mean? Is it about resolution not being too dense? I know that something like 72 or 79 pixels per inch is all that one needs for

  • Help to find WorkID before the last touch transaction

    Hi, May I ask your help on how to find the transaction (WorkID) or touched before the last transaction. The last touched or transaction for per Itemcode should be "FJ_CBDEF". I have a sample data and DDL as your reference. In my Sample data the 2 res