Database Adapter insert operation with return value

Hi All,
I have a table with auto generate parimary key in DB2 database. I need to have an insert operation ont this table which should return current value of primary key after insert.
For this , I have created an insert operation in DB Adapter. But this insert operation in oneway operation.
Is there any way I can create an Insert operation in DB2 adapter which returns the primary key value?
Thanks
--Sree                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Hi Sree,
With insert operation it is not possible. You may use stored procedure/function to perform insert and return the required value, and call this SP/function using DB Adapter.
Regards,
Anuj

Similar Messages

  • Invoke/db adapter get not the return value of a procedure

    Hi,
    I have a problem with a db adapter.
    A db adapter calls a wrapper procedure and fill data in a object type.
    the wrapper procedure call a procedure in a other schema.
    In that schema the procedure make a insert in a database table
    and give a return value(success_msg or error_msg).
    schema1.pkg_wrapper.proc1(p_in IN schema2.param1_t,p_out out schema2.param2_t)
    is
    begin
    schema2.pkg.proc1(p_in IN param1_t,p_out out param2_t)
    end;
    In one enviroment the bpel process running well in the second enviroment not.
    I had found that the bpel process write in the database and the out parameter is filled with 'ok'.
    But there ist a problem to transfer the value from the called procedure to the db adpater/invoke.
    The releases of the application server and the database a the same, also the releases of jdeveloper.
    My second problem the instance didn't comming back and the entry in the domain.log is
    <2008-04-25 12:51:48,056> <WARN> <mmerkel.collaxa.cube> <BaseCubeSessionBean::logWarning> Error while invoking bean "finder": [com.collaxa.cube.engine.core.InstanceNotFoundException: Instance not found in datasource.
    The process domain was unable to fetch the instance with key "2e52cdd31acca03e:5800031c:119819b87bf:-7bdd" from the datasource.
    Please check that the instance key "2e52cdd31acca03e:5800031c:119819b87bf:-7bdd" refers to a valid instance that has been started and not removed from the process domain.
    ORABPEL-02152
    Instance not found in datasource.
    The process domain was unable to fetch the instance with key "2e52cdd31acca03e:5800031c:119819b87bf:-7bdd" from the datasource.
    Please check that the instance key "2e52cdd31acca03e:5800031c:119819b87bf:-7bdd" refers to a valid instance that has been started and not removed from the process domain.
    and
    <2008-04-25 13:47:53,666> <ERROR> <mmerkel.collaxa.cube.engine> <CubeEngine::processStaleInstance> Instance 2670008 has already been marked as stale ... skipping
    <2008-04-25 13:47:53,672> <ERROR> <mmerkel.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "instance manager": [com.collaxa.cube.engine.core.InstanceStaleException: Inconsistent process guid.
    The instance "2670008" was created with process guid "MD5{ed3f0862561da5254a6cf2fd5a440500}"; the current guid for the process "bucheReo" (revision "1.0") is "MD5{0a8bf160d2ff79eabb2f4b479e876cd0}". Whenever a process is deployed on top of an existing process with the same process id and revision tag, all instances created from the previous process are marked as stale.
    If you are accessing this instance from the console, your browser may be referring to an out-of-date page; please click on the Instances tab to get the current list of active instances.
    ORABPEL-02032
    Inconsistent process guid.
    The instance "2670008" was created with process guid "MD5{ed3f0862561da5254a6cf2fd5a440500}"; the current guid for the process "bucheReo" (revision "1.0") is "MD5{0a8bf160d2ff79eabb2f4b479e876cd0}". Whenever a process is deployed on top of an existing process with the same process id and revision tag, all instances created from the previous process are marked as stale.
    If you are accessing this instance from the console, your browser may be referring to an out-of-date page; please click on the Instances tab to get the current list of active instances.
    Have anyone a idea?
    Every help is welcome?
    Thanks, Michael

    Hi,
    “You should be able to use an assign to copy an output parameter value from the BPEL variable associated with the output parameter of the stored procedure.”
    Yes, that is working well for the input variable. But that doesn’t work for the output variable in the second environment.
    The whole bpel process working well in one environment and does not in the second.
    By now I think there is any adjustment in the database or in the aplication server that we not found and that make the trouble
    What I do is that a invoke element (Invoke_WriteREOInDB) call the db adapter WriteREOInDB. My input variable WriteREOInDB_InputVariable is filled, the db adapater call a procedure and I see my data in the table. Now the procedure gives the result value ‘ok’
    In the invoke element I had the output variable WriteREOInDB_OutputVariable. In the next step I want to assign the value of WriteREOInDB_OutputVariable to my global output variable.
    But the instance didn’t coming back. In the console I get the following message:
    “Instance not found in datasource.
    The process domain was unable to fetch the instance with key "2e52cdd31acca03e:5800031c:119819b87bf:-7e0b" from the data source.”
    So I see nothing in the bpel console.
    Any idea?
    Thanks
    Michael

  • Database Adapter-Insert

    Hi,
    I am new to BPEL. I am trying to learn through tutorials. I am working on Insert tutorial (Database Adapters).
    I was able to compile the project sucessfully in jdev and deploy to Bpel server.
    After giving the input and hitting on post xml message the follwing error comes up:
    file:/C:/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_Insert_1.0_3955c8686706b0e75f228f767a18cf38.tmp/InsertService.wsdl [ InsertService_ptt::insert(MoviesCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [Insert.Movies]. [Caused by: JDBC 2.0 feature is not yet implemented]
    ; nested exception is:
         ORABPEL-11616
    DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [Insert.Movies]. [Caused by: JDBC 2.0 feature is not yet implemented]
    Caused by Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: JDBC 2.0 feature is not yet implementedError Code: 0.
    Does anyone have idea about this error?
    My settings in oc4j_ra.xml are as below:
    <connector-factory location="eis/DB/BPELSamples" connector-name="Database Adapter">
              <config-property name="xADataSourceName" value=""/>
              <config-property name="dataSourceName" value=""/>
              <config-property name="platformClassName" value="oracle.toplink.internal.databaseaccess.OraclePlatform"/>
              <config-property name="usesNativeSequencing" value="true"/>
              <config-property name="sequencePreallocationSize" value="50"/>
              <config-property name="defaultNChar" value="false"/>
              <config-property name="usesBatchWriting" value="true"/>
              <config-property name="driverClassName" value="oracle.lite.poljdbc.POLJDBCDriver"/>
              <config-property name="connectionString" value="jdbc:polite4@localhost:1531:orabpel"/>
              <config-property name="userName" value="system"/>
              <config-property name="password" value="manager"/>
              <config-property name="minConnections" value="1"/>
              <config-property name="maxConnections" value="5"/>
              <config-property name="minReadConnections" value="1"/>
              <config-property name="maxReadConnections" value="5"/>
              <config-property name="usesExternalConnectionPooling" value="false"/>
              <config-property name="usesExternalTransactionController" value="false"/>
              <connection-pooling use="none">
              </connection-pooling>
              <security-config use="none">
              </security-config>
         </connector-factory>
    and datasources.xml is
    <connection-pool name="BPELPM_CONNECTION_POOL">
    <connection-factory factory-class="oracle.lite.poljdbc.POLJDBCDriver"
    user="system"
    password="manager"
    url="jdbc:polite4@localhost:1531:orabpel" />
    </connection-pool>
    <managed-data-source name="BPELServerDataSource"
    connection-pool-name="BPELPM_CONNECTION_POOL"
    jndi-name="jdbc/BPELServerDataSource" tx-level="global"/>
    <managed-data-source name="BPELServerDataSourceWorkflow"
    connection-pool-name="BPELPM_CONNECTION_POOL"
    jndi-name="jdbc/BPELServerDataSourceWorkflow" tx-level="local"/>
    <!--managed-data-source name="BPELSamplesDataSource"
    connection-pool-name="BPELPM_CONNECTION_POOL"
    jndi-name="jdbc/BPELSamplesDataSource" tx-level="global" /-->
    I have a database connection called bpel samples in jdev. Can anyone help me in creating bpel process to insert data in a table using database adapters.
    I am not able to get any output for any of the database adapter tutorials. Any hints????
    Thanks in advance.
    Edited by: user3833651 on Apr 22, 2009 8:17 PM

    The database version is only important with the dehydration store. If you are using the adapters to select / delete / update / insert data into your application it comes down to the jdbc drivers. Basically if you are above 8i you should be fine.
    olite is a very basic database, and the jdbc drivers are flaky, it's also not based on the Oracle code, therefore is not upgradable if you want to increase performance. You would need to perform some manual steps to migrate to a standard database.
    If you are wanting to do basic tutorials and don't want to have a heavy database using all your resources, use oracle XE. No need to pact. If you have a oracle database installed somewhere use that.
    http://www.oracle.com/technology/software/products/database/xe/index.html
    cheers
    James

  • How to call a dialog program with return value in another dialog program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    You can you SET/GET parameters to do this.
    This is some information about this.
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
    To fill one, use:
    SET PARAMETER ID pid FIELD f.
    This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID pid FIELD f.
    This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
    Thanks,
    SriRatna

  • Formating and operating with integer values

    I am new to XML Publisher.
    I have a task to make a layout using rtf. The problem is that I must do an arithmetical operation using data generated from a system report. I must not modify the report!!!
    The value retrieved from report is of X.Y format which means a time period (X - years, Y - months). So I want to split this value in two - one for years and other for months with a posibility of making arithmetical operations over them. Is it possible?? And if so, cand anybody give me a solution for this...?

    ok, back to the problem. As I red in the XML Publihser Users Guide there is a posibility to transform strings in numbers, but I can't figure out how it works! As speaking of my problem I can not do arithmetical operations with that value (YEARS.MONTHS). I tried the to_number function described in XML Publisher User's Guide (page 7-3) over the vlaue x.y, I tried to change the point (x.y) to a comma (x,y) and again aply to_number function over resulted value, but it doesn't work. What do I do wrong?
    I tried the solution of spliting the x from y, but I run into a problem again. The years part x has a variable length so I can't get the y part. (the substr function didn't worked with negative start position - substr(DATE, -3, 3))
    Generaly I'm a very confused about XML Publisher. There are examples in User's Guide which didn't work for me...
    If anybody has some links with documentation about XML Publisher, other than those from ORACLE, please share them with me.
    10x!

  • Error in Database Adapter Insert Or Update (Merge) Operation

    I have a simple SOA composite which reads XML files and posts data to a database table using a database adapter. I would like to perform a merge operation but I keep getting this error in the log -
    SEVERE: JCABinding=> XML2DB:WriteInvToDB [ WriteInvToDB_ptt::merge(InventoryCollection) ] Could not invoke operation 'merge' against the 'Database Adapter' due to:
    BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    merge failed. Descriptor name: [WriteInvToDB.Inventory].
    Caused by java.lang.NullPointerException.
    Here is the complete log:
    SEVERE: JCABinding=> XML2DB:WriteInvToDB [ WriteInvToDB_ptt::merge(InventoryCollection) ] Could not invoke operation 'merge' against the 'Database Adapter' due to:
    BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    merge failed. Descriptor name: [WriteInvToDB.Inventory].
    Caused by java.lang.NullPointerException.
    Please see the logs for the full DBAdapter logging output prior to this exception.
    Jan 3, 2009 10:58:06 AM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log
    SEVERE: JCABinding=> [default/XML2DB!1.0*2008-12-23_13-27-06_078.WriteInvToDB]:merge One-way interaction failed
    Jan 3, 2009 10:58:06 AM oracle.tip.mediator.serviceEngine.MediatorServiceEngine post2Mesh
    SEVERE: Post 2 messah failed
    oracle.fabric.common.FabricInvocationException: BINDING.JCA-12563
    Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'merge' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    merge failed. Descriptor name: [WriteInvToDB.Inventory].
    Caused by java.lang.NullPointerException.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.EndpointInteractionException.getFabricInvocationException(EndpointInteractionException.java:74)
         at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:226)
         at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:153)
         at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
         at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
         at sun.reflect.GeneratedMethodAccessor253.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
    Caused by: BINDING.JCA-12563
    Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'merge' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    merge failed. Descriptor name: [WriteInvToDB.Inventory].
    Caused by java.lang.NullPointerException.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:428)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeJcaReference(JCAInteractionInvoker.java:509)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeAsyncJcaReference(JCAInteractionInvoker.java:493)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAEndpointInteraction.performAsynchronousInteraction(JCAEndpointInteraction.java:429)
         at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:193)
         ... 49 more
    Caused by: BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    merge failed. Descriptor name: [WriteInvToDB.Inventory].
    Caused by java.lang.NullPointerException.
    Please see the logs for the full DBAdapter logging output prior to this exception.
         at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:488)
         at oracle.tip.adapter.db.exceptions.DBResourceException.outboundWriteException(DBResourceException.java:529)
         at oracle.tip.adapter.db.transaction.DBTransaction.commit(DBTransaction.java:287)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:311)
         ... 53 more
    Caused by: java.lang.NullPointerException
         at oracle.toplink.descriptors.DescriptorQueryManager.putCachedUpdateCalls(DescriptorQueryManager.java:1605)
         at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.prepareUpdateObject(ExpressionQueryMechanism.java:1608)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.updateObject(StatementQueryMechanism.java:405)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:1136)
         at oracle.toplink.queryframework.UpdateObjectQuery.executeCommitWithChangeSet(UpdateObjectQuery.java:69)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:279)
         at oracle.toplink.queryframework.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:47)
    Jan 3, 2009 10:58:06 AM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log
    WARNING: JCABinding=> ReadXML ReadXMLonReject: The resource adapter 'File Adapter' requested handling of a malformed inbound message. However, the following Service property has not been defined: 'rejectedMessageHandlers'. Please define it and redeploy the module. Will use the default Rejection Directory file://jca\ReadXML\rejectedMessages for now.
    Jan 3, 2009 10:58:06 AM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log
    WARNING: JCABinding=> ReadXML ReadXMLonReject: Sending invalid inbound message to Exception Handler:
    Jan 3, 2009 10:58:06 AM oracle.tip.mediator.common.error.ErrorMessageEnqueuer$EnqueuerThread run
    SEVERE: Failed to enqueue error message
    javax.jms.TransactionInProgressException: Cannot call commit on a XA capable JMS session.
         at oracle.j2ee.ra.jms.generic.RAUtils.make(RAUtils.java:595)
         at oracle.j2ee.ra.jms.generic.RAUtils.toTransactionInProgressException(RAUtils.java:846)
         at oracle.j2ee.ra.jms.generic.RAUtils.toTransactionInProgressException(RAUtils.java:840)
         at oracle.j2ee.ra.jms.generic.SessionWrapper.commit(SessionWrapper.java:197)
         at oracle.tip.mediator.common.error.ErrorMessageEnqueuer$EnqueuerThread.run(ErrorMessageEnqueuer.java:187)
         at java.lang.Thread.run(Thread.java:595)
    Any help is greatly appreciated.
    The INSERT operation works fine with the database adapter, but I cannot get MERGE and UPDATE operations to work as expected!
    Thanks.

    hi Sudeep,
    We are at first hand struggling with DB adapter problem getting down everytime. Don't know the reason why.
    DB adapter is in down state and when trying to make it up gives below error:
    "weblogic.application.ModuleException: weblogic.connector.exception.RAException: Jndi Name is null or empty."
    I just created a simple sync process using DB adapter (custom select) and deplyed successfully. I hope jndi name is not to be configured in weblogic-ra.xml file.
    This is the first time we are using this JNDI name (eis/DB/calvindb).
    Any inputs will be appreciated.
    Thanks,
    Nikhil

  • Database Adapter: Insert, relationships, sequences and problems of course

    Hello Everyone!!
    I'm trying to do an insert in an Oracle Express Database with a database adapter. I'm trying to do the insert in two tables: SOLICITUDES with a column called NUMSOLICITUD that is also the primary key of the table and it's populated from its own sequence and the other table whose name is DOCJUST with a field NUMSOL. SOLICITUDES has a 1:M relationship with DOCJUST and the fields used in this relationship are NUMSOLICITUD and NUMSOL. The problem is that when the adapter do the insert, the first insert made on SOLICITUDES is correct, but when it tries to insert in the DOCJUST table, when it's supposed to insert in NUMSOL the same value inserted in NUMSOLICITUDES instead of that, a NULL value is inserted in NUMSOL so the process fails. Is it because the NUMSOLICITUDES column is populated from a sequence? How can I resolve that?
    Thanks!!

    Hi,
    OK, I found the following article: http://soa-bpel-esb.blogspot.com/2010/04/understanding-catch-and-catchall.html
    Using the info from that article I have created a test flow, which contains the same insert database adapter as the production flow. I have placed the Invoke within its own scope and attached a "CatchAll" block to this scope. To this block I have added a "empty" step (do nothing).
    In my tests, I see the desired results i.e. the second time I initiate the flow with the same data, the CatchAll block executes, which does nothing, and processing continues after the scope.
    So far so good - my query is how would I catch the specific error of unique index violation rather than general catchall?
    As before, and assistance/comments greatly appreciated.
    Anit

  • Problem with return value of stored function

    Hi,
    I've made a stored function that insert a new row in a table and return the primary key (see at the end of the message the function script).
    In VS 2005 with Visual basic, using the designer, I've created a dataset containing a tableAdapter to be able to use the Pl/SQL function.
    My problem is I can't get the proper return value. The VB code below works without error except that I get 0 as value.
    What's wrong?
    Cheers,
    Sebastien
    VB code
    Dim myAddSession As New ICISDataSetTableAdapters.AddSessionTableAdapter
    Dim intSessionId As Integer
    intSessionId = myAddSession.ADD_SESSION(tbxUsername.Text, _
    tempFolder.Substring(tempFolder.LastIndexOf("\") + 1), _
    "toto", Environment.GetEnvironmentVariable("COMPUTERNAME"), _
    myLevelAccess.icisUserId, myLevelAccess.levelId)
    The debugger tells me that the ADD_SESSION function return value is Object.
    add_session PL/SQL script:
    CREATE OR REPLACE FUNCTION ICISSEC.add_session (
    orausername IN icis_session.ora_user_name%TYPE,
    ctxsessionid IN icis_session.ctx_session_id%TYPE,
    ctxsessionname IN icis_session.ctx_session_name%TYPE,
    ctxservername IN icis_session.ctx_server_name%TYPE,
    icisuserid IN icis_session.icis_user_id%TYPE,
    startlevelid IN icis_session.start_lvl_id%TYPE
    RETURN icis_session.ICIS_SESSION_ID%TYPE
    IS
    tmpvar icis_session.ICIS_SESSION_ID%TYPE;
    BEGIN
    INSERT INTO icis_session
    (ora_user_name, ctx_session_id, ctx_server_name,
    icis_user_id, start_lvl_id, ctx_session_name
    VALUES (orausername, ctxsessionid, ctxservername,
    icisuserid, startlevelid, ctxsessionname
    RETURNING icis_session_id
    INTO tmpvar;
    COMMIT;
    RETURN tmpvar;
    EXCEPTION
    WHEN OTHERS
    THEN
    RAISE;
    END add_session;

    naama wrote:
    that if a value is null to convert it to 0 ? . i mean in the part of the declaration of parameter
    Nope, can't do that in the signature. You'll need to handle that by validating the passed parameters at the start of the function.
    It's simple enough. In your case you might just as well test for NULL and fail the function like this:
        FUNCTION date_post_message(
                user_lock_in IN NUMBER,
                form_type_in IN NUMBER DEFAULT 0 ,
                date_in      IN DATE)
            RETURN BOOLEAN
        IS
            v_num NUMBER(1);
        BEGIN
            dbms_output.put_line('Value of parameters : user_lock_in : '||user_lock_in || ' : form_type_in : '||form_type_in||' : date_in : '||date_in );
            IF user_lock_in = 1 THEN
                RETURN FALSE;
            END IF;
            IF form_type_in IS NULL THEN
                RETURN FALSE;
            ELSIF form_type_in NOT IN (1,2) THEN
                RETURN FALSE;
            END IF;
            RETURN TRUE;
        EXCEPTION
        WHEN NO_DATA_FOUND THEN
            RETURN FALSE;
        END;In other use cases I would declare a local variable and process it like this:
            IF form_type_in IS NULL THEN
                l_form_type := 0;
            ELSE
                 l_form_type := form_type_in;
            END IF;Obviously the code should use the local variable rather than the parameter.
    Validating the values passed in parameters at the start of a function is good practice. If you really want to go to town, read about Design By Contract.
    Cheers, APC
    Edited by: APC on Nov 9, 2011 1:36 PM
    Added example, as requested by OP

  • Improve Database adapter insert performance

    Hopefully this is an easy question to answer. I'm getting passed to my BPEL over 8,000 records and I need to take those records and then insert them into an Oracle database. I've been trying to tune the insert by using properties like inMemoryOptimization, but the load still takes severl hours. Any suggestions on how to get the Database adapter to perform better or load all 8,000 records at once? thanks in advance.

    Hello.
    8000 records doesn't sound "huge", unless a record is say 1 kB then you have 8 MB, which is a large payload to move around in one piece.
    A DB merge is typically slower than an insert, though you did say you were using an insert.
    If you are inserting each row one at a time that seems like it would be pretty slow.
    Normally the input to a DB adapter insert is a collection (of rows) vs. a single row. If you have been handed 8000 individual rows you can assemble them into a collection with an iteration - tedious in BPEL but works fine.
    Daren

  • Override INSERT operation with subquery

    Hi, OTN.
    I have a form to update/insert a table.
    While INSERT one of the fields' value should be obtained by a subquery.
    SQL operation should look like this:
    INSERT INTO table1 (attribA, attribB, attribC)
    VALUES (valueA, valueB, ( SELECT max(valueC) + 1
    FROM table1
    WHERE table1.attribA = valueA
    It is necessary to complete insert in a single operation. Not possible to obtain a value with one query and insert it with another. Triggers also shouldn't be used.
    So i need to use a subquery. My JDev is 11.1.1.1.0.
    How is it done?
    Thanks

    I have problem with detailstamp not working on 11g.
    Let us consider : Item , SubItem relationship.
    Component : Item VO , SubItemVO , Item can have many subitem.
    1.Created ItemVO
    2.Create SubItemVO
    3.Create View Link based on ItemVo-ItemId that is FK in SubItem table.
    4.Created JSF page and Dragged ItemVO from Datacontrol to JSF Pagen as ADF ReadOnly Table.
    5.Expanded Item table structure in Structure window and open the detailstamp.
    6.Dragged SubItemVO in detailstamp as ADF ReadOnly table.
    Expected Result :
    1. ItemVO First Row
    1.SubItems belonging to ITEMVO First Row
    2.SubItems belonging to ITEMVO First Row
    2.ItemVO Second Row.
    1.SubItems belonging to ITEMVO Second Row
    Current Result :
    1. ItemVO First Row
    1.SubItems belonging to ITEMVO First Row
    2.SubItems belonging to ITEMVO First Row
    2.ItemVO Second Row.
    1.SubItems belonging to ITEMVO First Row
    2.SubItems belonging to ITEMVO First Row
    Description: Second ItemVO when expanded shows first ItemVO SUBITEMS.
    Thanks,

  • Will B2B Adapter receive operation with default triggers the SOA Composite

    Hi,
    Can any one provide me answers to this questions?
    *1. Will B2B Adapter receive operation having default protocol will trigger SOA Composite? if so how can we achieve it?*
    *2. will Listening channel with JMS protocol do EDI------XML translation? if so what are the configuration that need to be done?*
    *3. Will B2B Adapter receive operation listens messages from other protocols like File ,FTP ? if so what need to be done ?*

    1. Will B2B Adapter receive operation having default protocol will trigger SOA Composite? if so how can we achieve it?Yes, it can trigger SOA composite. First deploy the inbound B2B agreement with no channels selected under Host TP channels dropdown and then deploy your SOA composite which is referring to the deployed doc-def. Run an inbound test and you should be good to go.
    2. will Listening channel with JMS protocol do EDI------XML translation? if so what are the configuration that need to be done?Yes, you may translate native EDI to XML with JMS listening channel as well. Make sure that listening channel is not marked as internal and an inbound EDI agreement is deployed for corresponding EDI doc. Following custom JMS headers must be set so that B2B can identify the partner -
    FROM_PARTY
    TO_PARTY
    3. Will B2B Adapter receive operation listens messages from other protocols like File ,FTP ? if so what need to be done ?No. B2B adapter supports only three modes - JMS/AQ/Default (fabric), however you may use file/ftp adapter to receive files from B2B over file/ftp respectively.
    Regards,
    Anuj

  • ADF Code Corner 069 : problem with returned value

    Hello,
    I use jdeveloper 11.1.2.2.0 and am trying to follow the sample 69 from ADF Code Croner : how-to create a custom LOV using bounded task flows. http://www.oracle.com/technetwork/developer-tools/adf/learnmore/69-custom-lov-with-btf-276178.pdf
    I have a problem with the returned value. The correct value is returned in the inputText but it seems that it is just at UI level and that binding layer is not impacted. If user click on next button, all others rows show the same value in the inputText (the value chosen before in the lov), and not the correct value which must be value from db.
    How can I solve this problem?
    note : opening the 69-sample, jdeveloper ask me to migrate some files (jpr/jws) from previous version of jdeveloper.
    Edited by: h0s on 8 oct. 2012 06:14

    Yes It happens with the downloaded sample. You can do this test :
    Launch EmployeesForm activity -> Open the LOV and select a department -> click next and see that the department id is the same for all rows.
    jdeveloper 11.1.2.2.0

  • SUBMIT  Report with return values

    Hi,
    I am using the SUBMITE REPORT STATEMENT as
    SUBMIT RVV50R10C WITH st_ledat-LOW =  s_vstel-LOW
                     WITH st_ledat-HIGH =  s_vstel-HIGH
                     AND RETURN EXPORTING LIST TO MEMORY.
    For the report RVV50R10C the o/p is an hierarchical display.
    So when i am exporting list to memory. how exactly are the values populated and,
    if i want two fields from the o/p of the report t be populated in another internal table, how can i get it.
    initially i am calling FM LIST_FROM_MEMORY and getting values in to a itab of type abaplist.
    how the values will be populated into this table.

    Hi,
    Hope this wud help u...
    Once the program report has been accessed, the list stored there in the ABAP Memory is read by means of function modules and inserted in the current list.
    DATA list_tab TYPE TABLE OF abaplist.
    SUBMIT report EXPORTING LIST TO MEMORY
                  AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    IF sy-subrc = 0.
      CALL FUNCTION 'WRITE_LIST'
        TABLES
          listobject = list_tab.
    ENDIF.
    Keerthi.

  • Crash of Oracle XE when check constraint uses in-operator with desc. values

    ORA-03113 and other errors in conjunction with lost of connection occur in Oracle XE under the following conditions:
    /* Crash (values of check constraint in descending order) */
    DROP TABLE CRASHTEST CASCADE CONSTRAINTS;
    CREATE TABLE CRASHTEST
    CRASHTEST_ID NUMBER(9),
    CRASHTEST_OK NUMBER(1) DEFAULT 0
    ALTER TABLE CRASHTEST ADD (CONSTRAINT CRASHTEST_CK CHECK (CRASHTEST_OK IN (0,-1)));
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (1, 0);
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (2, -1);
    COMMIT;
    SELECT * FROM CRASHTEST WHERE CRASHTEST_OK = 0;
    If all values of the in-clause within the check constraint are entered in ascending order, no error occurs:
    /* No Crash (values of check constraint in ascending order) */
    DROP TABLE CRASHTEST CASCADE CONSTRAINTS;
    CREATE TABLE CRASHTEST
    CRASHTEST_ID NUMBER(9),
    CRASHTEST_OK NUMBER(1) DEFAULT 0
    ALTER TABLE CRASHTEST ADD (CONSTRAINT CRASHTEST_CK CHECK (CRASHTEST_OK IN (-1,0)));
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (1, 0);
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (2, -1);
    COMMIT;
    SELECT * FROM CRASHTEST WHERE CRASHTEST_OK = 0;
    Especially interesting is the fact, that the error is caused by a check constraint in conjunction with a select statement!
    Hopefully, there are no other hidden bombs stealing my time...
    Have a nice day,
    Sven

    It might be interesting to post that in the XE forum to notify Oracle developers and XE users.
    Oracle Database Express Edition (XE)
    C.

  • File adapter PUT operation with header row.

    i have schema generated in the below format.
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
                xmlns:tns="http://TargetNamespace.com/InboundService"
                targetNamespace="http://TargetNamespace.com/InboundService"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified"
                nxsd:version="NXSD"
                nxsd:stream="chars"
                nxsd:encoding="US-ASCII"
                nxsd:hasHeader="true"
                nxsd:headerLines="1"
                nxsd:headerLinesTerminatedBy="${eol}"
    >
      <xsd:element name="Root-Element">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="Record" minOccurs="1" maxOccurs="unbounded">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="typdoc" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="~" />
                  <xsd:element name="datdoc" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="~" />
                  <xsd:element name="nomdoc" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="~" />
    but the above schema do not write the header line in the FTP file.
    Each of the element name should work as header row.
    Below is the JCA configuration of the FTP
    <adapter-config name="Payment_Details_FTP" adapter="FTP Adapter" wsdlLocation="Payment_Details_FTP.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="outbound/ftp/test1"/>
      <endpoint-interaction portType="Put_ptt" operation="Put">
        <interaction-spec className="oracle.tip.adapter.ftp.outbound.FTPInteractionSpec">
          <property name="PhysicalDirectory" value="Test"/>
          <property name="FileType" value="ascii"/>
          <property name="Append" value="false"/>
          <property name="FileNamingConvention" value="1C_Extract.out%yyMMddHHmmss%"/>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>
    Please let me know if i'm missing some configuration here.
    Regards
    sujan

    Remove "header" related attributes from the "schema" tag.
    ===================================
    nxsd:hasHeader="true"
                nxsd:headerLines="1"
                nxsd:headerLinesTerminatedBy="${eol}"
    ===================================
    And then, define another element like "Record" to read the header data.
    http://docs.oracle.com/cd/E15523_01/integration.1111/e10231/nfb.htm#CHDBECJI

Maybe you are looking for