Stored Procedures

I am having trouble finding documentation on calling stored database procedure from within a program unit in Oracle Forms 6i. Anyone know how to do this or where I can find documentation that outlines how to do it?

Hi,
In a nutshell, given any required grants and synonyms for the the DB procedure you can call it as you would do normally from another procedure.
There is information if you look in the form builder help for the topic "Invoking a Stored Program"
What problem are you encountering?

Similar Messages

  • Get variable values from a stored procedure

    I am using SQL 2008R2 and I want to replace a view inside a stored procedure with a new stored procedure to return multiple variable values. Currently I am using the code below to get values for 4 different variables.  I would rather get the 4 variables
    from a stored procedure (which returns all of these 4 values and more) but not sure how to do so.  Below is the code for getting the 4 variable values in my current sp.
    DECLARE @TotalCarb real;
    DECLARE @TotalPro real;
    DECLARE @TotalFat real;
    DECLARE @TotalLiquid real;
    SELECT @TotalCarb = ISNULL(TotCarb,0),
    @TotalPro = ISNULL(TotPro,0),
    @TotalFat = ISNULL(TotFat,0),
    @TotalLiquid = ISNULL(TotLiq,0)
    FROM dbo.vw_ActualFoodTotals
    WHERE (MealID = @MealID);

    You can replace the view with inline table valued user-defined function:
    http://www.sqlusa.com/bestpractices/training/scripts/userdefinedfunction/
    See example: SQL create  INLINE table-valued function like a parametrized view
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Pointbase : How can I create a stored procedure with Pointbase database?

    Hello,
    Excuse me for my english, I'm not anglophone. I try to create a stored procedure.
    This is my file SampleExternalMethods.java :
      import java.sql.*;    //import com.pointbase.jdbc.jdbcInOutDoubleWrapper;          public class SampleExternalMethods    {      // A connection object to allow database callback      static Connection conn = null;      static Statement l_stmt;      static Statement m_stmt;      static CallableStatement m_callStmt = null;      static ResultSet l_rs = null;          public static void main(String[] args)      {        try        {          String url = "jdbc:pointbase:server://localhost/pointbaseDB";          String username = "PBPUBLIC";          String password = "PBPUBLIC";          conn = DriverManager.getConnection(url, username, password);          doCreateProcedure();          doInvokeProcedure();        } catch (SQLException e) {          e.printStackTrace();        } finally {          if (m_stmt != null) {            try {              m_stmt.close();            } catch (Exception e) {              e.printStackTrace();            }          }          if (m_callStmt != null) {            try {              m_callStmt.close();            } catch (Exception e) {              e.printStackTrace();            }          }          if (conn != null) {            try {              conn.close();            } catch (Exception e) {              e.printStackTrace();            }          }        }      }                  public static void getCountry(String Iso_Code)      {        try        {          // Query the database for the country iso code          l_stmt = conn.createStatement();          l_rs = l_stmt.executeQuery( "SELECT * FROM countries"          + " WHERE country_iso_code ='" + Iso_Code + "'");          //Affichage du résultat de la requête          l_rs.next();          System.out.print(l_rs.getString(1) + " - ");          System.out.print(l_rs.getString(2) + " - ");          System.out.println(l_rs.getString(3));          // Close the result set          l_rs.close();        } catch (SQLException e) {          e.printStackTrace();        } finally {          if (l_rs != null) {            try {              l_rs.close();            } catch (Exception e) {              e.printStackTrace();            }          }          if (l_stmt != null) {            try {              l_stmt.close();            } catch (Exception e) {              e.printStackTrace();            }          }        }      }            public static void doCreateProcedure() throws SQLException {        // SQL statement to create a stored procedure        String SQL_CREATE_PROC = "CREATE PROCEDURE getCountry(IN P1 VARCHAR(30))"        + " LANGUAGE JAVA"        + " SPECIFIC getCountry"        + " NO SQL"        + " EXTERNAL NAME \"SampleExternalMethods::getCountry\""        + " PARAMETER STYLE SQL";        // Create a SQL statement        m_stmt = conn.createStatement();        // Execute the SQL        m_stmt.executeUpdate(SQL_CREATE_PROC);        // Close the statement        //m_stmt.close();      }          public static void doInvokeProcedure() throws SQLException {        // Create SQL to invoke stored procedures        String SQL_USE_PROC = "{ call getCountry(?) }";        // Create a callable statement with three binding parameters        m_callStmt = conn.prepareCall(SQL_USE_PROC);        m_callStmt.setString(1, "CA");        m_callStmt.executeQuery();        // Close the callable statement        //m_callStmt.close();      }    } 
    Afterwards, I have read this note in a Pointbase document:
    To invoke the dateConvert external Java method from a stored function, you must use the
    CREATE FUNCTION statement. The dateConvert external Java method is called from the
    class, SampleExternalMethods.
    In order for the database to access this external Java method, the class SampleExternalMethods
    must be included in the database CLASSPATH. For PointBase Embedded - Server Option, it
    must be in the Server CLASSPATH, but not in the Client CLASSPATH.
    If PointBase Server is run with the Java Security Manager, in the java policy file grant
    ’com.pointbase.sp.spPermission’ to the class that implements the external Java method.
    An "spPermission" consists of a class name with no action. The class name is a name of a class
    that could be used in creating a Stored Procedure in PointBase. The naming convention follows
    the hierarchical property naming convention and that is supported by
    "java.security.BasicPermission". An asterisk may appear by itself, or if immediately preceded
    by ".", may appear at the end of the name, to signify a wildcard match. The name cannot
    contain any white spaces.
    I'm not sure, but I suppose that I must include the class SampleExternalMethods in a .jar file.
    The database CLASSPATH could be : C:\Sun\AppServer\pointbase\lib\
    These my files in this database CLASSPATH:
    pbclient.jar
    pbembedded.jar
    pbtools.jar
    pbupgrade.jar
    I have tryed to include the class SampleExternalMethods in pbclient.jar and pbembedded.jar with this command:
    jar -uf pbembedded.jar SampleExternalMethods
    Afterwards I do that,
    1) Start Pointbase
    2) Configuration of classpath
    set classpath=C:\Sun\AppServer\pointbase\lib\pbclient.jar
    set classpath=%classpath%;D:\J2EE\Ch07Code\Ch07_06
    I precise that my file SampleExternalMethods is into D:\J2EE\Ch07Code\Ch07_06\Ch07.
    Then, I run the program:
    D:\J2EE\Ch07Code\Ch07_06>java -Djdbc.drivers=com.pointbase.jdbc.jdbcUniversalDriver Ch07.SampleExternalMethods
    But I have an error message:
    Exception in thread "main" java.lang.NoClassDefFoundError: Ch07.SampleExternalMethods (wrong name: SampleExternalMethods)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.DefineClass(ClassLoader.java:539)
    The problem, I suppose, comes from that the class SampleExternalMethods
    must be included in the database CLASSPATH, but there is a pbserver.jar with pointbase normally, but I didn't find it. That's why I use pbembedded.jar or pbclient.jar in order to include the class SampleExternalMethods. May be I must start from C:\Sun\AppServer\pointbase\lib\ instead of D:\J2EE\Ch07Code\Ch07_06\Ch07?
    Please, can somebody helps me?
    Thank you in advance.
    cagou!

    jschell wrote:
    And I doubt you can recurse like that for embedded java. You must have a class that does the functionality and another class that creates the proc.
    >And I doubt you can recurse like that for embedded java. You must have a class that does the functionality and another class that creates the proc.
    >
    And I doubt you can recurse like that for embedded java. You must have a class that does the functionality and another class that creates the proc.
    Thank you for your response, I have done two classes:
    SampleExternalMethods.java:
    package Ch07;
    import java.sql.*;*
    *public class SampleExternalMethods*
    *public static void getCountry(String Iso_Code)*
    *// A connection object to allow database callback*
    *Connection l_conn = null;*
    *Statement l_stmt = null;*
    *ResultSet l_rs = null;*
    *try*
    *String url = "jdbc:pointbase:server://localhost/pointbaseDB";*
    *String username = "PBPUBLIC";*
    *String password = "PBPUBLIC";*
    *l_conn = DriverManager.getConnection(url, username, password);*
    *// Query the database for the country iso code*
    *l_stmt = l_conn.createStatement();*
    *l_rs = l_stmt.executeQuery( "SELECT* FROM PBPUBLIC.COUNTRIES"
    +" WHERE country_iso_code ='"+ Iso_Code +"'");+
    +//Affichage du résultat de la requête+
    +l_rs.next();+
    +System.out.print(l_rs.getString(1)+ " - ");
    System.out.print(l_rs.getString(2) +" - ");+
    +System.out.println(l_rs.getString(3));+
    +// Close the result set+
    +l_rs.close();+
    +} catch (SQLException e) {+
    +e.printStackTrace();+
    +} finally {+
    +if (l_rs != null) {+
    +try {+
    +l_rs.close();+
    +} catch (Exception e) {+
    +e.printStackTrace();+
    +}+
    +}+
    +if (l_stmt != null) {+
    +try {+
    +l_stmt.close();+
    +} catch (Exception e) {+
    +e.printStackTrace();+
    +}+
    +}+
    +if (l_conn != null) {+
    +try {+
    +l_conn.close();+
    +} catch (Exception e) {+
    +e.printStackTrace();+
    +}+
    +}+
    +}+
    +}+
    +}+
    CreateMethods.java:
    +package Ch07;+
    +import java.sql.*;+
    +public class CreateMethods+
    +{+
    +// A connection object to allow database callback+
    +static Connection m_conn = null;+
    +static Statement m_stmt;+
    +static CallableStatement m_callStmt = null;+
    +public static void main(String[] args)+
    +{+
    +try+
    +{+
    +String url = "jdbc:pointbase:server://localhost/pointbaseDB";+
    +String username = "PBPUBLIC";+
    +String password = "PBPUBLIC";+
    +m_conn = DriverManager.getConnection(url, username, password);+
    +doCreateProcedure();+
    +doInvokeProcedure();+
    +} catch (SQLException e) {+
    +e.printStackTrace();+
    +} finally {+
    +if (m_stmt != null) {+
    +try {+
    +m_stmt.close();+
    +} catch (Exception e) {+
    +e.printStackTrace();+
    +}+
    +}+
    +if (m_callStmt != null) {+
    +try {+
    +m_callStmt.close();+
    +} catch (Exception e) {+
    +e.printStackTrace();+
    +}+
    +}+
    +if (m_conn != null) {+
    +try {+
    +m_conn.close();+
    +} catch (Exception e) {+
    +e.printStackTrace();+
    +}+
    +}+
    +}+
    +}+
    +public static void doCreateProcedure() throws SQLException {+
    +// SQL statement to create a stored procedure+
    +String SQL_CREATE_PROC = "CREATE PROCEDURE PBPUBLIC.getCountry(IN P1 VARCHAR(30))"+
    " LANGUAGE JAVA"
    +" SPECIFIC getCountry"+
    " NO SQL"
    +" EXTERNAL NAME \"SampleExternalMethods::getCountry\""+
    " PARAMETER STYLE SQL";
    // Create a SQL statement
    m_stmt = m_conn.createStatement();
    // Execute the SQL
    m_stmt.executeUpdate(SQL_CREATE_PROC);
    // Close the statement
    //m_stmt.close();
    public static void doInvokeProcedure() throws SQLException {
    // Create SQL to invoke stored procedures
    String SQL_USE_PROC = "{ call getCountry(?) }";
    // Create a callable statement with three binding parameters
    m_callStmt = m_conn.prepareCall(SQL_USE_PROC);
    m_callStmt.setString(2, "CA");
    m_callStmt.executeQuery();
    // Close the callable statement
    //m_callStmt.close();
    }But I have the same error message that previously.
    I have read this note and I suppose that the problem is linked:
    If PointBase Server is run with the Java Security Manager, in the java policy file grant
    *’com.pointbase.sp.spPermission’ to the class that implements the external Java method.*
    An "spPermission" consists of a class name with no action. The class name is a name of a class
    that could be used in creating a Stored Procedure in PointBase. The naming convention follows
    the hierarchical property naming convention and that is supported by
    *"java.security.BasicPermission". An asterisk may appear by itself, or if immediately preceded*
    by ".", may appear at the end of the name, to signify a wildcard match. The name cannot
    contain any white spaces.
    Can you explain me what I must to do in order to solve this problem of spPermission.
    Thanks.

  • How to view the returned data from a stored procedure in TOAD?

    Hi,
    I created ref cursor in the stored procedure to return data. The stored procedure works fine, just want to view the result in TOAD. The BEGIN... EXEC... END can execute the stored procedure, but how to make the result display?
    Thanks!

    Right click the editor and choose
    "Prompt For Substitution Variables".
    Run for example the following code:
    DECLARE
    PROCEDURE p (cur OUT sys_refcursor)
    AS
    BEGIN
    OPEN cur FOR
    SELECT *
    FROM DUAL;
    END p;
    BEGIN
    p (:cur);
    END;
    The result will display in Toad's Data Grid!
    Regards Michael

  • Error while running a stored procedure in SBO

    Hi all,
    i have a stored procedure that i run in my sbo.  When i run the stored procedure i get the following error :
    1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Warning: Null value is eliminated by an aggregate or other SET operation.
    'Servicecontracten' (OCTR)    05/10/2011  18:03:36  -1
    i launch my sp like this :
    exec [spu_DS_HistProjektUserVeldenViewBetalingen]  (i pass no parameters while testing.  i put them fix in my sp)
    my stored procedure looks like this :
    USE [def1]
    GO
    /****** Object:  StoredProcedure [dbo].[spu_DS_HistProjektUserVeldenViewBetalingen]    Script Date: 10/05/2011 18:03:05 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- Batch submitted through debugger: SQLQuery2.sql|8|0|C:\Users\kvanhauwaert\AppData\Local\Temp\~vs2A98.sql
    ALTER PROCEDURE [dbo].[spu_DS_HistProjektUserVeldenViewBetalingen]
              /* @project_number varchar(20),
              @billperiod_type varchar(10) */
    AS
    BEGIN
         SELECT isnull(lijnnr,0) as lijnnr, isnull(fase,'') as fase, isnull(factuurbedrag,0) as factuurbedrag,
         isnull(billperiod_type,'') as billperiod_type
         INTO #tempDS_HistProjektUserVeldenViewBetalingen
         FROM DS_HistProjektUserVeldenViewBetalingen t1
         WHERE project_number = '08053A'
         SELECT  isnull(lijnnr,0) as lijnnr, isnull(fase,'') as fase , isnull(factuurbedrag,0) as factuurbedrag,
              (select sum(isnull(factuurbedrag,0)) from #tempDS_HistProjektUserVeldenViewBetalingen where lijnnr <= t1.lijnnr) as lijntotaal,
              (select sum(isnull(factuurbedrag,0)) from #tempDS_HistProjektUserVeldenViewBetalingen where lijnnr <= t1.lijnNr and billperiod_type = '110-01' ) as lijntotaalKetting
         FROM #tempDS_HistProjektUserVeldenViewBetalingen t1
         WHERE fase,'') is not null
         ORDER BY t1.fase
         DROP TABLE #tempDS_HistProjektUserVeldenViewBetalingen
    END
    GO
    Somebody has a clue what i'm doing wrong ?
    thnx

    Thanks Gordon for your reply.
    i've changed my sp to :
    USE [def1]
    GO
    /****** Object:  StoredProcedure [dbo].[spu_DS_HistProjektUserVeldenViewBetalingen]    Script Date: 10/05/2011 18:56:34 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- Batch submitted through debugger: SQLQuery2.sql|8|0|C:\Users\kvanhauwaert\AppData\Local\Temp\~vs2A98.sql
    CREATE PROCEDURE [dbo].[spu_DS_HistProjektUserVeldenViewBetalingen]
              /* @project_number varchar(20),
              @billperiod_type varchar(10) */
    AS
    BEGIN
         SELECT isnull(lijnnr,0) as lijnnr, isnull(fase,'') as fase, isnull(factuurbedrag,0) as factuurbedrag,
         isnull(billperiod_type,'') as billperiod_type
         INTO #tempDS_HistProjektUserVeldenViewBetalingen
         FROM DS_HistProjektUserVeldenViewBetalingen t1
         WHERE isnull(project_number,'') = '08053A'
         SELECT  isnull(lijnnr,0) as lijnnr, isnull(fase,'') as fase , isnull(factuurbedrag,0) as factuurbedrag,
              (select sum(isnull(factuurbedrag,0)) from #tempDS_HistProjektUserVeldenViewBetalingen where isnull(lijnnr,0) <= isnull(t1.lijnnr,0)) as lijntotaal,
              (select sum(isnull(factuurbedrag,0)) from #tempDS_HistProjektUserVeldenViewBetalingen where isnull(lijnnr,0) <= isnull(t1.lijnNr,0) and isnull(billperiod_type,'') = '110-01' ) as lijntotaalKetting
         FROM #tempDS_HistProjektUserVeldenViewBetalingen t1
         WHERE isnull(fase,'') <> ''
         ORDER BY t1.fase
         DROP TABLE #tempDS_HistProjektUserVeldenViewBetalingen
    END
    GO
    but that didn't solved my problem.  Any other idea's ?
    kind regards.
    Kurt

  • Error while deploying a Java Stored Procedure using JDeveloper

    Hi,
    I was going thru the Oracle By Example article: "Developing SQL and PL/SQL with JDeveloper". (http://www.oracle.com/technology/obe/obe9051jdev/ide1012/plsqlobe/obeplsql.htm)
    One of the items in this article is - "Creating and Deploying a Java Stored Procedure"
    I was able to create a java class, compile it. Created a deployment profile. created a pl/sql wrapper. While trying to deploy the java stored procedure, I am getting the following error:
    Invoking loadjava on connection 'hr_conn' with arguments:
    -order -resolve -thin
    errors : class package1/mypackage/JavaStoredProc
    ORA-29521: referenced name java/lang/StringBuilder could not be found
    The following operations failed
    class package1/mypackage/JavaStoredProc: resolution
    oracle.aurora.server.tools.loadjava.ToolsException: Failures occurred during processing
         at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:863)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:116)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:46)
         at oracle.jdevimpl.deploy.OracleDeployer.deploy(OracleDeployer.java:97)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:474)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:361)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:285)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$Action$1.run(StoredProcProfileDt.java:383)
    #### Deployment incomplete. #### Oct 27, 2005 1:38:56 PM
    Appreciate your help on this..

    I am using Jdeveloper 10.1.3 Early Access Version. JDK comes with it. I also have another JDK on my machine (JDK1.4.2_09)

  • Error while executing a stored procedure from forms6i

    When I execute a STORED PROCEDURE from ORACLE DB 10g this procedure works perfectly fine.
    But when I execute the same from the FORMs 6i I get the following error:
    PDE-PLU022 Don't have access to the stored program unit
    XMLPARSERCOVER in schema CARE.
    where XMLPARSERCOVER is the class and
    CARE is the schema.
    Regards,
    Jignesh S

    I have tried this with both the owner of the schema and the intended user, -from both forms and directly.
    All rights was granted on the stored procedure. Since posting I have found that one of the tables that the procedure might insert into, was not explicitly granted to the intended user, and after rectifying that the error message went away.
    -however, the procedure now silently "finishes" without any evidence that it ever ran, if invoked from the forms application. When invoked from SQL Plus (or JDev, or Toad) it runs as expected.
    I have no public synonym for the procedure, -is that necessary?
    The stored procedure in question is implemented in java, and published as a stored procedure. It does rather heavy lifting, when running, using a view against another server , updating local tables and quite a lot of data validation/cleansing, and logging. All recourses are within the same schema.
    Any ideas?

  • Error while calling a stored procedure using SQLJ

    I am calling a stored procedure defined inside a package through a SQLJ script. The first parameter of that procedure is a IN OUT parameter which is used as a ROWID for creating a cursor. That ROWID value is the same for every record in the table, thereby enabling us to create a cursor.
    When I give a hard-coded value as a parameter, I get an error stating that the assignment is not correct as the query is expecting a variable and not a literal. Hence I removed the hard-coded value and included a dymanic value in the SQLJ call.
    String strVal = "A";
    #sql{CALL ASSIGNMENTS_PKG.INSERT_ROW :{strVal},'SALARY_CODE_GROUP','BU',3,105,sysdate,1,sysdate,1,1)};
    Here "ASSIGNMENTS_PKG" is a package name and INSERT_ROW is the procedure.
    When the SQLJ program is run, I get an error stating:
    "PLS-00201: identifier 'A' must be declared"
    I read the error message, but I am not able to understand where I need to give the GRANT permission to.

    If you're using Oracle Provider for OLE DB (OraOLEDB) to execute this stored procedure, you need to set PLSQLRSet attribute. This attribute can be set in registry, connection string, or command object. Please refer to User Documentation for more information.

  • ORA-03111 - JCA Binding error while invoking a stored procedure in DB

    Hi,
    We are facing this problem for one interface alone.
    Need expert advice to fix this problem..
    This is scheduled to run once in a day and fails daily for past 2 weeks..
    We receive below error as response..
    Same interface worked fine for past 1 yr..
    Also it works fine if we reprocess the batch in next day morning...
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'DB_Legacy_To_EBS_Invoice_Conversion' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. An error occurred while preparing and executing the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. Cause: java.sql.SQLException: ORA-03111: break received on communication channel ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    AND
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'DB_Legacy_To_EBS_Invoice_Conversion' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. An error occurred while preparing and executing the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. Cause: java.sql.SQLException: ORA-01013: user requested cancel of current operation ORA-06512: at "IRSOA.XXIR_AR_SOA_CUSTOMER_INVOICE", line 213 ORA-06512: at line 1 ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution
    Thanks,
    Sundaram

    Looks like the SQL might be taking a longer time to execute and might be timing out.
    Please refer the following:
    Re: ORA-01013: user requested cancel of current operation
    http://www.dba-oracle.com/t_ora_01013_user_requested_cancel_of_current_operation.htm
    Additionally, ORA-06512 indicates that there is a mismatch of the with the data length that is being processed. Refer http://www.techonthenet.com/oracle/errors/ora06512.php
    Hope this helps.
    Thanks,
    Patrick

  • I am getting ORA-01403: no data found error while calling a stored procedur

    Hi, I have a stored procedure. When I execute it from Toad it is successfull.
    But when I call that from my java function it gives me ORA-01403: no data found error -
    My code is like this -
    SELECT COUNT(*) INTO L_N_CNT FROM TLSI_SI_MAST WHERE UPPER(CUST_CD) =UPPER(R_V_CUST_CD) AND
    UPPER(ACCT_CD)=UPPER(R_V_ACCT_CD) AND UPPER(CNSGE_CD)=UPPER(R_V_CNSGE_CD) AND
    UPPER(FINALDEST_CD)=UPPER(R_V_FINALDEST_CD) AND     UPPER(TPT_TYPE)=UPPER(R_V_TPT_TYPE);
         IF L_N_CNT >0 THEN
              DBMS_OUTPUT.PUT_LINE('ERROR -DUPlicate SI-1');
              SP_SEL_ERR_MSG(5,R_V_ERROR_MSG);
              RETURN;
         ELSE
              DBMS_OUTPUT.PUT_LINE('BEFORE-INSERT');
              INSERT INTO TLSI_SI_MAST
                   (     CUST_CD, ACCT_CD, CNSGE_CD, FINALDEST_CD, TPT_TYPE,
                        ACCT_NM, CUST_NM,CNSGE_NM, CNSGE_ADDR1, CNSGE_ADDR2,CNSGE_ADDR3,
                        CNSGE_ADDR4, CNSGE_ATTN, EFFECTIVE_DT, MAINT_DT,
                        POD_CD, DELVY_PL_CD, TRANSSHIP,PARTSHIPMT, FREIGHT,
                        PREPAID_BY, COLLECT_BY, BL_REMARK1, BL_REMARK2,
                        MCC_IND, NOMINATION, NOTIFY_P1_NM,NOTIFY_P1_ATTN , NOTIFY_P1_ADDR1,
                        NOTIFY_P1_ADDR2, NOTIFY_P1_ADDR3, NOTIFY_P1_ADDR4,NOTIFY_P2_NM,NOTIFY_P2_ATTN ,
                        NOTIFY_P2_ADDR1,NOTIFY_P2_ADDR2, NOTIFY_P2_ADDR3, NOTIFY_P2_ADDR4,
                        NOTIFY_P3_NM,NOTIFY_P3_ATTN , NOTIFY_P3_ADDR1,NOTIFY_P3_ADDR2, NOTIFY_P3_ADDR3,
                        NOTIFY_P3_ADDR4,CREATION_DT, ACCT_ATTN, SCC_IND, CREAT_BY, MAINT_BY
                        VALUES(     R_V_CUST_CD,R_V_ACCT_CD,R_V_CNSGE_CD,R_V_FINALDEST_CD,R_V_TPT_TYPE,
                        R_V_ACCT_NM,R_V_CUST_NM ,R_V_CNSGE_NM, R_V_CNSGE_ADDR1,R_V_CNSGE_ADDR2, R_V_CNSGE_ADDR3,
                        R_V_CNSGE_ADDR4,R_V_CNSGE_ATTN,     R_V_EFFECTIVE_DT ,SYSDATE, R_V_POD_CD,R_V_DELVY_PL_CD,R_V_TRANSSHIP ,R_V_PARTSHIPMT , R_V_FREIGHT,
                        R_V_PREPAID_BY ,R_V_COLLECT_BY ,R_V_BL_REMARK1 ,R_V_BL_REMARK2,R_V_MCC_IND,
                        R_V_NOMINATION,R_V_NOTIFY_P1_NM, R_V_NOTIFY_P1_ATTN, R_V_NOTIFY_P1_ADD1, R_V_NOTIFY_P1_ADD2,
                        R_V_NOTIFY_P1_ADD3, R_V_NOTIFY_P1_ADD4, R_V_NOTIFY_P2_NM, R_V_NOTIFY_P2_ATTN, R_V_NOTIFY_P2_ADD1,
                        R_V_NOTIFY_P2_ADD2, R_V_NOTIFY_P2_ADD3, R_V_NOTIFY_P2_ADD4, R_V_NOTIFY_P3_NM, R_V_NOTIFY_P3_ATTN,
                        R_V_NOTIFY_P3_ADD1, R_V_NOTIFY_P3_ADD2, R_V_NOTIFY_P3_ADD3, R_V_NOTIFY_P3_ADD4,
                        SYSDATE,R_V_ACCT_ATTN,R_V_SCC_IND,R_V_USER_ID,R_V_USER_ID
                        DBMS_OUTPUT.PUT_LINE(' SI - REC -INSERTED');
         END IF;

    Hi,
    I think there is a part of the stored procedure you did not displayed in your post. I think your issue is probably due to a parsed value from java. For example when calling a procedure from java and the data type from java is different than expected by the procedure the ORA-01403 could be encountered. Can you please show the exact construction of the call of the procedure from within java and also how the procedure possible is provided with an input parameter.
    Regards, Gerwin

  • Error while calling a stored procedure with OUT parameter.

    Hi,
    I am trying to call a Stored Procedure(SP) with an OUT parameter(Ref Cursor) from a third party tool. It is called using OLE-DB Data provider. In one database the procedure works fine but when I change the database the procedure call is giving following error.
    Distribution Object:     COM Error. COM Source: OraOLEDB. COM Error message: IDispatch error #3092. COM Description: ORA-06550: line 1, column 7:
         PLS-00306: wrong number or types of arguments in call to 'TEST1'
         ORA-06550: line 1, column 7:
         PL/SQL: Statement ignored.
    I am not able to find as to why is this happening. Please let me know any clues /help to solve this problem.
    Thanks in advance.

    If you're using Oracle Provider for OLE DB (OraOLEDB) to execute this stored procedure, you need to set PLSQLRSet attribute. This attribute can be set in registry, connection string, or command object. Please refer to User Documentation for more information.

  • How to find out date in oracle when the Stored procedure in changed.

    Dear Sir,
    I want to know the list of dates when stored procedure is modified during a given period.
    eg. Procedure created 01/01/2011
    i changed the procedure 4 times say 01/10/2011,01/12/2011,01/01/2012 and 20/12/2012.
    from where i can get these details along with the other details like what will be procedure syntax at different modifications and most important what is ipof machine.
    thanks & regards
    Munish

    user9216770 wrote:
    Dear Sir,
    I want to know the list of dates when stored procedure is modified during a given period.
    eg. Procedure created 01/01/2011
    i changed the procedure 4 times say 01/10/2011,01/12/2011,01/01/2012 and 20/12/2012.
    from where i can get these details along with the other details like what will be procedure syntax at different modifications and most important what is ipof machine.
    thanks & regards
    MunishOracle does NOT retain or contain previous versions.
    You should be able to obtain these from your Source Code Repository; like Subversion.

  • Calling stored procedure multiple times in the JDBC receiver

    Hi,
    I am calling the stored procedure(SP) to update a DB table in the JDBC receiver.
    SP has 10 input parameters, and SP can receive one value for each parameter at a time.
    In my case, i will have multiple rows to insert using SP.i.e multiple values for each parameter.
    Its working correctly for a single value for each parameter, but when i have multiple values i want to call the SP multiples times.
    Is this possible and how?
    Thanks,
    Varghese.

    Varghese,
    I think you can have multiple statements in the JDBC Adapter's XML, as in http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm.
    Here the StatementName1 node can be inserted into your JDBC XML as often as you want.
    Kind regards,
    Koen

  • Can not delete data from table which is queried in my stored procedure

    Hi,
    Anyone knows how to fix it:
    I have a table. In a stored procedure, I have a simple query running on this table.
    When I want to delete one record from that table, I got error message:
    ORA-04091: table *** is mutating, trigger/function may not see it.
    Thanks first.

    Rick, the only time you should get a mutating table error is when a trigger is involved. FK problems have separate error codes (and would be a different problem than the one that started this thread). Using a DBA id check all the tables subject to DML by your function and by whatever calls your function for triggers. Only the owner or a DBA can see the existence of triggers on a non-owned table. This has caused some of the developers I work with to think tables that had triggers do not have them since they do not work under the owning or a DBA ID.
    By your description of what you are trying to do in the function we do that all the time without problem.
    How large is the function? How/When is it called?
    Mark D Powell

  • Can not see Stored Procedures owned by "Code Owner"

    Post Author: BinChen
    CA Forum: Deployment
    I am using Data Source defined with "CR Oracle ODBC Driver 5.0" in "Data Source (ODBC)".
    But in Crystal Report XI, I can not see CodeOwner when I can created a new connection using ODBC (RDO).
    I can see CodeOwner and all SP defined under it when I use "Oracle Server" directly or use sqlplus.

    Post Author: BinChen
    CA Forum: Deployment
    I'm using Window XP with Oracle 10g2R
    To be more clear,
    I have an ODBC Data Source defined as "DEV" and when I created a connection using ODBC, I can only see some database account section like: APP, APPREF, PUBLIC, SYS, SUSTEM. But I can not see CodeOwner.
    If I connected without using ODBC, I can also see CODEOWNER and then all its stored procedures.
    So why I can not see Stored Procedures defined under CODEOWNER using ODBC?
    I have an exsiting report, even I can not see CODEOWNER, but I have no problem to run and preview the report also to "verify database".

  • Unable to get the data from the stored procedure

    Hello Folks,
    I have this stored procedure and am trying to get the data from the table stage_bill but for some reason i am not sure its not pulling the data.Am a beginner in pl/sql Can any one please help to find out. I can give the code below.
    create or replace procedure Load_FADM_Staging_Area_TEST(p_data_load_date date) is
    -- local variables
    v_start_date                date;
    v_end_date                  date;
    -- cursor starting
      CURSOR c_get_data
      IS
      SELECT
       a.batch_id 
    ,a.beginning_service_date 
    ,a.bill_id 
    ,a.bill_method 
    ,a.bill_number 
    ,a.bill_received_date 
    ,a.bill_status 
    ,a.bill_type 
    ,a.change_oltp_by 
    ,a.change_oltp_date 
    ,a.client_datafeed_code 
    ,a.client_id 
    ,a.created_date 
    ,a.date_of_incident 
    ,a.date_paid 
    ,a.deleted_oltp_by 
    ,a.deleted_oltp_date 
    ,a.duplicate_bill 
    ,a.ending_service_date 
    ,a.event_case_id 
    ,a.event_id 
    ,a.from_oltp_by 
    ,a.oltp_bill_status 
    ,a.review_status 
    ,'HRI' schema_name
    , sysdate Load_date
    ,'ETLPROCESS001' Load_user
    ,v_start_date as Row_Effective_Date
    ,null Row_End_date
    from stage_bill a
    where
    --created_date >= to_date('20101031 235959', 'YYYYMMDD HH24MISS')
    created_date >= v_start_date
    and
    --created_date <= to_date('20101111 235959', 'YYYYMMDD HH24MISS')
      created_date <= v_end_date
    and not exists
    (select
    b.batch_id 
    ,b.beginning_service_date 
    ,b.bill_id 
    ,b.bill_method 
    ,b.bill_number 
    ,b.bill_received_date 
    ,b.bill_status 
    ,b.bill_type 
    ,b.change_oltp_by 
    ,b.change_oltp_date 
    ,b.client_datafeed_code 
    ,b.client_id 
    ,b.created_date 
    ,b.date_of_incident 
    ,b.date_paid 
    ,b.deleted_oltp_by 
    ,b.deleted_oltp_date 
    ,b.duplicate_bill 
    ,b.ending_service_date 
    ,b.event_case_id 
    ,b.event_id 
    ,b.from_oltp_by 
    ,b.oltp_bill_status 
    ,b.review_status,
    b.schema_name,
    b.Load_date,
    b.Load_user,
    b.Row_Effective_Date,
    b.Row_End_Date
    from STG_FADM_HRI_STAGE_BILL_TEST b)
      -- cursor o/p variables
    v_batch_id                  stage_bill.batch_id%TYPE;
    v_beginning_service_date    stage_bill.beginning_service_date%TYPE;
    v_bill_id                   stage_bill.bill_id%TYPE;
    v_bill_method               stage_bill.bill_method%TYPE;
    v_bill_number               stage_bill.bill_number%TYPE;
    v_bill_received_date        stage_bill.bill_received_date%TYPE;
    v_bill_status               stage_bill.bill_status%TYPE;
    v_bill_type                 stage_bill.bill_type%TYPE;
      v_change_oltp_by            stage_bill.change_oltp_by%TYPE;
      v_change_oltp_date          stage_bill.change_oltp_date%TYPE;
      v_client_datafeed_code      stage_bill.client_datafeed_code%TYPE;
      v_client_id               stage_bill.client_id%TYPE;
      v_created_date          stage_bill.created_date%TYPE;
      v_date_of_incident    stage_bill.date_of_incident%TYPE;
      v_date_paid         stage_bill.date_paid%TYPE;
      v_deleted_oltp_by     stage_bill.deleted_oltp_by%TYPE;
      v_deleted_oltp_date    stage_bill.deleted_oltp_date%TYPE;
      v_duplicate_bill     stage_bill.duplicate_bill%TYPE;
      v_ending_service_date   stage_bill.ending_service_date%TYPE;
      v_event_case_id        stage_bill.event_case_id%TYPE;
      v_event_id            stage_bill.event_id%TYPE;
      v_from_oltp_by         stage_bill.from_oltp_by%TYPE;
      v_oltp_bill_status   stage_bill.oltp_bill_status%TYPE;
      v_review_status     stage_bill.review_status%TYPE;   
      v_schema_name        varchar(50);
      v_Load_date          date;
      v_Load_user            varchar(50);
      v_Row_Effective_Date   date;
      v_Row_End_Date         date;     
    Begin
    if  p_data_load_date is null then
        select (sysdate - 7), (sysdate - 1) into v_start_date, v_end_date from dual;
      elsif p_data_load_date is not null then
       select (p_data_load_date - 7), (p_data_load_date - 1) into v_start_date, v_end_date from dual;
      else
        raise_application_error('-20042', 'Data control - GetDataControlAuditData : Date parameter must be a date of this or a previous week.');
      end if;
    -- cursor c_get_data loop begin
    OPEN c_get_data;
        LOOP                                                       -- cursor c_get_data loop begin
          FETCH c_get_data
           INTO
            v_batch_id,
      v_beginning_service_date,
      v_bill_id ,
      v_bill_method ,
      v_bill_number,
      v_bill_received_date,
      v_bill_status,
      v_bill_type,
      v_change_oltp_by,
      v_change_oltp_date,
      v_client_datafeed_code,
      v_client_id,
      v_created_date,
      v_date_of_incident,
      v_date_paid,
      v_deleted_oltp_by,
      v_deleted_oltp_date,
      v_duplicate_bill,
      v_ending_service_date ,
      v_event_case_id ,
      v_event_id,
      v_from_oltp_by,
      v_oltp_bill_status,
      v_review_status,   
      v_schema_name,
       v_Load_date,
       v_Load_user,
       V_Row_Effective_Date,   
       v_Row_End_Date;
        EXIT WHEN c_get_data%NOTFOUND;
    insert into STG_FADM_HRI_STAGE_BILL_TEST
    batch_id 
    ,beginning_service_date 
    ,bill_id 
    ,bill_method 
    ,bill_number 
    ,bill_received_date 
    ,bill_status 
    ,bill_type 
    ,change_oltp_by 
    ,change_oltp_date 
    ,client_datafeed_code 
    ,client_id 
    ,created_date 
    ,date_of_incident 
    ,date_paid 
    ,deleted_oltp_by 
    ,deleted_oltp_date 
    ,duplicate_bill 
    ,ending_service_date 
    ,event_case_id 
    ,event_id 
    ,from_oltp_by 
    ,oltp_bill_status 
    ,review_status 
    ,schema_name
    ,Load_date
    ,Load_user
    ,Row_Effective_Date
    ,Row_End_Date
    values(
           v_batch_id,
    v_beginning_service_date,
    v_bill_id ,
    v_bill_method ,
    v_bill_number,
    v_bill_received_date,
    v_bill_status,
    v_bill_type,
    v_change_oltp_by,
    v_change_oltp_date,
    v_client_datafeed_code,
    v_client_id,
    v_created_date,
    v_date_of_incident,
    v_date_paid,
    v_deleted_oltp_by,
    v_deleted_oltp_date,
    v_duplicate_bill,
    v_ending_service_date ,
    v_event_case_id ,
    v_event_id,
    v_from_oltp_by,
    v_oltp_bill_status,
    v_review_status,   
    v_schema_name,
    v_Load_date,
    v_Load_user,
    v_Row_Effective_Date,   
    v_Row_End_Date ) ;
      COMMIT;
        END LOOP;                                                 
        CLOSE c_get_data; 

    Maybe you need something else, like
    CREATE OR REPLACE PROCEDURE load_fadm_staging_area_test (
      p_data_load_date DATE
    ) IS
      v_start_date   DATE;
      v_end_date     DATE;
    BEGIN
      SELECT NVL (p_data_load_date, SYSDATE) - 7,
             NVL (p_data_load_date, SYSDATE) - 1
      INTO   v_start_date,
             v_end_date
      FROM   DUAL;
      MERGE INTO stg_fadm_hri_stage_bill_test b
      USING      (SELECT *
                  FROM   stage_bill
                  WHERE  created_date BETWEEN v_start_date AND v_end_date) a
      ON         (b.bill_id = a.billl_id)
      WHEN NOT MATCHED THEN
        INSERT     (batch_id,
                    beginning_service_date,
                    bill_id,
                    bill_method,
                    bill_number,
                    bill_received_date,
                    bill_status,
                    bill_type,
                    change_oltp_by,
                    change_oltp_date,
                    client_datafeed_code,
                    client_id,
                    created_date,
                    date_of_incident,
                    date_paid,
                    deleted_oltp_by,
                    deleted_oltp_date,
                    duplicate_bill,
                    ending_service_date,
                    event_case_id,
                    event_id,
                    from_oltp_by,
                    oltp_bill_status,
                    review_status,
                    schema_name,
                    load_date,
                    load_user,
                    row_effective_date,
                    row_end_date
        VALUES     (a.batch_id,
                    a.beginning_service_date,
                    a.bill_id,
                    a.bill_method,
                    a.bill_number,
                    a.bill_received_date,
                    a.bill_status,
                    a.bill_type,
                    a.change_oltp_by,
                    a.change_oltp_date,
                    a.client_datafeed_code,
                    a.client_id,
                    a.created_date,
                    a.date_of_incident,
                    a.date_paid,
                    a.deleted_oltp_by,
                    a.deleted_oltp_date,
                    a.duplicate_bill,
                    a.ending_service_date,
                    a.event_case_id,
                    a.event_id,
                    a.from_oltp_by,
                    a.oltp_bill_status,
                    a.review_status,
                    'HRI',
                    SYSDATE,
                    'ETLPROCESS001',
                    v_start_date,
                    NULL
    END load_fadm_staging_area_test;Whenever you code a cursor and a loop, ask yourself. Do I need that?
    Regards
    Peter

Maybe you are looking for

  • Getting error with Web Templates in BI 7.0

    Hi Everyone, We have upgraded BW3.5 to BW7.0. When we are executing any Web Template in browser we are getting this error- RSBOLAP 018 Java system error:call FM RSWR_TEMPLATE_PROCESS_PROXY to ProgId CHWSXID01..... For your information we have install

  • Best way to store and access all my media over network?

    With nearly 500GBs of music, movies and TV in my iTunes library, my G5's hard drive is just about full. And since I tend to watch everything on my significantly faster Macbook Pro via Front Row, it means I have to keep my G5 up and running all the ti

  • Motion 1 Crashes on Intel Core

    hi There When i run Motion V1 on my new Intel 1.83GHz Core duo, it loads to the motion screens before it quits. Any help? cheers scott

  • Printing the invoice date in the outgoing payment.

    Hi Experts, Please help me with this scenario. I need to print the invoice date and the item description and also the due date of the invoice in an outgoing payment in PLD. I think this can be done through wring a query in UDF through the formatted s

  • Can I take Java interface as .h of C?

    Can I use Java interface as a substitute of .h files in C?