Passing data from Oracle stored procedures to Java

We're going to write a new web interface for a big system based on Oracle database. All business rules are already coded in PL/SQL stored procedures and we'd like to reuse as much code as possible. We'll write some new stored procedures that will combine the existing business rules and return the final result dataset.
We want to do this on the database level to avoid java-db round trips. The interface layer will be written in Java (we'd like to use GWT), so we need a way of passing data from Oracle stored procedures to Java service side. The data can be e.g. a set of properties of a specific item or a list of items fulfilling certain criteria. Would anyone recommend a preferable way of doing this?
We're considering one of the 2 following scenarios:
passing objects and lists of objects (DB object types defined on the schema level)
passing a sys_refcursor
We verified that both approaches are "doable", the question is more about design decision, best practice, possible maintenance problems, flexibility, etc.
I'd appreciate any hints.

user1754151 wrote:
We're going to write a new web interface for a big system based on Oracle database. All business rules are already coded in PL/SQL stored procedures and we'd like to reuse as much code as possible. We'll write some new stored procedures that will combine the existing business rules and return the final result dataset.
We want to do this on the database level to avoid java-db round trips. The interface layer will be written in Java (we'd like to use GWT), so we need a way of passing data from Oracle stored procedures to Java service side. The data can be e.g. a set of properties of a specific item or a list of items fulfilling certain criteria. Would anyone recommend a preferable way of doing this?
We're considering one of the 2 following scenarios:
passing objects and lists of objects (DB object types defined on the schema level)
passing a sys_refcursor
We verified that both approaches are "doable", the question is more about design decision, best practice, possible maintenance problems, flexibility, etc.
I'd appreciate any hints.If logic is already written in DB, and the only concern is of passing the result to java service side, and also from point of maintenance problem and flexibility i would suggest to use the sys_refcursor.
The reason if Down the line any thing changes then you only need to change the arguments of sys_refcursor in DB and as well as java side, and it is much easier and less efforts compare to using and changes required for Types and Objects on DB and java side.
The design and best practise keeps changing based on our requirement and exisiting design. But by looking at your current senario and design, i personally suggest to go with sys_refcursor.

Similar Messages

  • How to connect to UNIX OS from oracle stored procedure

    Hi,
    I need to connect to UNIX OS from oracle stored procedure.
    Curently working in Oracle9i.
    I tried in google but I could'nt get any.
    Can you send me pointers on how to do this.
    Thanks,
    Kavitha.

    Can use Java Stored Proc, or an External Proc.
    Java method:
    create or replace and compile Java Source named "OSCommand" as
    -- java:        OS COMMAND
    -- descr:       Executes an Operating System Command using the JAVA RTS
    -- IN parameter:        os command to execute (including fully qualified path names)
    -- OUT parameter:       returncode [\nstring]
    --                      where string a max of 32000 chars of the output of the command
    --                      (note that \n is used as separators in the string)
    --                      returncode=-1   Java RTS error occurred (e.g. command does not exist)
    --                      returncode=255  o/s command failed (e.g. invalid command params)
    import java.io.*;
    import java.lang.*;
    public class OSCommand{
            public static String Run(String Command){
                    Runtime rt = Runtime.getRuntime();
                    int     rc = -1;
                    try{
                            Process p = rt.exec( Command );
                            int bufSize = 32000;
                            int len = 0;
                            byte buffer[] = new byte[bufSize];
                            String s = null;
                            BufferedInputStream bis = new BufferedInputStream( p.getInputStream(), bufSize );
                            len = bis.read( buffer, 0, bufSize );
                            rc = p.waitFor();
                            if ( len != -1 ){
                                    s = new String( buffer, 0, len );
                                    return( s );
                            return( rc+"" );
                    catch (Exception e){
                            e.printStackTrace();
                            return(  "-1\ncommand[" + Command + "]\n" + e.getMessage() );
    show errors
    create or replace function osexec( cCommand IN string ) return varchar2 is
    -- function:    OS EXEC
    -- descr:       Executes an Operating System Command
    language        JAVA
    name            'OSCommand.Run(java.lang.String) return java.lang.String';
    show errors===
    This can then be used from PL/SQL and even SQL. e.g.
    SQL> select osexec( '/bin/date' ) from dual;
    OSEXEC('/BIN/DATE')
    Wed Nov  9 13:30:13 SAST 2005
    SQL>Note the Java permissions required - replace FOO with the name of applicable Oracle schema
    ==begin
            dbms_java.grant_permission(
                    'FOO',
                    'SYS:java.io.FilePermission',
                    '<<ALL FILES>>',
                    'execute'
            dbms_java.grant_permission(
                    'FOO',
                    'SYS:java.lang.RuntimePermission',
                    'writeFileDescriptor',
            dbms_java.grant_permission(
                    'FOO',
                    'SYS:java.lang.RuntimePermission',
                    'readFileDescriptor',
            commit;
    end;
    /==
    Last thing... note that opens a potential giant size security hole into the Oracle Server Platform. So implement it properly using a proper Oracle security model.

  • Read data from a Stored Procedure in Android

    I have a Stored Procedure say CustOrdersDetail. I have created a MBO for it in the workspace and deployed it on SAP Mobile Server. I am unable to read data from the stored procedure in code of the Android Application. If I pass a default load argument, then I am able to read data using findAll method. How to get the data from the stored procedure by passing it an argument in the Android Code ?
    Message was edited by: Abhijit Kadam

    Currently I am trying to call the stored procedure and retrieve the results. The stored procedure accepts 'orderId' as an argument and fetches the Product and Order Details.

  • How to pass parameter from 1 stored procedure to another stored procedure inside crystal report

    Hi
    I have several stored procedure in my Crystal Report. I am wondering if it is possible for me to pass a parameter to one of the stored procedure and to use the result of that stored procedure E.g. CustomerCode. To another 2 stored procedure to generate the report dynamically?
    I have 3 stored procedure
    The 1st one is used to gather information and process the calculation
    another 2 stored procedure is used for generate the graph and both of them required to take 2 parameters. The 1st stored procedure will require 1 parameter (E.G. Reference Code) and will return a set of information including the data that could be use on the other 2 stored procedures.
    After I added these 2 stored procedure, it requires me to pass 3 parameters to the report. I would like to know if I could only pass the Reference Code for stored procedure 1 and use it to retrieve the information for the other 2 parameter?
    Thanks in advance
    Chi

    Hi Chi
    To pass parameter from 1 stored procedure to another stored procedure, you will have to create sub report. In your case you will have to create 2 sub reports for 2nd and 3rd stored procedure and link those sub reports with the main report using Reference Code field in order to pass the values.
    After creating the report when you will refresh the report, it will ask 4 parameters, one parameter for main report, one for the first subreport and two for second subreport to fetch the data correctly.
    Regards
    Poonam Thorat.

  • Passing arrays to Oracle Stored procedure.

    Have any body passed arrays to Oracle stored procedures while the app is running in Weblogic app server. I am able to pass the arrays with regular JDBC connection. If I run the same piece of code using a connection recieved from the datasource of weblogic server, its not working. I am getting serialization errors with the ArrayDescriptor class. Looks like the ArrayDescriptor is not serializable.
    Does anybody know solution/workaround to pass arrays ?
    Thanks in advance

    you could write a wrapper class that extends ArrayDescriptor and implements serializable...
    for example your class would look something like this.
    public class MyArrayDescriptor extends ArrayDescriptor
    implements Serializable
    in your regular code use the wrapper class in place of the ArrayDescriptor (it will contain all the same methods as the real ArrayDescriptor) and you should be able to toss your wrapper class anywhere you please.

  • Calling OLE API from Oracle Stored Procedure

    An application that I need to intergate with exposes only the OLE API. How can I invoke these OLE APIs from Oracle stored procedure? Do I need any special/ additional Oracle components? Can you please help. Any links to examples would be very helpful. Thanks.

    If what you mean by Oracle stored procedures is pl/sql then yes.
    You can create a "wrapper" this way:
    CREATE OR REPLACE FUNCTION xmlXform
    in_mapUrl IN VARCHAR2,
    in_inputUrl IN VARCHAR2
    RETURN VARCHAR2
    AS
    LANGUAGE JAVA NAME
    'com.yourcompany.xml2any.xform(java.lang.String,java.lang.String)
    RETURN java.lang.String';
    Then load the java as:
    loadjava -user youruser/youruserpasswd -resolve -verbose lib/xmlparserv2.jar classes/com/yourcompany/xform.class classes/com/yourcompany/xml2any.class
    The java, given the correct permissions, can do anything java can do including communicate with outside applications.
    Is this the "best" way... depends on what you are trying to accomplish.

  • How can I return a big amount of data from a stored procedure?

    How can I return a big amount of data from a stored procedure in a efficient way ?
    For example not using a cursor for going through all the rows and then assign the values to variables.
    thanks in advance!

    Let's see if I'm able to explain myself..
    I have a SQL query with..about 190.000 (in the best fo the the options)
    I have something like this in my stored procedure..
    FOR REC IN trn_adj_no
    LOOP
    REC_PIPE.INSTANCE_ID:=REC.INSTANCE_ID;
    REC_PIPE.PROCESS_ID:=REC.PROCESS_ID;
    REC_PIPE.ENTITY_TYPE:='TRANSACTION';
    REC_PIPE.CRES_FILENAME:=REC.CRES_FILENAME;
    REC_PIPE.CHUNK_REVISION_SK:=P_CHUNK_REVISION_SK;
    REC_PIPE.CHUNK_ID:=trim(p_chunk_id);
    REC_PIPE.FCL_SK:=REC.FCL_SK;
    REC_PIPE.FCL_TRADE_SK:=REC.FCL_TRADE_SK;
    REC_PIPE.FCL_VALUATION_SK:=REC.FCL_VALUATION_SK;
    REC_PIPE.FCL_BUSINESS_GROUP:=REC.FCL_BUSINESS_GROUP;
    REC_PIPE.ABS_TRN_CD:=REC.ABS_TRN_CD;
    REC_PIPE.ACC_INTEREST_IMP_LOAN_CCY_IFRS:=REC.ACC_INTEREST_IMP_LOAN_CCY_IFRS;
    REC_PIPE.ACC_INTEREST_IMP_LOAN_IFRS:=REC.ACC_INTEREST_IMP_LOAN_IFRS;
    REC_PIPE.ACCRUED_INT_AMT:=REC.ACCRUED_INT_AMT;
    REC_PIPE.ACCRUED_INT_CCY_CD:=REC.ACCRUED_INT_CCY_CD;
    REC_PIPE.AMORT_ID:=REC.AMORT_ID;
    REC_PIPE.AMORT_IND:=REC.AMORT_IND;
    REC_PIPE.ATI:=REC.ATI;
    REC_PIPE.ATI_2:=REC.ATI_2;
    REC_PIPE.ATI_2_AMT:=REC.ATI_2_AMT;
    REC_PIPE.ATI_2_CCY_CD:=REC.ATI_2_CCY_CD;
    REC_PIPE.ATI_AMT:=REC.ATI_AMT;
    REC_PIPE.ATI_CCY_CD:=REC.ATI_CCY_CD;
    REC_PIPE.AVG_MTH_DUE_AMT:=REC.AVG_MTH_DUE_AMT;
    REC_PIPE.AVG_MTH_DUE_CCY_CD:=REC.AVG_MTH_DUE_CCY_CD;
    REC_PIPE.AVG_YTD_DUE_AMT:=REC.AVG_YTD_DUE_AMT;
    REC_PIPE.AVG_YTD_DUE_CCY_CD:=REC.AVG_YTD_DUE_CCY_CD;
    REC_PIPE.BAL_SHEET_EXP_AMT:=REC.BAL_SHEET_EXP_AMT;
    REC_PIPE.BAL_SHEET_EXP_AMT_IFRS:=REC.BAL_SHEET_EXP_AMT_IFRS;
    REC_PIPE.BAL_SHEET_EXP_CCY_CD:=REC.BAL_SHEET_EXP_CCY_CD;
    REC_PIPE.BAL_SHEET_EXP_CCY_CD_IFRS:=REC.BAL_SHEET_EXP_CCY_CD_IFRS;
    REC_PIPE.BAL_SHEET_EXP_EUR_AMT:=REC.BAL_SHEET_EXP_EUR_AMT;
    REC_PIPE.BAL_SHEET_EXP_EUR_AMT_IFRS:=REC.BAL_SHEET_EXP_EUR_AMT_IFRS;
    REC_PIPE.BEN_CCDB_ID:=REC.BEN_CCDB_ID;
    REC_PIPE.BEN_CD:=REC.BEN_CD;
    REC_PIPE.BEN_SRC_CD:=REC.BEN_SRC_CD;
    REC_PIPE.BOOK_CD:=REC.BOOK_CD;
    REC_PIPE.BOOK_TYPE_CD:=REC.BOOK_TYPE_CD;
    REC_PIPE.BOOK_VAL_AMT:=REC.BOOK_VAL_AMT;
    REC_PIPE.BOOK_VAL_AMT_IFRS:=REC.BOOK_VAL_AMT_IFRS;
    REC_PIPE.BOOK_VAL_CCY_CD:=REC.BOOK_VAL_CCY_CD;
    REC_PIPE.BOOK_VAL_CCY_CD_IFRS:=REC.BOOK_VAL_CCY_CD_IFRS;
    REC_PIPE.BOOK_VAL_US_GAAP_AMT:=REC.BOOK_VAL_US_GAAP_AMT;
    REC_PIPE.BRANCH_ID:=REC.BRANCH_ID;
    REC_PIPE.BRANCH_LOC_CD:=REC.BRANCH_LOC_CD;
    REC_PIPE.BS_COMPEN_CD:=REC.BS_COMPEN_CD;
    REC_PIPE.BUS_AREA_UBR_ID:=REC.BUS_AREA_UBR_ID;
    REC_PIPE.CA_CD:=REC.CA_CD;
    REC_PIPE.CAD_RISK_WEIGHT_PCT:=REC.CAD_RISK_WEIGHT_PCT;
    REC_PIPE.CASH_SETTLE_IND:=REC.CASH_SETTLE_IND;
    REC_PIPE.CLS_FLG:=REC.CLS_FLG;
    REC_PIPE.COB_DT:=REC.COB_DT;
    REC_PIPE.COL_AGMENT_SRC_CD:=REC.COL_AGMENT_SRC_CD;
    REC_PIPE.CONSOLIDATION_PCT:=REC.CONSOLIDATION_PCT;
    REC_PIPE.CONTRACT_AMT:=REC.CONTRACT_AMT;
    REC_PIPE.CONTRACT_COUNT:=REC.CONTRACT_COUNT;
    REC_PIPE.COST_UNSEC_WORKOUT_AMT:=REC.COST_UNSEC_WORKOUT_AMT;
    REC_PIPE.CPTY_CCDB_ID:=REC.CPTY_CCDB_ID;
    REC_PIPE.CPTY_CD:=REC.CPTY_CD;
    REC_PIPE.CPTY_LONG_NAME:=REC.CPTY_LONG_NAME;
    REC_PIPE.CPTY_SRC_PROXY_UBR_ID:=REC.CPTY_SRC_PROXY_UBR_ID;
    REC_PIPE.CPTY_TYPE_CD:=REC.CPTY_TYPE_CD;
    REC_PIPE.CPTY_UBR_ID:=REC.CPTY_UBR_ID;
    REC_PIPE.CREDIT_LINE_NET_IND:=REC.CREDIT_LINE_NET_IND;
    REC_PIPE.CRES_SYS_ID:=REC.CRES_SYS_ID;
    REC_PIPE.CTRY_RISK_PROVISION_BAL_AMT:=REC.CTRY_RISK_PROVISION_BAL_AMT;
    REC_PIPE.CUR_NOTIONAL_AMT:=REC.CUR_NOTIONAL_AMT;
    REC_PIPE.CUR_NOTIONAL_CCY_CD:=REC.CUR_NOTIONAL_CCY_CD;
    REC_PIPE.CUR_NOTIONAL_CCY_CD_IFRS:=REC.CUR_NOTIONAL_CCY_CD_IFRS;
    REC_PIPE.CUR_NOTIONAL_AMT_IFRS:=REC.CUR_NOTIONAL_AMT_IFRS;
    REC_PIPE.DB_ENTITY_TRANSFER_ASSETS_CD:=REC.DB_ENTITY_TRANSFER_ASSETS_CD;
    REC_PIPE.DEAL_TYPE_CD:=REC.DEAL_TYPE_CD;
    REC_PIPE.DECOMPOSITION_IDENTIFIER:=REC.DECOMPOSITION_IDENTIFIER;
    REC_PIPE.DEF_LOAN_FEE_IFRS:=REC.DEF_LOAN_FEE_IFRS;
    REC_PIPE.DEF_LOAN_FEE_USGAAP:=REC.DEF_LOAN_FEE_USGAAP;
    REC_PIPE.DELIVERY_DT:=REC.DELIVERY_DT;
    REC_PIPE.DERIV_NOT_DT:=REC.DERIV_NOT_DT;
    REC_PIPE.DERIV_NOT_IND:=REC.DERIV_NOT_IND;
    REC_PIPE.DESK:=REC.DESK;
    REC_PIPE.DIVISION_UBR_ID:=REC.DIVISION_UBR_ID;
    REC_PIPE.ENTITY_CCDB_ID:=REC.ENTITY_CCDB_ID;
    REC_PIPE.FAC_CD:=REC.FAC_CD;
    REC_PIPE.FAC_LIMIT_CD:=REC.FAC_LIMIT_CD;
    REC_PIPE.FAC_LIMIT_SRC_CD:=REC.FAC_LIMIT_SRC_CD;
    REC_PIPE.FAC_SRC_CD:=REC.FAC_SRC_CD;
    REC_PIPE.FAIR_VAL_CD_IFRS:=REC.FAIR_VAL_CD_IFRS;
    REC_PIPE.FED_CLASS_CD:=REC.FED_CLASS_CD;
    REC_PIPE.FIRST_RISK_PROVISION_DT:=REC.FIRST_RISK_PROVISION_DT;
    REC_PIPE.FV_IMP_LOSS_CRED_CCY_IFRS:=REC.FV_IMP_LOSS_CRED_CCY_IFRS;
    REC_PIPE.FV_IMP_LOSS_CRED_IFRS:=REC.FV_IMP_LOSS_CRED_IFRS;
    REC_PIPE.FV_IMP_LOSS_CRED_YTD_CCY_IFRS:=REC.FV_IMP_LOSS_CRED_YTD_CCY_IFRS;
    REC_PIPE.FV_IMP_LOSS_CRED_YTD_IFRS:=REC.FV_IMP_LOSS_CRED_YTD_IFRS;
    REC_PIPE.GEN_RISK_PROVISION_BAL_AMT:=REC.GEN_RISK_PROVISION_BAL_AMT;
    REC_PIPE.GL_PROFIT_CENTRE:=REC.GL_PROFIT_CENTRE;
    REC_PIPE.GLOBAL_GL_CD:=REC.GLOBAL_GL_CD;
    REC_PIPE.IFRS_POSITION:=REC.IFRS_POSITION;
    REC_PIPE.IFRS_POSITION_AGGR:=REC.IFRS_POSITION_AGGR;
    REC_PIPE.IMP_DT:=REC.IMP_DT;
    REC_PIPE.IMP_METHOD_CD:=REC.IMP_METHOD_CD;
    REC_PIPE.INT_COMPEN_CD:=REC.INT_COMPEN_CD;
    REC_PIPE.INTER_IND:=REC.INTER_IND;
    REC_PIPE.INTERCO_IND:=REC.INTERCO_IND;
    REC_PIPE.INTERCO_IND_IFRS:=REC.INTERCO_IND_IFRS;
    REC_PIPE.LOAN_PUR_FAIR_VAL_ADJ_AMT:=REC.LOAN_PUR_FAIR_VAL_ADJ_AMT;
    REC_PIPE.LOCAL_GL_CD:=REC.LOCAL_GL_CD;
    REC_PIPE.LOWEST_LEVEL_UBR_ID:=REC.LOWEST_LEVEL_UBR_ID;
    REC_PIPE.LTD_FEES_TO_PRINCIPAL_AMT:=REC.LTD_FEES_TO_PRINCIPAL_AMT;
    REC_PIPE.MA_CD:=REC.MA_CD;
    REC_PIPE.MA_SPL_NOTE:=REC.MA_SPL_NOTE;
    REC_PIPE.MA_SRC_CD:=REC.MA_SRC_CD;
    REC_PIPE.MA_TYPE_CD:=REC.MA_TYPE_CD;
    REC_PIPE.MAN_LINK_ID:=REC.MAN_LINK_ID;
    REC_PIPE.MASTER_MA_CD:=REC.MASTER_MA_CD;
    REC_PIPE.MATURITY_DT:=REC.MATURITY_DT;
    REC_PIPE.MAX_OUT_AMT:=REC.MAX_OUT_AMT;
    REC_PIPE.MAX_OUT_CCY_CD:=REC.MAX_OUT_CCY_CD;
    REC_PIPE.MTM_AMT:=REC.MTM_AMT;
    REC_PIPE.MTM_AMT_IFRS:=REC.MTM_AMT_IFRS;
    REC_PIPE.MTM_CCY_CD:=REC.MTM_CCY_CD;
    REC_PIPE.MTM_CCY_CD_IFRS:=REC.MTM_CCY_CD_IFRS;
    REC_PIPE.NEW_RISK_PROVISION_AMT:=REC.NEW_RISK_PROVISION_AMT;
    REC_PIPE.NON_PERF_IND:=REC.NON_PERF_IND;
    REC_PIPE.NON_PERF_RCV_INT_AMT:=REC.NON_PERF_RCV_INT_AMT;
    REC_PIPE.OPT_TYPE_CD:=REC.OPT_TYPE_CD;
    REC_PIPE.ORIG_NOTIONAL_AMT:=REC.ORIG_NOTIONAL_AMT;
    REC_PIPE.ORIG_NOTIONAL_CCY_CD:=REC.ORIG_NOTIONAL_CCY_CD;
    REC_PIPE.ORIG_TRN_CD:=REC.ORIG_TRN_CD;
    REC_PIPE.ORIG_TRN_SRC_CD:=REC.ORIG_TRN_SRC_CD;
    REC_PIPE.OTHER_CUR_NOTIONAL_AMT:=REC.OTHER_CUR_NOTIONAL_AMT;
    REC_PIPE.OTHER_CUR_NOTIONAL_CCY_CD:=REC.OTHER_CUR_NOTIONAL_CCY_CD;
    REC_PIPE.OTHER_ORIG_NOTIONAL_AMT:=REC.OTHER_ORIG_NOTIONAL_AMT;
    REC_PIPE.OTHER_ORIG_NOTIONAL_CCY_CD:=REC.OTHER_ORIG_NOTIONAL_CCY_CD;
    REC_PIPE.OVERDUE_AMT:=REC.OVERDUE_AMT;
    REC_PIPE.OVERDUE_CCY_CD:=REC.OVERDUE_CCY_CD;
    REC_PIPE.OVERDUE_DAY_COUNT:=REC.OVERDUE_DAY_COUNT;
    REC_PIPE.PAY_CONTRACT_AMT:=REC.PAY_CONTRACT_AMT;
    REC_PIPE.PAY_CONTRACT_CCY_CD:=REC.PAY_CONTRACT_CCY_CD;
    REC_PIPE.PAY_FWD_AMT:=REC.PAY_FWD_AMT;
    REC_PIPE.PAY_FWD_CCY_CD:=REC.PAY_FWD_CCY_CD;
    REC_PIPE.PAY_INT_INTERVAL:=REC.PAY_INT_INTERVAL;
    REC_PIPE.PAY_INT_RATE:=REC.PAY_INT_RATE;
    REC_PIPE.PAY_INT_RATE_TYPE_CD:=REC.PAY_INT_RATE_TYPE_CD;
    REC_PIPE.PAY_NEXT_FIX_CPN_DT:=REC.PAY_NEXT_FIX_CPN_DT;
    REC_PIPE.PAY_UL_SEC_TYPE_CD:=REC.PAY_UL_SEC_TYPE_CD;
    REC_PIPE.PAY_UL_ISS_CCDB_ID:=REC.PAY_UL_ISS_CCDB_ID;
    REC_PIPE.PAY_UL_MTM_AMT:=REC.PAY_UL_MTM_AMT;
    REC_PIPE.PAY_UL_MTM_CCY_CD:=REC.PAY_UL_MTM_CCY_CD;
    REC_PIPE.PAY_UL_SEC_CCY_CD:=REC.PAY_UL_SEC_CCY_CD;
    REC_PIPE.PAY_UL_SEC_CD:=REC.PAY_UL_SEC_CD;
    REC_PIPE.PCP_TRANSACTION_SK:=REC.PCP_TRANSACTION_SK;
    REC_PIPE.PROD_AREA_UBR_ID:=REC.PROD_AREA_UBR_ID;
    REC_PIPE.QUOTA_PART_AMT:=REC.QUOTA_PART_AMT;
    REC_PIPE.RCV_CONTRACT_AMT:=REC.RCV_CONTRACT_AMT;
    REC_PIPE.RCV_CONTRACT_CCY_CD:=REC.RCV_CONTRACT_CCY_CD;
    REC_PIPE.RCV_FWD_AMT:=REC.RCV_FWD_AMT;
    REC_PIPE.RCV_FWD_CCY_CD:=REC.RCV_FWD_CCY_CD;
    REC_PIPE.RCV_INT_RATE:=REC.RCV_INT_RATE;
    REC_PIPE.RCV_INT_RATE_TYPE_CD:=REC.RCV_INT_RATE_TYPE_CD;
    REC_PIPE.RCV_INT_INTERVAL:=REC.RCV_INT_INTERVAL;
    REC_PIPE.RCV_NEXT_FIX_CPN_DT:=REC.RCV_NEXT_FIX_CPN_DT;
    REC_PIPE.RCV_UL_ISS_CCDB_ID:=REC.RCV_UL_ISS_CCDB_ID;
    REC_PIPE.RCV_UL_MTM_AMT:=REC.RCV_UL_MTM_AMT;
    REC_PIPE.RCV_UL_MTM_CCY_CD:=REC.RCV_UL_MTM_CCY_CD;
    REC_PIPE.RCV_UL_SEC_CCY_CD:=REC.RCV_UL_SEC_CCY_CD;
    REC_PIPE.RCV_UL_SEC_CD:=REC.RCV_UL_SEC_CD;
    REC_PIPE.RCV_UL_SEC_TYPE_CD:=REC.RCV_UL_SEC_TYPE_CD;
    REC_PIPE.REC_SEC_AMT:=REC.REC_SEC_AMT;
    REC_PIPE.REC_SEC_CCY_CD:=REC.REC_SEC_CCY_CD;
    REC_PIPE.REC_UNSEC_AMT:=REC.REC_UNSEC_AMT;
    REC_PIPE.REC_UNSEC_CCY_CD:=REC.REC_UNSEC_CCY_CD;
    REC_PIPE.RECON_CD:=REC.RECON_CD;
    REC_PIPE.RECON_SRC_CD:=REC.RECON_SRC_CD;
    REC_PIPE.RECOV_AMT:=REC.RECOV_AMT;
    REC_PIPE.RECOVERY_FLAG:=REC.RECOVERY_FLAG;
    REC_PIPE.REGULATORY_NET_IND:=REC.REGULATORY_NET_IND;
    REC_PIPE.REL_RISK_PROVISION_AMT:=REC.REL_RISK_PROVISION_AMT;
    REC_PIPE.RESPONSIBLE_BRANCH_CCDB_ID:=REC.RESPONSIBLE_BRANCH_CCDB_ID;
    REC_PIPE.RESPONSIBLE_BRANCH_ID:=REC.RESPONSIBLE_BRANCH_ID;
    REC_PIPE.RESPONSIBLE_BRANCH_LOC_CD:=REC.RESPONSIBLE_BRANCH_LOC_CD;
    REC_PIPE.RESTRUCT_IND:=REC.RESTRUCT_IND;
    REC_PIPE.RISK_END_DT:=REC.RISK_END_DT;
    REC_PIPE.RISK_ENGINES_METHOD_USED:=REC.RISK_ENGINES_METHOD_USED;
    REC_PIPE.RISK_MITIGATING_PCT:=REC.RISK_MITIGATING_PCT;
    REC_PIPE.RISK_PROVISION_BAL_AMT:=REC.RISK_PROVISION_BAL_AMT;
    REC_PIPE.RISK_PROVISION_CCY_CD:=REC.RISK_PROVISION_CCY_CD;
    REC_PIPE.RISK_WRITE_OFF_AMT:=REC.RISK_WRITE_OFF_AMT;
    REC_PIPE.RISK_WRITE_OFF_LIFE_DT_AMT:=REC.RISK_WRITE_OFF_LIFE_DT_AMT;
    REC_PIPE.RT_BUS_AREA_UBR_ID:=REC.RT_BUS_AREA_UBR_ID;
    REC_PIPE.RT_CB_CCDB_ID:=REC.RT_CB_CCDB_ID;
    REC_PIPE.RT_COV_CD:=REC.RT_COV_CD;
    REC_PIPE.RT_COV_SRC_CD:=REC.RT_COV_SRC_CD;
    REC_PIPE.RT_COV_TYPE_CD:=REC.RT_COV_TYPE_CD;
    REC_PIPE.RT_COV_TYPE_CD_IFRS:=REC.RT_COV_TYPE_CD_IFRS;
    REC_PIPE.RT_TYPE_CD:=REC.RT_TYPE_CD;
    REC_PIPE.RT_TYPE_CD_IFRS:=REC.RT_TYPE_CD_IFRS;
    REC_PIPE.SENIORITY:=REC.SENIORITY;
    REC_PIPE.SETTLE_STATUS_ID:=REC.SETTLE_STATUS_ID;
    REC_PIPE.SETTLEMENT_CD:=REC.SETTLEMENT_CD;
    REC_PIPE.SETTLEMENT_DT:=REC.SETTLEMENT_DT;
    REC_PIPE.SOX_REF:=REC.SOX_REF;
    REC_PIPE.SPE_IND:=REC.SPE_IND;
    REC_PIPE.SPL_TREAT_IND_IFRS:=REC.SPL_TREAT_IND_IFRS;
    REC_PIPE.SRC_PROD_TYPE_CD:=REC.SRC_PROD_TYPE_CD;
    REC_PIPE.SRC_PROD_TYPE_CD_IFRS:=REC.SRC_PROD_TYPE_CD_IFRS;
    REC_PIPE.SRC_PROXY_UBR_CD:=REC.SRC_PROXY_UBR_CD;
    REC_PIPE.START_DT:=REC.START_DT;
    REC_PIPE.STRATEGIC_LEND_IND:=REC.STRATEGIC_LEND_IND;
    REC_PIPE.STRIKE_FWD_FUT_PRICE_AMT:=REC.STRIKE_FWD_FUT_PRICE_AMT;
    REC_PIPE.STRIKE_FWD_FUT_PRICE_CCY_CD:=REC.STRIKE_FWD_FUT_PRICE_CCY_CD;
    REC_PIPE.TERMINATION_LOAN_DT:=REC.TERMINATION_LOAN_DT;
    REC_PIPE.TRAD_ASSET_CD_IFRS:=REC.TRAD_ASSET_CD_IFRS;
    REC_PIPE.TRADE_DT:=REC.TRADE_DT;
    REC_PIPE.TRADE_ENTITY_CCDB_ID:=REC.TRADE_ENTITY_CCDB_ID;
    REC_PIPE.TRADE_ENTITY_LOC_CD:=REC.TRADE_ENTITY_LOC_CD;
    REC_PIPE.TRADE_RELATED_IND:=REC.TRADE_RELATED_IND;
    REC_PIPE.TRADE_STATUS:=REC.TRADE_STATUS;
    REC_PIPE.TRADING_ENTITY_LOC_CD:=REC.TRADING_ENTITY_LOC_CD;
    REC_PIPE.TRAN_MATCH_CD:=REC.TRAN_MATCH_CD;
    REC_PIPE.TRN_CD:=REC.TRN_CD;
    REC_PIPE.TRN_LINK_CD:=REC.TRN_LINK_CD;
    REC_PIPE.TRN_SRC_CD:=REC.TRN_SRC_CD;
    REC_PIPE.TRN_TYPE_CD:=REC.TRN_TYPE_CD;
    REC_PIPE.TRN_VERSION:=REC.TRN_VERSION;
    REC_PIPE.UL_DELIVERY_DT:=REC.UL_DELIVERY_DT;
    REC_PIPE.UL_MATURITY_DT:=REC.UL_MATURITY_DT;
    REC_PIPE.UNDLY_ISS_NAME:=REC.UNDLY_ISS_NAME;
    REC_PIPE.UNEARNED_INCOME_CCY_CD:=REC.UNEARNED_INCOME_CCY_CD;
    REC_PIPE.UNEARNED_INCOME_DIS_LOAN_AMT:=REC.UNEARNED_INCOME_DIS_LOAN_AMT;
    REC_PIPE.US_GAAP_POSITION_AGGR:=REC.US_GAAP_POSITION_AGGR;
    REC_PIPE.VALUATION_DT:=REC.VALUATION_DT;
    REC_PIPE.XCHG_CTRY_CD:=REC.XCHG_CTRY_CD;
    REC_PIPE.YEAR01_NOTIONAL_AMT:=REC.YEAR01_NOTIONAL_AMT;
    REC_PIPE.YEAR02_NOTIONAL_AMT:=REC.YEAR02_NOTIONAL_AMT;
    REC_PIPE.YEAR03_NOTIONAL_AMT:=REC.YEAR03_NOTIONAL_AMT;
    REC_PIPE.YEAR04_NOTIONAL_AMT:=REC.YEAR04_NOTIONAL_AMT;
    REC_PIPE.YEAR05_NOTIONAL_AMT:=REC.YEAR05_NOTIONAL_AMT;
    REC_PIPE.YEAR06_NOTIONAL_AMT:=REC.YEAR06_NOTIONAL_AMT;
    REC_PIPE.YEAR07_NOTIONAL_AMT:=REC.YEAR07_NOTIONAL_AMT;
    REC_PIPE.YEAR08_NOTIONAL_AMT:=REC.YEAR08_NOTIONAL_AMT;
    REC_PIPE.YEAR09_NOTIONAL_AMT:=REC.YEAR09_NOTIONAL_AMT;
    REC_PIPE.YEAR10_NOTIONAL_AMT:=REC.YEAR10_NOTIONAL_AMT;
    REC_PIPE.YTD_PL_TRADE_AMT:=REC.YTD_PL_TRADE_AMT;
    REC_PIPE.FCL_VALIDATED_IND:=REC.FCL_VALIDATED_IND;
    REC_PIPE.FCL_EXCLUDED_IND:=REC.FCL_EXCLUDED_IND;
    REC_PIPE.FCL_SOURCE_SYSTEM:=REC.FCL_SOURCE_SYSTEM;
    REC_PIPE.FCL_CREATE_TIMESTAMP:=REC.FCL_CREATE_TIMESTAMP;
    REC_PIPE.FCL_UPDATE_TIMESTAMP:=REC.FCL_UPDATE_TIMESTAMP;
    REC_PIPE.FCL_TRADE_LOAD_DATE:=REC.FCL_TRADE_LOAD_DATE;
    REC_PIPE.FCL_VALUATION_LOAD_DATE:=REC.FCL_VALUATION_LOAD_DATE;
    REC_PIPE.FCL_MATRIX_TRADE_TYPE:=REC.FCL_MATRIX_TRADE_TYPE;
    REC_PIPE.PCP_GCDS_REVISION:=REC.PCP_GCDS_REVISION;
    REC_PIPE.FCL_UTP_BOOK_CD:=REC.FCL_UTP_BOOK_CD;
    REC_PIPE.FCL_MIS_RISK_BOOK_CD:=REC.FCL_MIS_RISK_BOOK_CD;
    REC_PIPE.ALD_STATUS:=REC.ALD_STATUS;
    REC_PIPE.FCAT_OPERATION:=REC.FCAT_OPERATION;
    REC_PIPE.INTERNAL_INTRA_IND_IFRS:=REC.INTERNAL_INTRA_IND_IFRS;
    REC_PIPE.FCL_USAGE_IND:=REC.FCL_USAGE_IND;
    REC_PIPE.QUICK:=REC.QUICK;
    REC_PIPE.SEDOL:=REC.SEDOL;
    REC_PIPE.CUSIP:=REC.CUSIP;
    REC_PIPE.ISIN:=REC.ISIN;
    REC_PIPE.QUANTITY:=REC.QUANTITY;
    REC_PIPE.RIC:=REC.RIC;
    REC_PIPE.DESCRIPTION:=REC.DESCRIPTION;
    REC_PIPE.RESET_DATE:=REC.RESET_DATE;
    REC_PIPE.PRICE:=REC.PRICE;
    REC_PIPE.EXCHANGERATE:=REC.EXCHANGERATE;
    REC_PIPE.PARA_PROD_TYPE_ID:=REC.PARA_PROD_TYPE_ID;
    REC_PIPE.EFF_INT_RATE:=REC.EFF_INT_RATE;
    REC_PIPE.ORIG_FEE_UNREALISED_AMT:=REC.ORIG_FEE_UNREALISED_AMT;
    REC_PIPE.ASSET_TYPE:=REC.ASSET_TYPE;
    REC_PIPE.IMP_IND_IFRS:=REC.IMP_IND_IFRS;
    REC_PIPE.NOT_AMT_REDEMPTION_TO_1YR:=REC.NOT_AMT_REDEMPTION_TO_1YR;
    REC_PIPE.NOT_AMT_REDEMPTION_TO_5YR:=REC.NOT_AMT_REDEMPTION_TO_5YR;
    REC_PIPE.NOT_AMT_REDEMPTION_OVER_5YR:=REC.NOT_AMT_REDEMPTION_OVER_5YR;
    REC_PIPE.CASH_LTD:=REC.CASH_LTD;
    REC_PIPE.CASH_LTD_CCY:=REC.CASH_LTD_CCY;
    REC_PIPE.FCL_FACILITY_SK:=REC.FCL_FACILITY_SK;
    REC_PIPE.DILUTION_RISK_CRITERIA:=REC.DILUTION_RISK_CRITERIA;
    REC_PIPE.FCL_RMS_RUNID:=REC.FCL_RMS_RUNID;
    REC_PIPE.BSTYPE:=REC.BSTYPE;
    REC_PIPE.YTD_ACCR_DIV:=REC.YTD_ACCR_DIV;
    REC_PIPE.YTD_DIV:=REC.YTD_DIV;
    REC_PIPE.ACC_ADJ_YTD:=REC.ACC_ADJ_YTD;
    REC_PIPE.FV_RLZD_PL:=REC.FV_RLZD_PL;
    REC_PIPE.ITD_PL:=REC.ITD_PL;
    REC_PIPE.YTD_RLZD_PL:=REC.YTD_RLZD_PL;
    REC_PIPE.YTD_UNRLZD_PL:=REC.YTD_UNRLZD_PL;
    REC_PIPE.TRN_BAS_LGD:=REC.TRN_BAS_LGD;
    REC_PIPE.TRAD_YTD_RLZD_PL:=REC.TRAD_YTD_RLZD_PL;
    REC_PIPE.TRAD_YTD_UNRLZD_PL:=REC.TRAD_YTD_UNRLZD_PL;
    REC_PIPE.UNADJUSTED_PV:=REC.UNADJUSTED_PV;
    REC_PIPE.UNADJUSTED_REALISED_PL:=REC.UNADJUSTED_REALISED_PL;
    REC_PIPE.UNADJUSTED_UNREALISED_PL:=REC.UNADJUSTED_UNREALISED_PL;
    REC_PIPE.GRC_PROD_TYPE_ID:=REC.GRC_PROD_TYPE_ID;
    REC_PIPE.GRC_PROD_TYPE_ID_IFRS:=REC.GRC_PROD_TYPE_ID_IFRS;
    REC_PIPE.CUR_FEE:=REC.CUR_FEE;
    REC_PIPE.SEC_IND:=REC.SEC_IND;
    REC_PIPE.INVEST_ASSETS_PORT:=REC.INVEST_ASSETS_PORT;
    REC_PIPE.RISK_PROVISION_START_BAL_AMT:=REC.RISK_PROVISION_START_BAL_AMT;
    REC_PIPE.GEN_RISK_PRV_START_BAL_AMT:=REC.GEN_RISK_PRV_START_BAL_AMT;
    REC_PIPE.GEN_RISK_PROVISION_NEW:=REC.GEN_RISK_PROVISION_NEW;
    REC_PIPE.GEN_RISK_PROVISION_REL:=REC.GEN_RISK_PROVISION_REL;
    REC_PIPE.ACQUIRED_IND:=REC.ACQUIRED_IND;
    REC_PIPE.CRED_NET_MNA:=REC.CRED_NET_MNA;
    REC_PIPE.SEC_IFRS_VUE_ADJ:=REC.SEC_IFRS_VUE_ADJ;
    REC_PIPE.YEAR00_NOTIONAL_AMT:=REC.YEAR00_NOTIONAL_AMT;
    REC_PIPE.MAX_OVERDUE_DAYS:=REC.MAX_OVERDUE_DAYS;
    REC_PIPE.MIS_CD:=REC.MIS_CD;
    REC_PIPE.MULTINAME_POOL_SK:=REC.MULTINAME_POOL_SK;
    REC_PIPE.MULTINAME_CHUNK_REVISION_SK:=REC.MULTINAME_CHUNK_REVISION_SK;
    REC_PIPE.MTRX_CALC_CNTRL_EPE:=REC.MTRX_CALC_CNTRL_EPE;
    REC_PIPE.MTRX_CALC_CNTRL_PFE:=REC.MTRX_CALC_CNTRL_PFE;
    REC_PIPE.FCL_TE_VALIDATED_IND:=REC.FCL_TE_VALIDATED_IND;
    REC_PIPE.PCP_TE_DYNAMIC_KEY:=REC.PCP_TE_DYNAMIC_KEY;
    REC_PIPE.AVG_COST:=REC.AVG_COST;
    REC_PIPE.SEC_LONG_NAME:=REC.SEC_LONG_NAME;
    REC_PIPE.ISS_CTRY_CD:=REC.ISS_CTRY_CD;
    REC_PIPE.RISK_REPORTING_UBR:=REC.RISK_REPORTING_UBR;
    REC_PIPE.RISK_COVERING_BRANCH_CCDB:=REC.RISK_COVERING_BRANCH_CCDB;
    REC_PIPE.CLEARING_STATUS:=REC.CLEARING_STATUS;
    REC_PIPE.FCL_CPTY_SK:=REC.FCL_CPTY_SK;
    REC_PIPE.STRGRP:=REC.STRGRP;
    REC_PIPE.OPEN_ENDED_FLAG:=REC.OPEN_ENDED_FLAG;
    REC_PIPE.AVAILABILITY_IND:=REC.AVAILABILITY_IND;
    REC_PIPE.ESCRW_FLG:=REC.ESCRW_FLG;
    REC_PIPE.ESTABLISHED_RELP_FLG:=REC.ESTABLISHED_RELP_FLG;
    REC_PIPE.GOV_GTY_AMT:=REC.GOV_GTY_AMT;
    REC_PIPE.BUBA_CTRY_ID:=REC.BUBA_CTRY_ID;
    REC_PIPE.GOV_GTY_CTRY_CD:=REC.GOV_GTY_CTRY_CD;
    REC_PIPE.INTERNET_DPST_FLG:=REC.INTERNET_DPST_FLG;
    REC_PIPE.LAST_ACTIVITY_DT:=REC.LAST_ACTIVITY_DT;
    REC_PIPE.NOTICE_PERIOD_QTY:=REC.NOTICE_PERIOD_QTY;
    REC_PIPE.OPR_RELP_FLG:=REC.OPR_RELP_FLG;
    REC_PIPE.SIG_WD_PENALTY_FLG:=REC.SIG_WD_PENALTY_FLG;
    REC_PIPE.TRN_ACT_FLG:=REC.TRN_ACT_FLG;
    PIPE ROW(REC_PIPE);
    END LOOP;
    the Stored procedre returns REC_PIPE.
    I thins this could be not efficient enough...
    What do you think?

  • Problem in writting oracle stored procedure in java

    Hi,
    Can anybody please suggest me how can I access oracle stored procedure in Java.
    Thanks

    please find the examples in the below url.
    http://javaalmanac.com/egs/java.sql/pkg.html

  • Email from oracle stored procedure

    Can any one provide sample code for sending email from oracle stored procedure please.

    What do you mean "clicked on my link" and "login
    page"? It sounds like you're describing a web based
    interface, which would imply that you were using the
    HTTP protocol, not SMTP, and connecting on port 80
    (or 443 if you're using HTTPS). If you want to send
    an email from Oracle, you're going to need access to
    an SMTP server, not a HTTP server.
    JustinSorry. I was trying different things to test it. I put that link in an email just to test if it was valid. I am using the util_smtp package. Have you gotten this to work?

  • Arabic characters from Oracle Stored Procedure

    Hi,
    I am having a problem displaying arabic fields from Oracle Stored Procedure. When viewing the arabic field on the web page, i get the following:
    ÙƒØكد Øاكد غبد افلبٍ افاربش
    I have checked with our Oracle DBAs and we seem to be using the AR8ISO8859P6 (ISO-8859-6). I tried to set the return string encoding to UTF-16 and ISO-8859-6 but still no use.
    What should be done to display it?

    Bashar Abdullah wrote:
    Hi,
    I am having a problem displaying arabic fields from Oracle Stored Procedure. When viewing the arabic field on the web page, i get the following:
    I have checked with our Oracle DBAs and we seem to be using the AR8ISO8859P6 (ISO-8859-6). I tried to set the return string encoding to UTF-16 and ISO-8859-6 but still no use.
    What should be done to display it?The first place I'd ask is the Oracle JDBC forum:
    http://forums.oracle.com/forums/forum.jspa?forumID=99
    Joe

  • Passing XMLType Data into oracle stored procedure using JDBC

    Hi Friends,
    I have requirement where my oracle stored procedure accepts XML file as an input. This XML File is generated in runtime using java, I need to pass that xml file using JDBC to oracle stored procedure. Please let me know the fesibile solution for this problem.
    Following are the environment details
    JDK Version: 1.6
    Oracle: 10g
    Server: Tomcat 6.x
    Thanks in Advance

    user4898687 wrote:
    I have requirement where my oracle stored procedure accepts XML file as an input. This XML File is generated in runtime using java, I need to pass that xml file using JDBC to oracle stored procedure. Please let me know the fesibile solution for this problem.As stated - no.
    A 'file' is a file system entity. There is no way to pass a 'file' anywhere. Not PL/SQL. Not java.
    Now you can pass a file path (a string) in java and to PL/SQL.
    Or you can pass xml data (a string) in java and to PL/SQL. For PL/SQL you could use eithe a varchar2, if the xml is rather small, or a blob/clob.

  • Calling Java programs from Oracle Stored Procedure

    Is it possible to call Java programs from Oracle stored procs? If possible Can this be used to exchange data from other applications? Is there a better method/feature in oracle for doing data exchange with other apps?

    If what you mean by Oracle stored procedures is pl/sql then yes.
    You can create a "wrapper" this way:
    CREATE OR REPLACE FUNCTION xmlXform
    in_mapUrl IN VARCHAR2,
    in_inputUrl IN VARCHAR2
    RETURN VARCHAR2
    AS
    LANGUAGE JAVA NAME
    'com.yourcompany.xml2any.xform(java.lang.String,java.lang.String)
    RETURN java.lang.String';
    Then load the java as:
    loadjava -user youruser/youruserpasswd -resolve -verbose lib/xmlparserv2.jar classes/com/yourcompany/xform.class classes/com/yourcompany/xml2any.class
    The java, given the correct permissions, can do anything java can do including communicate with outside applications.
    Is this the "best" way... depends on what you are trying to accomplish.

  • Errors in calling Oracle stored procedure using java CallableStatement

    Hello,
    I have an oracle stored procedure below, it has been tested in PL/SQL without errors. During testing, in_c_file_type="F"; out_n_seqno_freeformat=120139596 and out_n_seqno_commaseprated is null (empty in value column).
    When I run the program in Eclipse (windows xp), error messages is below: (It stopped at line 'cstme.execute();' )
    Message:ORA-06550: line 1, column 26: PLS-00103: Encountered the symbol "" when expecting one of the following:   . ( ) , * @ % & | = - + < / > at in is mod remainder not   range rem => .. <an exponent (**)> <> or != or ~= >= <= <>   and or like LIKE2_ LIKE4_ LIKEC_ as between from using ||   indicator multiset member SUBMULTISET_ The symbol ", was inserted before "" to continue. Error code:6550 SQL statement:65000 {code} Does anyone know what cause the error? It seems like something is missing in the stored procedure. But the stored procedure passes the test in the PL/SQL. The oracla driver I used is Oracle thin driver. Oracle version is 10.2.g Thanks in advance. northcloud {code} create or replace procedure SP_GET_SEQNO_2( in_c_file_type in char, out_n_seqno_freeformat out integer, out_n_seqno_commaseprated out integer) is n_seqno_commaseprated    integer; n_seqno_freeformat        integer; begin if in_c_file_type ='F' THEN  SELECT message_counter.nextval INTO n_seqno_freeformat FROM dual; insert into temp_stroperations (record_id,OUTPUT_STR,INPROCESS_STR) values (n_seqno_freeformat,empty_clob(),empty_clob()); elsif in_c_file_type ='C' THEN  SELECT message_counter.nextval INTO n_seqno_commaseprated FROM dual; insert into temp_stroperations (record_id,OUTPUT_STR,INPROCESS_STR) values (n_seqno_commaseprated,empty_clob(),empty_clob()); else SELECT message_counter.nextval INTO n_seqno_freeformat FROM dual; insert into temp_stroperations (record_id,OUTPUT_STR,INPROCESS_STR) values (n_seqno_freeformat,empty_clob(),empty_clob()); SELECT message_counter.nextval INTO n_seqno_commaseprated FROM dual; insert into temp_stroperations (record_id,OUTPUT_STR,INPROCESS_STR) values (n_seqno_commaseprated,empty_clob(),empty_clob()); end if; out_n_seqno_freeformat        := n_seqno_freeformat; out_n_seqno_commaseprated    := n_seqno_commaseprated; end SP_GET_SEQNO_2; {code} ----- A part of java code I used to call the stored procedure is here. {code} String escapeString = "{call SP_GET_SEQNO_2 (? ? ?)}"; CallableStatement cstme = null; try { cstme = con.prepareCall(escapeString); cstme.setString(1, "F"); cstme.registerOutParameter(2, java.sql.Types.INTEGER); cstme.registerOutParameter(3, java.sql.Types.INTEGER); cstme.execute(); int seqNoFreeformat=0, seqNocommasepreted=0; seqNoFreeformat = cstme.getInt(2); seqNocommasepreted = cstme.getInt(3); System.out.println ("In ConvertXML.processStoredProcedure(), seqNoFreeformat= "+seqNoFreeformat+";seqNocommasepreted="+seqNocommasepreted); } catch (SQLException e) { //System.out.println ("In ConvertXML.processStoredProcedure(), SQLException: "+e); System.err.println("Message:"+e.getMessage()); System.err.println("Error code:"+e.getErrorCode()); System.err.println("SQL statement:"+e.getSQLState()); log.log(Level.INFO, log.getName() + " - SQLException : "+e); } {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    es5f2000 wrote:
    jschell wrote:
    That works?I dunno. The below definitely works, but like I said, I've only
    ever done it with one output parameter (and that has always
    been a ResultSet).
    String callableQuery = "{?= call my_package.my_call(?, ?)}"
    Yes I have done that and at least in terms of my code it wasn't just a result set.
    But not with two.

  • Pass xmltype to oracle stored procedure

    I need to pass an xmltype from java to an oracle stored procedure. Does anybody have any sample code to do this? I am using jdeveloper 10.1.2
    Thanks
    MM

    Oracle provides several ways of passing objects to and from java to Oracle Stored Procedure.
    One way is to directly create oracle.sql.STRUCT object and pass array of values to this object. Another way is to implement java.sql.SQLData or oracle.sql.ORAData interfaces in your class and pass this class to setObject function.
    It is all well described in manual in chapter "Working with Oracle Object Types", there is also a lot of examples in this chapter and on the web.
    http://download-uk.oracle.com/docs/cd/B19306_01/java.102/b14355/oraoot.htm - Working with Oracle Object Types
    Some of the examples:
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/ObjectOracleSample/Readme.html
    http://javaalmanac.com/egs/java.sql/InsertObjectOraclePreparedStatement.html

  • Not able to retrive the recordset from oracle stored procedure in VC++

    Hi,
    I am trying to retrieve the records from the reference cursor which is an out parameter for an oracle 9i store procedure in VC++ application. But it is giving the record count as -1 always. Meanwhile i am able to get the required output in VB application from the same oracle 9i store procedure .
    Find the code below which i used.
    Thanks,
    Shenba
    //// Oracle Stored Procedure
    <PRE lang=sql>CREATE OR REPLACE
    PROCEDURE GetEmpRS1 (p_recordset1 OUT SYS_REFCURSOR,
    p_recordset2 OUT SYS_REFCURSOR,
    PARAM IN STRING) AS
    BEGIN
    OPEN p_recordset1 FOR
    SELECT RET1
    FROM MYTABLE
    WHERE LOOKUPVALUE > PARAM;
    OPEN p_recordset2 FOR
    SELECT RET2
    FROM MYTABLE
    WHERE LOOKUPVALUE >= PARAM;
    END GetEmpRS1;</PRE>
    ///// VC++ code
    <PRE lang=c++ id=pre1 style="MARGIN-TOP: 0px">ConnectionPtr mpConn;
    _RecordsetPtr pRecordset;
    _CommandPtr pCommand;
    _ParameterPtr pParam1;
    //We will use pParam1 for the sole input parameter.
    //NOTE: We must not append (hence need not create)
    //the REF CURSOR parameters. If your stored proc has
    //normal OUT parameters that are not REF CURSORS, you need
    //to create and append them too. But not the REF CURSOR ones!
    //Hardcoding the value of i/p paramter in this example...
    variantt vt;
    vt.SetString("2");
    m_pConn.CreateInstance (__uuidof (Connection));
    pCommand.CreateInstance (__uuidof (Command));
    //NOTE the "PLSQLRSet=1" part in
    //the connection string. You can either
    //do that or can set the property separately using
    //pCommand->Properties->GetItem("PLSQLRSet")->Value = true;
    //But beware if you are not working with ORACLE, trying to GetItem()
    //a property that does not exist
    //will throw the adErrItemNotFound exception.
    m_pConn->Open (
    bstrt ("Provider=OraOLEDB.Oracle;PLSQLRSet=1;Data Source=XXX"),
    bstrt ("CP"), bstrt ("CP"), adModeUnknown);
    pCommand->ActiveConnection = m_pConn;
    pParam1 = pCommand->CreateParameter( bstrt ("pParam1"),
    adSmallInt,adParamInput, sizeof(int),( VARIANT ) vt);
    pCommand->Parameters->Append(pParam1);
    pRecordset.CreateInstance (__uuidof (Recordset));
    //NOTE: We need to specify the stored procedure name as COMMANDTEXT
    //with proper ODBC escape sequence.
    //If we assign COMMANDTYPE to adCmdStoredProc and COMMANDTEXT
    //to stored procedure name, it will not work in this case.
    //NOTE that in the escape sequence, the number '?'-s correspond to the
    //number of parameters that are NOT REF CURSORS.
    pCommand->CommandText = "{CALL GetEmpRS1(?)}";
    //NOTE the options set for Execute. It did not work with most other
    //combinations. Note that we are using a _RecordsetPtr object
    //to trap the return value of Execute call. That single _RecordsetPtr
    //object will contain ALL the REF CURSOR outputs as adjacent recordsets.
    pRecordset = pCommand->Execute(NULL, NULL,
    adCmdStoredProc | adCmdUnspecified );
    //After this, traverse the pRecordset object to retrieve all
    //the adjacent recordsets. They will be in the order of the
    //REF CURSOR parameters of the stored procedure. In this example,
    //there will be 2 recordsets, as there were 2 REF CURSOR OUT params.
    while( pRecordset !=NULL ) )
    while( !pRecordset->GetadoEOF() )
    //traverse through all the records of current recordset...
    long lngRec = 0;
    pRecordset = pRecordset->NextRecordset((VARIANT *)lngRec);
    //Error handling and cleanup code (like closing recordset/ connection)
    //etc are not shown here.</PRE>

    It can be linked to internal conversion. In some case, the value of internal or extranal value is not the same.
    When you run SE16 (or transaction N), you have in option mode the possibility to use the exit conversion or not.
    Christophe

Maybe you are looking for

  • Interest on Customers

    Dear All I want to calculate Interest on Late payments by Customers. Please tell me the configuration. Whether it is Item Interest Calculation or Interest on Arears Calculation? What is the difference between the two? Thanks & Regards Kanwaljit

  • 11.2.0.2 Grid Installation for a Standalone Server FAILED!

    OS: OEL-5.5 x86_64 (kernel-2.6.18-194.17.4.0.1.el5, glibc-2.5-49.el5_5.7) Product: Oracle 11gR2 (11.2.0.2.0) x86_64 for Linux Hi, I was trying to perform a clean and full 11.2.0.2 installation for a Standalone Server (Single database + ASM + Restart)

  • How to encode 16bpp grey images in Jpeg2000?

    Hi all. First excuse me for my bad English. I have a problem encoding JPEG2000 images. I have an image in a short array and I want to encode and seve it in a jpeg2000 file. I do the next: (iw) is the JPEG2000 image writer. SampleModel model = RasterF

  • TextPane always scroll to the bottom when append text

    How to avoid TextPane (inside scroll pane) to go to the bottom after append or set text. The current way I do is to scroll up again. This causes a noticable blink which I don't like very much. Could someone please point out if there is a setting I ca

  • What is the proper method to access exported functions in a DLL compiled for a CE (Arm) target?

    I have been trying without success to access functions in a DLL that is targetted for Windows CE.  My Labview application target is an Arm-based TouchPanel device. Solved! Go to Solution.