Calling Oracle 10g Stored Proc with Assoc Array from C# VS 2008

I have the following PL/SQL procedure:
CREATE OR REPLACE PROCEDURE HMA_ADM.PRC_VDM_SAVDEL_VEN_DOC
P_OP IN VARCHAR2,
P_USRID IN TB_VDM_MANAGE_DOCUMENTS.CREATEDBY%TYPE,
P_DATE IN VARCHAR2, -- HAS TO BE STRING, ELSE WE GET AN ERROR
P_DOCNAM IN TB_VDM_MANAGE_DOCUMENTS.DOCUMENT_NAME%TYPE,
P_DOCLNK IN TB_VDM_MANAGE_DOCUMENTS.DOCUMENTLINK%TYPE,
P_FNGUID IN TB_VDM_MANAGE_DOCUMENTS.FILENET_GUID%TYPE,
P_DESC IN TB_VDM_MANAGE_DOCUMENTS.DESCRIPTION%TYPE,
P_REQID IN VARR
) IS
Where VARR is:
CREATE OR REPLACE TYPE VARR IS TABLE OF INTEGER;
In C# I have the following code:
int64[] intReqID;
OracleCommand cmdVDL = new OracleCommand(DBQueries.SPQRY_SAVDELVENDOC, connDB);
cmdVDL.CommandType = CommandType.StoredProcedure;
cmdVDL.Parameters.Add(new OracleParameter("P_OP", strOP));
cmdVDL.Parameters.Add(new OracleParameter("P_CREATEBY", strUID));
cmdVDL.Parameters.Add(new OracleParameter("P_CREATEDATE", strDate));
cmdVDL.Parameters.Add(new OracleParameter("P_DOCNAM", strDocNam));
cmdVDL.Parameters.Add(new OracleParameter("P_DOCLNK", strURL));
cmdVDL.Parameters.Add(new OracleParameter("P_FNGUID", strGUID));
cmdVDL.Parameters.Add(new OracleParameter("P_DESC", strDesc));
cmdVDL.Parameters.Add(new OracleParameter("P_REQID", OracleDbType.Int64) {
CollectionType = OracleCollectionType.PLSQLAssociativeArray,
Size = intReqID.Count(),
Value = intReqID,
DbType = DbType.Int64,
OracleDbType = OracleDbType.Int64
OracleParameterStatus[] stat = new OracleParameterStatus[intReqID.Count()];
for (i = 0; i < intReqID.Count(); i++) {
stat[i] = OracleParameterStatus.Success;
cmdVDL.Parameters["P_REQID"].ArrayBindStatus = stat;
cmdVDL.ExecuteNonQuery();
When I run this I get the following error:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'PRC_VDM_SAVDEL_VEN_DOC'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
If I remove the Associative Array from both, the procedure runs fine.
What am I doing wrong?

Additionally,
1) UDT support requires 11106.20 or higher ODP (but can be used against 10g db)
2) if the plsql is changeable, you may want to swap it to associative array instead to avoid having to create custom classes for the UDT, and here's a short sweet example.
Greg
CREATE or replace PACKAGE MYPACK3 AS
TYPE numarray is table of number index by BINARY_INTEGER;
PROCEDURE getempsinarray(thearray IN numarray, numrecs out number);
END MYPACK3;
CREATE or replace PACKAGE BODY MYPACK3 AS
PROCEDURE getempsinarray(thearray IN numarray, numrecs out number)
IS
begin
  numrecs :=  thearray.count;
END getempsinarray;
END MYPACK3;
using System;
using System.Data;
using Oracle.DataAccess.Client;
public class indexby
     public static void Main()
      OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger;");
      con.Open();
      OracleCommand cmd = new OracleCommand("mypack3.getempsinarray", con);
      cmd.CommandType = CommandType.StoredProcedure;
      OracleParameter Param1 = cmd.Parameters.Add("param1", OracleDbType.Int32);
      Param1.Direction = ParameterDirection.Input;
      Param1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
      Param1.Value = new int[3]{7369,7499, 7521};
      Param1.Size = 3;
      OracleParameter Param2 = cmd.Parameters.Add("param2", OracleDbType.Int32, DBNull.Value, ParameterDirection.Output );
     cmd.ExecuteNonQuery();
     Console.WriteLine("{0} records passed in",Param2.Value);               
      con.Close();
}

Similar Messages

  • Example of asp classic using msdaora calling oracle 10g stored proc?

    i just migrated a sql server application to oracle using sql developer workbench. i am having immediate problems of course...
    this example asp code and oracle procedure first complains of wrong number and type of arguments. if i have similar code that i just remove the return parameter then it works but anything that i need an inpurt parameter for doesn't work.
    any assistance most appreciated!
    set sp_portfolio = Server.CreateObject("ADODB.Command")
    sp_portfolio.ActiveConnection = MM_MHR_CONN_STR_STRING
    sp_portfolio.CommandType = 4
    sp_portfolio.CommandTimeout = 0
    sp_portfolio.Prepared = true
    sp_portfolio.CommandText = "PMS.Sp_HPMSQ003_Get_Portfolio"
    sp_portfolio.Parameters.Append sp_portfolio.CreateParameter("IP_PMSPF_ID", 200, 1,10,sp_portfolio__P_PMSPF_ID)
    sp_portfolio.Parameters.Append sp_portfolio.CreateParameter("rs", 200, 2, 10000)
    set rst_Portfolio = sp_portfolio.Execute
    CREATE OR REPLACE PROCEDURE "SP_HPMSQ005_GET_PROJECTS"
    v_P_PMSPF_ID IN NUMBER DEFAULT NULL ,
    v_P_START_DT IN varchar2 DEFAULT NULL ,
    cv_1 IN OUT SYS_REFCURSOR
    AS
    BEGIN
    OPEN cv_1 FOR
    select P.*, TO_CHAR(PMSPT_PLND_REL_DT, 'YYYY') || ' ' || TO_CHAR(PMSPT_PLND_REL_DT, 'MM') Combodate,
    TO_CHAR(PMSPT_PLND_REL_DT, 'MM') RelMnth, TO_CHAR(PMSPT_PLND_REL_DT, 'YYYY') RelYear,
    S.PMSPS_IMGPTH_TXT, S.PMSPS_DESC_TXT
    From TPMSPT_PROJECT P, TPMSPP_PORTFOLIO_PROJECT F, TPMSPS_PROJECT_STATUS S
    Where F.PMSPF_ID = v_P_PMSPF_ID
    and P.PMSPT_ID = F.PMSPT_ID
    and S.PMSPS_CD = P.PMSPS_CD
    and P.PMSPT_PLND_REL_DT >= TO_DATE(ltrim(rtrim(v_P_START_DT)), 'yyyy.mm.dd')
    Order by P.PMSPT_PLND_REL_DT, UPPER(P.PMSPT_SNAM_TXT);
    END;

    Hi,
    If all the data and tables involved have been successfully migrated into Oralce then your best option will be to try one of the forums that can help with ASP or MSDAORA. They will be in a better postion to help with problems using these products and diagnosing the cause.
    If it then turns out it was caused by a SQL*Developer migration problem then we can investigate that further.
    Regards,
    Mike

  • Multiple threads calling the same stored proc with different parameters

    Hi,
    I have a stored procedure which will be called by 8 threads. Every time it takes in a different parameter.
    Actual execution time for this proc (irrespective of the parameter) is around 2 seconds. But when I call the 8 threads, I see that the total time taken (END TO END) is around 16 seconds. Threads do acquire a read lock right? Is there a way i can get over this issue?
    Please let me know.

    Sybase IQ is the database. I am using a thread pool. The time taken to execute this procedure without threads is about 2 seconds. It takes 16 seconds when I start using threads.
    I do something like this :
    ///////////////////////// databaseThreadPool.java
    * example of a fixed-size thread pool using the
    * executors introduced in Java 5
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
    public class databaseThreadPool
    public static void main(String[] args)
    * create a thread pool with four threads
    ExecutorService execSvc = Executors.newFixedThreadPool( 8);
    * place six tasks in the work queue for the thread pool
    for( int i = 0; i < 6; i++ )
    execSvc.execute( new CountDown() );
         long a =System.currentTimeMillis();
    execSvc.execute( new databaseThread("00055","YTD","GROSS") );
    execSvc.execute( new databaseThread("00055","YTD","NET") );
    execSvc.execute( new databaseThread("00055","YTM","GROSS") );
    execSvc.execute( new databaseThread("00055","YTM","NET") );
    execSvc.execute( new databaseThread("00055","LY","GROSS") );
    execSvc.execute( new databaseThread("00055","LY","NET") );
    execSvc.execute( new databaseThread("00055","LLY","GROSS") );
    execSvc.execute( new databaseThread("00055","LLY","NET") );
         long b =System.currentTimeMillis();
         try{
         while(databaseThread.done!=8)
              Thread.sleep(1000);
         catch(Exception ex){}
    execSvc.shutdown();
    System.out.println("END TO END TIME TAKEN : "+(b-a));
    /////////////////////////////////////////////////////////// databaseThread.java
    import java.io.PrintWriter;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.Statement;
    import java.io.PrintWriter;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.io.IOException;
    public class databaseThread implements Runnable
    protected int count = 8;
    * the following counter is incremented once
    * each time the class is instantiated, giving each
    * instance a unique number, which is printed in run()
    private static int taskCount = 0;
    private final int id = taskCount++;
    private String gpNum;
    private String time;
    private String domain;
    public static int i=0;
    public static int done=0;
    PrintWriter out = null;
    Connection connection = null;
    Statement statement;
    ResultSet rs;
    ResultSetMetaData rsmd;
         CallableStatement cStmt = null;
    public databaseThread(String gpNum, String time, String domain) {
    this.gpNum=gpNum;
    this.time=time;
    this.domain=domain;
    * print the id and the iteration count to the console, then
    * yield to another thread.
    public void run()
         try
         Class.forName("com.sybase.jdbc3.jdbc.SybDriver");
         connection = DriverManager.getConnection("jdbc:sybase:Tds:XXXXXXXXXXX:XXXXXXX", "cp_dbo","cp_dbo");
         statement = connection.createStatement();
              cStmt=connection.prepareCall("{call XXXXXX ?,?,?)}");
              cStmt.setString(1,gpNum);
              cStmt.setString(2, time);
              cStmt.setString(3,domain);
              long a =System.currentTimeMillis();
              rs=cStmt.executeQuery();
              long b=System.currentTimeMillis();
              System.out.println(id+" Time taken by to execute Query : "+(b-a));
         //rsmd=rs.getMetaData();
              while(rs.next())
              Thread.yield();
         catch (ClassNotFoundException e) {
              System.out.println("Driver Error" );
              e.printStackTrace();
              } catch (SQLException e) {
              System.out.println("SQLException: " + e.getMessage());
    }

  • Error in calling Oracle AMG stored proc

    Oracle FIn version - 11.2.0
    Oracle client version - 9.2.0
    Hi,
    I’m trying to do an Oracle AMG call setGlobalInfo from VBScript. This call fails with the following error message. Please let me know how I could fix this.
    SetGlobalInfo: Return MsgData = FND FND_AS_UNEXPECTED_ERROR N PKG_NAME PA_INTERFACE_UTILS_PUB N PROCEDURE_NAME Set_Global_Info N ERROR_TEXT ORA-20001: Oracle error -20001: ORA-20001: Error occurred during product initialization for MO when executing 'begin MO_GLOBAL.INIT; end;'.
    SQLCODE = -20001
    SQLERROR = ORA-20001: SQL_PLSQL_ERROR: N, ROUTINE, MO_GLOBAL.INIT, N, ERRNO, -2000
    SetGlobalInfo: Return MsgCount = 1
    SetGlobalInfo: Return Status = U
    Thanks in advance,
    Raju

    Oracle FIn version - 11.2.0
    Oracle client version - 9.2.0
    Hi,
    I’m trying to do an Oracle AMG call setGlobalInfo from VBScript. This call fails with the following error message. Please let me know how I could fix this.
    SetGlobalInfo: Return MsgData = FND FND_AS_UNEXPECTED_ERROR N PKG_NAME PA_INTERFACE_UTILS_PUB N PROCEDURE_NAME Set_Global_Info N ERROR_TEXT ORA-20001: Oracle error -20001: ORA-20001: Error occurred during product initialization for MO when executing 'begin MO_GLOBAL.INIT; end;'.
    SQLCODE = -20001
    SQLERROR = ORA-20001: SQL_PLSQL_ERROR: N, ROUTINE, MO_GLOBAL.INIT, N, ERRNO, -2000
    SetGlobalInfo: Return MsgCount = 1
    SetGlobalInfo: Return Status = U
    Thanks in advance,
    Raju

  • Oracle 10g R2 installation with ASM+RAC

    Gurus,
    Need some suggestuon on Oracle 10g R2 installation with ASM and RAC option.
    We have found many documents on the Oracle, HP, HP-Oracle CTC and third party web sites, but nothing that is specific to this particular combination of separate
    ORACLE_HOMEs, ASM and 10g RAC CRS. It is unclear for me from the documentation how this combination of ASM and 10.2g RAC may best be installed.
    The high level steps i got after reading lot of docs as follows - but i am not sure whether these are correct or not. if they are correct, can any one share their experience/notes please?
    1) Install CRS
    2) Install RDBMS for ASM HOME - create separater oracle home for ASM instance using OUI
    3) Install RDBMS for RAC Database Home - create separater oracle home for RAC database using OUI
    4) Create ASM database using DBCA -
    5) Use dbca to create database.

    Oracle provides 'paint by numbers' tutorials called 'Oracle By Example'. (Go to OTN, check under the Training tab)
    They have one for a Windows based ASM/RAC that you might want to review. Not your specific environment, but the steps will be dag-nabbed close.
    I recommend walking the path (http://otn.oracle.com >> training:OBE >> Database 10g Release 1:VMWare:Installation
    http://www.oracle.com/technology/obe/obe10gdb_vmware/install/racinstallwin2k/racinstallwin2k.htm

  • Calling a Stored Procedure with output parameters from Query Templates

    This is same problem which Shalaka Khandekar logged earlier. This new thread gives the complete description about our problem. Please go through this problem and suggest us a feasible solution.
    We encountered a problem while calling a stored procedure from MII Query Template as follows-
    1. Stored Procedure is defined in a package. Procedure takes the below inputs and outputs.
    a) Input1 - CLOB
    b) Input2 - CLOB
    c) Input3 - CLOB
    d) Output1 - CLOB
    e) Output2 - CLOB
    f) Output3 - Varchar2
    2. There are two ways to get the output back.
    a) Using a Stored Procedure by declaring necessary OUT parameters.
    b) Using a Function which returns a single value.
    3. Consider we are using method 2-a. To call a Stored Procedure with OUT parameters from the Query Template we need to declare variables of
    corresponding types and pass them to the Stored Procedure along with the necessary input parameters.
    4. This method is not a solution to get output because we cannot declare variables of some type(CLOB, Varchar2) in Query Template.
    5. Even though we are successful (step 4) in declaring the OUT variables in Query Template and passed it successfully to the procedure, but our procedure contains outputs which are of type CLOB. It means we are going to get data which is more than VARCHAR2 length which query template cannot return(Limit is 32767
    characters)
    6. So the method 2-a is ruled out.
    7. Now consider method 2-b. Function returns only one value, but we have 3 different OUT values. Assume that we have appended them using a separator. This value is going to be more than 32767 characters which is again a problem with the query template(refer to point 5). So option 2-b is also ruled out.
    Apart from above mentioned methods there is a work around. It is to create a temporary table in the database with above 3 OUT parameters along with a session specific column. We insert the output which we got from the procedure to the temporary table and use it further. As soon the usage of the data is completed we delete the current session specific data. So indirectly we call the table as a Session Table. This solution increases unnecessary load on the database.
    Thanks in Advance.
    Rajesh

    Rajesh,
    please check if this following proposal could serve you.
    Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
    Here is an example how this could be defined.
    Package:
    type return_cur IS ref CURSOR;
    Procedure:
    PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
    OPEN myReturnCur FOR SELECT val1, val2, val3  FROM dual;
    Query:
    DECLARE
      MYRETURNCUR myPackage.return_cur;
    BEGIN
      myPackage.myProc(
        MYRETURNCUR => ?
    END;
    Good luck.
    Michael

  • Calling a COBOL stored proc from Java Servlet

    I am trying to call a COBOL stored proc from a Java Servlet. The stored proc is stored on a DB2 database. I need to send 6 inputs to the COBOL stored proc and the output will be the return code of the stored proc. I'm not sure if I'm going about this the right way. This is how my code looks...
    public int callStoredProc(CallableStatement cstmt,
    Connection con,
    String sYear,
    String sReportNbr,
    String sSystemCode,
    String sUserId,
    String sModuleNbr,
    String sFormId){
    int iParm1 = 0;
    try{
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(ClassNotFoundException ex){
    System.out.println("Failed to locate database driver: "
    + ex.toString());
    return iParm1;
    try{
    cstmt = con.prepareCall("{? = CALL MKTPZ90C
    cstmt.registerOutParameter(1, Types.INTEGER);
    cstmt.setString(2, sYear);
    cstmt.setString(3, sReportNbr);
    cstmt.setString(4, sSystemCode);
    cstmt.setString(5, sUserId);
    cstmt.setString(6, sModuleNbr);
    cstmt.setString(7, sFormId);
    cstmt.execute();
    iParm1 = cstmt.getInt(1);
    CloseSQLStatement(cstmt);
    catch(SQLException ex) {
    CloseSQLStatement(cstmt);
    System.out.println("SQL exception occurred:" +
    ex.toString());
    return iParm1;
    return iParm1;
    Could someone tell me if this is the right way to go about doing this?
    Thanks!!!!!!

    I didn't see the code where you create the database connection (variable "con"). However, the answer to your question "Is this the right way...", for me, is "Anything that works is the right way." So try it. That's a first approximation, but once you have something that works you can start on improving it, if that becomes necessary.

  • Stored Proc with SSRS multi value parameter gives " Must Declare scalar Varaiable @StateID

    Hi All,
    I have one stored proc with @fromDate , @Todate and multivalue input
    parameter@StateID of type integer.
    When I run below stored proc via SSRS by selecting multiple values thru multiValue parameter into @StateID...it gives error saying "Must Declare scalar variable @StateID"
    Not sure what is wrong with the input parameters.
    ID is Integer type in all the 3 tables - dbo.EastCities, dbo.WestCities  , dbo.Country
    I need help fixing this  "Must Declare scalar variable @StateID" error
    This is the UDF split() I am using..
    Function:
    CREATE FUNCTION dbo.SplitStateID
    (    @List VARCHAR(MAX))
    RETURNS TABLE
    AS   
    RETURN   
    (        SELECT DISTINCT [Value] = CONVERT(INT, LTRIM(RTRIM(CONVERT( VARCHAR(12),SUBSTRING(@List, Number, CHARINDEX(',', @List + ',', Number) - Number))))
     FROM  dbo.Numbers       
     WHERE Number <= CONVERT(INT, LEN(@List))AND SUBSTRING(',' + @List, Number, 1) = ','    );
     GO
     SELECT [Value] FROM dbo.SplitStateID('10,30,50');
    Also, I have created dbo.Numbers table which is used in udf..
    reference url -- > 
    http://sqlblog.com/blogs/aaron_bertrand/archive/2009/08/01/processing-a-list-of-integers-my-approach.aspx
    SET NOCOUNT ON;
    DECLARE @UpperLimit INT;
    SET @UpperLimit = 10000;
    WITH n AS(   
    SELECT        rn = ROW_NUMBER() OVER        (ORDER BY s1.[object_id])   
    FROM sys.objects AS s1   
    CROSS JOIN sys.objects AS s2   
    CROSS JOIN sys.objects AS s3)
    SELECT [Number] = rn - 1
    INTO dbo.Numbers FROM n
    WHERE rn <= @UpperLimit + 1;
    CREATE UNIQUE CLUSTERED INDEX n ON dbo.Numbers([Number]);
    Stored procedure:
    Create Procedure dbo.CountrySelection
    ( @FromDate Date, @ToDate Date, @StateID Int)
    AS
    BEGIN
    set nocount on;
    SELECT * INTO #EastCities
    FROM (
    SELECT ID,Description from dbo.EastCities
    Where ID IN (SELECT Value from dbo.SplitStateID(@StateID))
    ) AS A
    SELECT * INTO #WestCities
    FROM (
    SELECT ID,Description from dbo.WestCities
    Where ID IN (SELECT Value from dbo.SplitStateID(@StateID))
    ) AS B
    SELECT * INTO #Country
    FROM (
    SELECT ID , Description, State,Country From dbo.Country
    ) AS C
    SELECT EC.ID AS East, WC.ID AS West , EC.Description AS EastDesc, WC.Description AS WestDesc, CT.State, CT.Country
    FROM #Country CT
    LEFT JOIN #EastCities EC ON CT.ID=EC.ID
    LEFT JOIN #WestCities WC ON CT.ID=WC.ID
    DROP TABLE #EastCities
    DROP TABLE #WestCities
    DROP TABLE #Country
    END
    Above 3 temp tables are joined by #Country.ID key
    It works fine when single value is passed in @StateID
    Exec dbo.CountrySelection '01/01/2010','02/01/2010',10
    It fails when multi value passed into @StateID
    Exec dbo.CountrySelection '01/01/2010','02/01/2010','10,30,40'
    SSRS error log shows "Must declare scalar variable @StateID"
    Need help in fixing this issue.
    Thanks,
    RH
    sql

    Visakh,
    I changed @StateID date type to varchar(max) and still I get this error.  
    System.Data.SqlClient.SqlException: Must declare the scalar variable "@StateID".
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
    I am running this SO in SSRS quert Type =Text
    Actually sp created on db2 database and due to some limitations I am running(via SSRS) this from different db1 database data source within the same db server. When I run this sp from SSRS query designer(edit query designer button) and pass
    multivalue parameters to @StateID as 10 , 20 it works and gives expected resultset.
    Thanks,
    RH
    sql

  • Can we call a Java Stored Proc from a PL/SQL stored Proc?

    Hello!
    Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
    If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
    Thank you!

    For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE Ref_Cursor_t IS REF CURSOR;
    FUNCTION get_good_ids RETURN VARCHAR2 ;
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    FUNCTION get_good_ids RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'MyServer.getGoodIds() return java.lang.String';
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
    IS table_cursor Ref_Cursor_t;
    good_ids VARCHAR2(100);
    BEGIN
    good_ids := get_good_ids();
    OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' &#0124; &#0124; good_ids &#0124; &#0124; ')';
    RETURN table_cursor;
    END;
    END MyPackage;
    public class MyServer{
    public static String getGoodIds() throws SQLException {
    return "1, 3, 6 ";
    null

  • After upgradation from Oracle 9i to Oracle 10g,one proc is throwing error

    recently upgraded from Oracle 9i to Oracle 10g. We have some Oracle procedures which are not working in Oracle 10g.
    A section of code from one of the procedures looks somewhat like the code below:
    Declare
    Cursor c_matched_records (…..) is
    Select a.field 1, b.field2
    From table1 a, table2 b
    Where a.field3=b.field1
    FOR UPDATE;
    BEGIN
    For records in c_matched_records
    LOOP
    -- Continue processing
    -- Update records
    COMMIT;
    END LOOP;
    END;This section of the code throws out the following error in Oracle 10g
    ORA-01002: fetch out of sequence during PUT outputFile file
    However this code was working fine in Oracle 9i.
    please help me with this?
    Thanks

    I believe you are lucky that the pl/sql is okay in Oracle 9i. How about remove the commit statement? Why do you need it in the loop. I look up metalink. You may refer to article ID 257914.1

  • BPC5.1 - Data manager package to Stored proc with custom return codes

    Hi all,
    Does anyone have experience passing the return codes from a stored procedure back into the eData "view status" package progress or event log details?
    When my stored procedure throws errors, the offending SQL code shows up in the pacakge details, which is helpful. But what I'd really like is to structure my stored proc with return codes
    0 = everything's wonderful
    1 = invalid category / time combination
    2 = unauthorized
    3 = no data to process
    And then handle these codes as either "completed" "warning" or "error" in the package progress.
    And ideally, I'd like to put some meaningful message about the warnings & errors, directly into the log details, so the user can fix the problem themselves rather than ask the IT guy to trouble-shoot.
    Any tips? I've started playing with using the on-complete, on-success, on-failure routing of different tasks within the DTSX package (SQL 2005), but I'm just working on a trial-and-error basis right now. (With # of errors = # of trials.)
    Thanks,
    Tim

    In case anyone's interested, I've solved this by tracking my return codes as a package variable.
    Within the package, I have conditional logic moving from task to task, evaluating the return code to check for various conditions, and selecting which tasks to perform accordingly.
    In the last task, I run a final stored procedure which posts some data (completion time & status) to a custom transaction log table, and then if the return code is not zero, I script and execute some SQL which I know will throw a "fake" error. The SQL statement itself includes the key information I want the end user to see. For example
    Select InvalidEntitySelection [USEast1],TransactionID [12340]  from ThisTableDoesntExist
    Select UnauthorizedUser [Tim], TransactionID [12345] from ThisTableDoesntExist
    Select WorkStatusIsLocked [USEast1 Actual 2008], TransactionID [12345] from ThisTableDoesntExist
    It's not exactly elegant, but it gets the message across, which is all that I need. In this way, the end user sees that the package failed with an error, and when they look at the package details, they can see the problem. They can pass on the transaction ID to an administrator to look into the details, if they can't figure it out on their own.
    Sorin, I never managed to figure out how to use a VB task to send the information back to the user, plus force the package to end in an error. I'm sure there's a way to do so, but this seems to work for my requirement.
    I'm not entirely happy with the "fake error" approach, but I don't know if BPC has any support for "intentional" programming of errors in the DTS scripting toolset.
    Thanks,
    Tim

  • Creating a Oracle 10g stored procedure as a datasource for  crystal 9 repor

    Can someone direct me to instructions or information on how to create a Oracle 10g stored procedure as a datasource for  my Crystal  Reports 9.0  report?

    i've found this example for you
    http://www.pdssoftware.com/newsletter/mar07/page6.htm
    and you could be able to get the guides from the SAP guide website for the products
    http://help.sap.com/businessobject/product_guides/
    hope this was helpful
    good luck
    Amr

  • Any one use java call oracle ERP stored procdure

    Hi,
    Any one use java call oracle ERP stored procdure?
    Example I want ues java call below stored, it can work , but in Oracle ERP have error : "APP-MRP-22130: Cannot connect to database
    Cause: The current routine cannot connect to the database.
    Action: Contact your system administrator or customer support representative.
    CREATE OR REPLACE procedure XXBOM_ITEM_IMPORT
    is
    x number;
    begin
    fnd_global.apps_initialize
    (1070, /*i_user_id*/
    20634, /*i_responsibility_id*/
    401 /*i_application_id*/
    /* import item */
    x := fnd_request.submit_request(
    application => 'INV',
    program => 'INCOIN',
    argument1 => 141,
    argument2 => 1,
    argument3 => 1,
    argument4 => 1,
    argument5 => 1
    end;

    Note 164701.1 in metalink may be relevant.

  • Call a Graphical Calc view with input Parameters from a Script Based Calc View

    Hi All.
    I am trying to call a graphical calculation view with input parameters from a script based calculation view as below but getting syntax error:
    SESSION_SAMPLE = SELECT SESSION_CREATE_DATE,SHA256,CA_MEASURE
                                 FROM "_SYS_BIC"."WILDFIRE/CV_SESSION_SAMPLE"
                                 WITH PARAMETERS  ('PLACEHOLDER' = ('$$IP_START_DATE$$',:START_DATE),
                                     'PLACEHOLDER' = ('$$IP_END_DATE$$',:END_DATE));
    START_DATE  and END_DATE are input parameters of the script based calculation view.
    Can anyone please help me with the correct syntax for accomplishing this?
    Thanks,
    Goutham

    Hi Gautham,
    One more option  what i would like you to try is the below option , here i have just changed the order of passing nothing else.
    SESSION_SAMPLE = SELECT SESSION_CREATE_DATE,SHA256,CA_MEASURE
                                 FROM "_SYS_BIC"."WILDFIRE/CV_SESSION_SAMPLE"
                                   ('PLACEHOLDER' = ('$$IP_END_DATE$$','$$END_DATE$$'),
                                  'PLACEHOLDER' = ('$$IP_START_DATE$$','$$START_DATE$$'))
    Regards,
    Vinoth

  • Calling Oracle Stored procedure with OUT parameter from ODI

    Hi,
    I called an oracle stored procedure with following anonymous block in the ODI procedure.
    Declare
    Status varchar2(10);
    Begin
    OTM.DeleteTarget('E_KPI_TARGET_VALUE', Status);
    End;
    I want to capture the OUT parameter STATUS value in a project level variable.
    And based on its va;lue I would like to choose between 2 interfaces in my package.
    Please help me in doing this.

    Hi,
    For that kind of situation I commoly use:
    1) one step with:
    create or replace package <%=odiRef.getSchemaName("W")%>.pck_var
    Status varchar2(10);
    end;
    * transaction 9, for instance
    2) step
    Begin
    OTM.DeleteTarget('E_KPI_TARGET_VALUE', <%=odiRef.getSchemaName("W")%>.pck_var.Status);
    End;
    * transaction 9
    3) then, at an ODI variable, use a refresh like:
    select <%=odiRef.getSchemaName("W")%>.pck_var.Status from dual
    at same logical shema where the package was created.
    Does it make sense to you?

Maybe you are looking for

  • Cannot retrieve email from Mail account on iCloud

    SInce Tuesday, Sept 11th I have been unable to retrieve my messages on my iCloud mail account.  Mail doesn't work on my MacBook Pro or any of my devices (iphone or ipad).  When I try to log on to iCloud I can see my calendar and contacts, however I c

  • The original music file cannot be found

    Music that is clearly in my iTunes library, and will play from there, shows in the media window of iMovie but, when selected, returns the warning that the original file cannot be found. I have cloud music or whatever it is called. Any ideas?

  • Free circular gauge control

    Download: http://www.beaugauge.com/download/en/free/BeauGaugeActiveXControls.zip Use circular gauge ActiveX control in your LavView project http://www.beaugauge.com/en/edu036.htm For additional resources, please visit the website. http://www.beaugaug

  • Flash Slide Presentation...how to control volume?

    Hello, I am working in Flash Slide Presentation mode. I have a started a sound file playing on the "master" slide and I want it to play throughout my entire presentation. However, on a couple of slides, I want to play some short voice clips. How can

  • Error in SMTP configuration

    Hi all, I am having problem regarding SMTP config. The error in SOST is occured whenever i am sending mail through a report program . the long text of error message is as follows: <b>Cannot process message in SAP System</b> Message no. XS817 <b>Diagn