Stored Procedure no longer 'accepts' parameters sent in to it

I have an old program, MicroFocus Cobol, that has been upgraded to MF 5.1, using Oracle 8i (I know dark ages) through a 10g client. I compiled this program recently for a change and now the stored procedure that used to work doesn't like my parameters but if I 'hard code' values I get data back.
PROCEDURE MATCH_AGENT (     U_ISI_COMPANY_CODE IN VARCHAR2,
                    U_BO_ID IN OUT VARCHAR2,
                    U_IA_PROD_CODE IN OUT VARCHAR2,
                    U_IA_EFF_DATE IN OUT VARCHAR2,
                    U_POL_EFF_DATE IN VARCHAR2,
                    U_AGENT_CHANGE_IND IN OUT VARCHAR2,
                    U_ALLOW_VOL_IND OUT VARCHAR2,
                    U_COMMISSION_PLAN OUT VARCHAR2,
                    P_ERROR_CODE IN OUT NUMBER,
                    P_ERROR_MESSAGE IN OUT VARCHAR2,
                    P_ERROR_SOURCE IN OUT VARCHAR2) IS
     V_IA_STATUS_CODE VARCHAR2(1);
     V_IA_XFER_OFFICE_CD VARCHAR2(3);
     V_IA_XFER_AGENT_CODE VARCHAR2(7);
     V_IA_EFF_DATE VARCHAR2(7);
BEGIN
SELECT     IA_STATUS_CODE,
     IA_XFER_OFFICE_CD,
     IA_XFER_AGENT_CODE,
     TO_CHAR(IA_EFF_DATE,'YYYYDDD')
INTO     V_IA_STATUS_CODE,
     V_IA_XFER_OFFICE_CD,
     V_IA_XFER_AGENT_CODE,
     V_IA_EFF_DATE
          FROM     GARAGE.ISI_AGENT
          WHERE      ISI_COMPANY_CODE      = U_ISI_COMPANY_CODE
               AND      BO_ID          = U_BO_ID
               AND      IA_PROD_CODE      = U_IA_PROD_CODE
               AND     TO_CHAR(IA_EFF_DATE,'YYYYDDD') <= U_POL_EFF_DATE
               AND     (TO_CHAR(IA_EXP_DATE,'YYYYDDD') > U_POL_EFF_DATE
                    OR IA_EXP_DATE IS NULL)
          AND      IA_EFF_DATE
                    IN (SELECT MAX(IA_EFF_DATE)
               FROM ISI_AGENT
               WHERE ISI_COMPANY_CODE = U_ISI_COMPANY_CODE
               AND BO_ID = U_BO_ID
               AND IA_PROD_CODE = U_IA_PROD_CODE
               AND TO_CHAR(IA_EFF_DATE,'YYYYDDD') <= U_POL_EFF_DATE
               AND (TO_CHAR(IA_EXP_DATE,'YYYYDDD') > U_POL_EFF_DATE
               OR IA_EXP_DATE IS NULL));
P_ERROR_CODE:=SQLCODE;
P_ERROR_SOURCE := 'MATCH_AGENT';
P_ERROR_MESSAGE:=SQLERRM(P_ERROR_CODE);
I now get an ORA-1403 but if I hard code my 'U' parameter fields and run it as an inline call, I get a status code back. I don't think it's a pre-compiler issue because another program in this series calls Oracle and gets data back.
Thanks for the help!
D

How do I ask a question on the forums?
SQL and PL/SQL FAQ
Since we don't have your tables or data, we can not compile, run or test posted code.
bcm@bcm-laptop:~$ oerr ora 1403
01403, 00000, "no data found"
// *Cause: No data was found from the objects.
// *Action: There was no data from the objects which may be due to end of fetch.
bcm@bcm-laptop:~$

Similar Messages

  • I need an example of oci V7.3 to call stored procedure with IN/OUT parameters.

    Hi,
    I'm developing an application to access data from Oracle V7.3 using OCI. Is there a way to get the IN, OUT and IN/OUT parameters of a stored procedure from the database ? How can I execute the stored procedures dynamically, through OCI and get the data back ? Is there any sample programs ?
    Any help is appreciated.
    Thanks
    David Lin

    Since ODP.NET does not support Oracle Object type, you can not call this stored procedure directly.
    You can write a wrapper procedure over the existing procedure accepting basic types, e.g. Varchar, Number, etc. and call your stored procedure after creating a object from the basic types.

  • Java Stored Procedures take longer to execute

    Hi,
    I am doing a comparison of Oracle and Java Stored procedures in terms of execution time. I have created a java stored proc and an Oracle stored proc both of which perform the same task. Upon execution, I find that the java proc takes longer time to execute.
    I have the following qs:-
    Why are Java Stored Procs slower than Oracle Stored Procs?
    How is a java stored proc executed as compared to an Oracle Stored Proc?
    Can someone give a detailed explanation of -
    - how a java stored proc is stored in the database?
    - what happens when it is executed?
    Thanks in advance
    Nusrat

    Why are Java Stored Procs slower than Oracle Stored Procs?java program slower than native code! hold the front page!
    On second thoughts don't bother.
    Cheers, APC

  • SQLException Calling Stored Procedure with Date OUT Parameters

    Hi,
    I'm trying to call a stored procedure in Oracle 10.1.0.4 using JDBC driver version 10.1.0.5. Here is the Stored procedure I'm trying to call:
    CREATE OR REPLACE PROCEDURE get_collector_segment_info (
    cid IN eb_collector_segment_iot.collector_id%TYPE,
    cnum IN eb_collector_segment_iot.collector_num%TYPE,
    sct OUT NOCOPY coll_seginfo_segment_codes,
    snt OUT NOCOPY coll_seginfo_segment_names,
    st OUT NOCOPY coll_seginfo_statuss,
    sdt OUT NOCOPY coll_seginfo_start_dates,
    edt OUT NOCOPY coll_seginfo_end_dates
    AS
    coll_id eb_collector_segment_iot.collector_id%TYPE;
    err_msg VARCHAR2 (1000);
    BEGIN
    -- Check if collector_id is present. If not, get the collector ID using collector Num
    IF cid IS NULL
    THEN
    coll_id := eb_collector_segment_get_cid (cnum, err_msg);
    IF err_msg IS NOT NULL
    THEN
    raise_application_error
    (-20001,
    'Error while getting Collector ID for Collector Num: '
    || cnum
    || ', Msg: '
    || err_msg
    END IF;
    ELSE
    coll_id := cid;
    END IF;
    -- Return the Segments
    SELECT ecs.segment_code, es.segment_name, es.status, ecs.start_date,
    ecs.end_date
    BULK COLLECT INTO sct, snt, st, sdt,
    edt
    FROM eb_collector_segment ecs, eb_segment es
    WHERE ecs.collector_id = coll_id
    AND ecs.segment_code = es.segment_code
    AND es.status = '1';
    IF SQL%ROWCOUNT = 0
    THEN
    raise_application_error
    (-20002,
    'No Segment records found for Collector ID: '
    || coll_id
    END IF;
    END get_collector_segment_info;
    ecs.segment_code, es.segment_name and es.status are of type VARCAHR2 and ecs.start_date and ecs.end_date are of type DATE. I wrote the following code to call the above store procedure:
    connection = this.datasource.getConnection();
    oracleCallableStatement = (OracleCallableStatement) connection.prepareCall("begin " + STORED_PROCEDURE_NAME
    + "(?, ?, ?, ?, ?, ?, ?); end;");
    oracleCallableStatement.setNull("cid", Types.VARCHAR);
    oracleCallableStatement.setLong("cnum", collectorNum);
    oracleCallableStatement.registerIndexTableOutParameter(3, 100, OracleTypes.VARCHAR, 100);
    oracleCallableStatement.registerIndexTableOutParameter(4, 100, OracleTypes.VARCHAR, 100);
    oracleCallableStatement.registerIndexTableOutParameter(5, 100, OracleTypes.VARCHAR, 100);
    oracleCallableStatement.registerIndexTableOutParameter(6, 100, OracleTypes.DATE, 0);
    oracleCallableStatement.registerIndexTableOutParameter(7, 100, OracleTypes.DATE, 0);
    resultSet = oracleCallableStatement.executeQuery();
    When I run the code, I get a "java.sql.SQLException: Invalid PL/SQL Index Table" exception on oracleCallableStatement.executeQuery(). I tried many other variations and searched on forums but nothing worked for me. Does anyone have any idea? I'm really desparate. i use JDK 1.4.2_12 and WebLogic 8.1 SP6.
    Thanks,
    Zhubin
    Message was edited by:
    zhoozhoo
    Message was edited by:
    zhoozhoo

    Hi Avi,
    I think you are right and I was using the wrong method. With some help from our DBA the problem was resolved Here is the correct code:
    connection = this.datasource.getConnection();
    oracleCallableStatement = (OracleCallableStatement) connection.prepareCall("begin " + STORED_PROCEDURE_NAME
    + "(?, ?, ?, ?, ?, ?, ?); end;");
    oracleCallableStatement.setNull(1, Types.VARCHAR);
    oracleCallableStatement.setLong(2, collectorNum);
    oracleCallableStatement.registerOutParameter(3, OracleTypes.ARRAY, "COLL_SEGINFO_SEGMENT_CODES");
    oracleCallableStatement.registerOutParameter(4, OracleTypes.ARRAY, "COLL_SEGINFO_SEGMENT_NAMES");
    oracleCallableStatement.registerOutParameter(5, OracleTypes.ARRAY, "COLL_SEGINFO_STATUSS");
    oracleCallableStatement.registerOutParameter(6, OracleTypes.ARRAY, "COLL_SEGINFO_START_DATES");
    oracleCallableStatement.registerOutParameter(7, OracleTypes.ARRAY, "COLL_SEGINFO_END_DATES");
    oracleCallableStatement.execute();
    String[] segmentCodes = (String[]) oracleCallableStatement.getARRAY(3).getArray();
    String[] segmentNumbers = (String[]) oracleCallableStatement.getARRAY(4).getArray();
    String[] segmentStatuses = (String[]) oracleCallableStatement.getARRAY(5).getArray();
    Timestamp[] startDates = (Timestamp[]) oracleCallableStatement.getARRAY(6).getArray();
    Timestamp[] endDates = (Timestamp[]) oracleCallableStatement.getARRAY(7).getArray();
    segments = new Segment[segmentCodes.length];
    for (int i = 0; i < segmentCodes.length; i++) {
    System.out.println(segmentCodes[i] + ' ' + segmentNumbers[i] + ' ' + segmentStatuses[i] + ' ' + startDates[i] + ' '
    + endDates);
    segments[i] = new Segment();
    segments[i].setSegmentCode(segmentCodes[i]);
    segments[i].setSegmentName(segmentNumbers[i]);
    segments[i].setStatus(segmentStatuses[i]);
    if (startDates[i] != null) {
    segments[i].setStartDate(new java.util.Date(startDates[i].getTime()));
    if (endDates[i] != null) {
    segments[i].setEndDate(new java.util.Date(endDates[i].getTime()));
    Thanks,
    Zhubin

  • Expose Stored Procedure with Dynamic Table Parameters

    Hi,
    I know Oracle 11g allows access via web service to all stored procedures.
    The basic idea of what we intend is to create groups of users.
    What I need, and I'm not sure if it's possible, is to expose a PLSQL that has the group's attributes and an xml:sequence of users that belong to that group. The procedure would be something like this:
    TYPE user IS RECORD (
      uid   NUMBER,
      name   VARCHAR2(100),
    TYPE users IS TABLE OF user INDEX BY BINARY_INTEGER;
    PROCEDURE add_group(g_name IN VARCHAR2(100), g_users IN users, ...) IS
    BEGIN
    END;
    The Procedure will be called from a BPEL Process as if it was a web service.
    Q:
    - Can this be done?
    - How will it map users?
    Thanks in advance :-)

    So, being as we don't have Oracle DB 11g that exposes WebServices natively to access the stored procedures, what would be the best way to access the stored procedure like a web service?
    What we are thinking of doing now is http://guidoschmutz.wordpress.com/2010/08/08/oracle-service-bus-11g-and-db-adapter-a-different-more-integrated-approach/
    Thanks again!

  • Calling stored procedures with parameters with the Database Connectivi​ty Toolkit

    Hi all,
    I am new to the forum and am having difficulty finding a solution to a particular problem I am having regarding using the LabVIEW Database Connectivity Toolkit on a project I am currently working on at my job.  I have a database in which I have tables and stored procedures with parameters.  Some of these stored procedures have input, output, and return parameters.
    I have been trying to follow this example but to no avail:  http://digital.ni.com/public.nsf/allkb/07FD1307460​83E0686257300006326C4?OpenDocument
    One such stored procedure I am working on implementing is named "dbo.getAllowablePNs", which executes "SELECT * from DeviceType" (DeviceType is the table).  In this case, it does not require an input parameter, it has an output parameter that generates the table [cluster], and has a return parameter which returns an integer value (execution status code) to show if an error occurred.  The DeviceType table has 3 columns; ID (PK, int, not null), PN (nvarchar(15), null), and NumMACAddresses (int, null).  I have gone over many examples and have talking to NI support to try to implement this and similar stored procedures in LabVIEW but have not been successful.  I am able to connect to the database with the Open Connection VI without error, but am running into some confusion following this step.  I am then trying to use the Create Parameterized Query VI to call the stored procedure and set the parameters.  I assume I would then use the Set Parameter Value VI for each parameter that is wired into the parameters input on the previous Parameterized Query VI?  I am also having some confusion during and following these steps as well.  I would greatly appreciate any advice or suggestions anyone might have in regards to this situation as I am not a SQL expert.  Also, I would be happy to provide any more information that would be helpful.
    Regards,
    Jon
    Solved!
    Go to Solution.

    Also, I don't know if this would be helpful but here is the actual stored procedure in SQL:
    CREATEPROCEDURE [dbo].[getLastSequenceNumber]
    @p1 nvarchar(10)='WO-00000'
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SETNOCOUNTON;
    -- Insert statements for procedure here
    selectmax(SequenceNumber)from Devices where WorkOrderNumber= @p1
    END
    GO

  • How do I get return parameters from a stored procedure call?

    The Open SQL Statement has an option on the Advanced tab to specify a command type of 'stored procedure'. In addition to returning a recordset, a stored procedure can also return parameters (see http://support.microsoft.com/support/kb/articles/Q185/1/25.ASP for info on doing this with ADO). Is it possible to get those return parameters with TestStand? In particular, I want to be able to get error codes back from the stored procedure in case it fails (maybe there is another way).

    The Open SQL Statement step type does not fully support stored procedures. If the procedure returns a record set than you can fetch the values as you would a SELECT statement. Stored procedures require you to setup the parameters before the call and this is not yet supported. Bob, in his answer, made a reference to the Statements tab and I think that he was talking about the Database Logging feature in TS 2.0.
    If the stored procedure is returning a return value, it may return as a single column, single row recordset which can be fetched as you normally do a record set.
    Scott Richardson
    National Instruments

  • Getting values from a stored procedure with no parameters

    Hi,
    I'm trying to get values out of a stored procedure that I created on SQL server. I'm trying to get XML values out of the database, but I'm not sure how to get any data out of it written to a file if the procedure doesn't have any parameters.
    So I'm just making a call:
    CallableStatement cs = conn.prepareCall("{call myproc}");
    cs.execute();How do I get values back from this stage?
    Thank you very much,
    Lior

    The short form answer, which assumes that the stored procedure is returning the XML as an out parameter would go something like this.
         public void build(String newUserID, String newPassword) throws SQLException {
              String sql = "{ call GET_ITEM_DETAIL(?, ?, ?, ?, ?, ?) }" ;
              try{
                   init(newUserID, newPassword) ;
                   setCallableStatement(getConnection().prepareCall(sql)) ;
                   getCallableStatement().setInt(1, getItemNumber()) ;
                   getCallableStatement().registerOutParameter(2, oracle.jdbc.driver.OracleTypes.CURSOR) ;
                   getCallableStatement().registerOutParameter(3, oracle.jdbc.driver.OracleTypes.INTEGER) ;
                   getCallableStatement().registerOutParameter(4, oracle.jdbc.driver.OracleTypes.VARCHAR);
                   getCallableStatement().registerOutParameter(5, oracle.jdbc.driver.OracleTypes.VARCHAR) ;
                   getCallableStatement().registerOutParameter(6, oracle.jdbc.driver.OracleTypes.VARCHAR) ;
                   getCallableStatement().execute() ;
                   setSqlResult(getCallableStatement().getInt(3)) ;
                   setSqlMessage(getCallableStatement().getString(4)) ;
                   if( getSqlResult() != 0 ){
                        throw new SQLException(getSqlMessage(), null, getSqlResult()) ;
                   setResultSet((java.sql.ResultSet) getCallableStatement().getObject(2)) ;
                   if( getResultSet() != null ){
                        while( getResultSet().next() ){
                             setItemType(getResultSet().getString("ITEM_TYPE")) ;
                             setItemValue(getResultSet().getString("ITEM_VAL")) ;
                             setDisplayType(getCallableStatement().getString(5)) ;
                             setDisplaySize(Integer.parseInt(getCallableStatement().getString(6))) ;
              catch(SQLException e){
                   java.util.Date now = new java.util.Date() ;
                   java.text.DateFormat format = java.text.DateFormat.getInstance() ;
                   setSqlMessage( e.getClass().getName() + " : " + format.format(now) + " : " + e.getMessage() + " : IN " + getClass().getName() ) ;
                   System.err.println(getSqlMessage()) ;
                   throw e ;
              finally{
                   closeResources() ;
         }The GET_ITEM_DETAIL stored procedure returns several out parameters of various types. The code registers them as out parameters along with an anticipated type and then calls the getXXX(n) method that corresponds with that data type in the appropriate position.
    As I mentioned in my other post, the onus of returning the XML is on the stored procedure, when you get it into Java it's going to be a java.lang.String that you can then parse by whatever means is appropriate to your situation.
    Regards,

  • JDBC receiver adapter to call MS SQLServer stored procedure with parameters

    We are trying to use the JDBC receiver adapter to call a stored procedure in MS SQLServer with parameters.  According to the help documentation for the JDBC receiver adapter for action=EXECUTE,  "The elements within the stored procedure are interpreted as parameters" and "The parameter names must be identical to those of the stored procedure definition".  The parameters within a MS SQLServer stored procedure are required to begin with the '@' symbol.  The element names within a XML document i.e. used to call the stored procedure can not contain a special character such as '@' in the first position.  For all of the tests we have done where the parameter name in the XML document omits the '@' character, the parameters are not being received by the stored procedure.  Is there a way around this  problem?
    Thank you,
    Harold

    Hello Harold - I am facing the EXACTLY SAME problem.Pls let me know how did you fix this problem ?
    This is the message I am passing on to the DB SP:
    <?xml version="1.0" encoding="UTF-8"?>
    <MRIRequestInbound>
       <StatementName>
          <prc_FC_InsertStagingJournalEntries action="EXECUTE"/>
          <JournalData isInput="true" type="STRING">
    <NewDataSet><Table ITEM = "" ENTITYID = "" PERIOD = "" ACCTNUM = "" DEPARTMENT = "" JOBCODE = "" AMT = "" REF = "" DESCRPN = "" ENTRDATE = "" BASIS = " " BALFOR = "N" REQUESTNUM = "" ACCTNAME = "" TYPE = "" DESCRPTN = "" GDEP_DESCRPN = "" GJOB_DESCRPTN = "" JOBTYPE = ""  /></NewDataSet>
    </JournalData>
       </StatementName>
    </MRIRequestInbound>
    Out of which,
    <NewDataSet> tag contains the value of the parameter in the SP. So, my value to the SP's parameter is :
    <NewDataSet><Table ITEM = "" ENTITYID = "" PERIOD = "" ACCTNUM = "" DEPARTMENT = "" JOBCODE = "" AMT = "" REF = "" DESCRPN = "" ENTRDATE = "" BASIS = " " BALFOR = "N" REQUESTNUM = "" ACCTNAME = "" TYPE = "" DESCRPTN = "" GDEP_DESCRPN = "" GJOB_DESCRPTN = "" JOBTYPE = ""  /></NewDataSet>
    Any clue ?
    Cheers,
    Amrish.

  • Oracle Developer Tools Stored Procedures with input parameters.

    I have created packages with stored procedures that contain input parameters. Am I required to write my own VB code in visual studio .net to define input parameters and their values in using these packages or am I able to drag and drop the packages and use the wizards.

    If you drag and drop a procedure that has input parameters the wizard will generate code that creates parameter objects. You will need to assign appropriate values to those parameters after they are created to use them.
    - Mark

  • Parameters in stored procedure

    If I need to call a stored procedure with 6 input parameters and 6 output parameters, how would I do this? Would it look like this?...
    cstmt = con.prepareCall("{?, ?, ?, ?, ?, ? = CALL MKTDS22B (?, ?, ?, ?, ?, ?)}");
    or this?...
    cstmt = con.prepareCall("(CALL MKTDS22B (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,?))" );
    Please help! Thanks!

    Version 2 is correct. A parameter to the left of the equals sign is for (the one and only) return code value from the procedure as issued by the return statement.

  • Power Pivot- calling stored procedure with parameters

    Hi,
    Can I use stored procedure as datasource in powerpivot. Stored procedure will have 3 parameters which needs to be passed.
    I need to fetch the parameter values at run time and pass to stored procedure.
    Is this possible?

    Hello,
    Yes, it's possible. In PowerPivot Window click on "From Database" => "From SQL Server", in the Wizard select "Write a query that will specify the data to import" and then enter the call for the stored procedure, here an example for "AdventureWorks":
    EXEC [dbo].[uspGetWhereUsedProductID] @StartProductID = 1, @CheckDate = N'1/1/2015'
    Later you can modify the SP call via function "Table properties":
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to use Parameterized Stored Procedure in OBIEE 10 g..?

    Hi All,
    In my rpd, to load the data in the Physical layer, I'm using a Stored Procedure (*SQL Server Stored Procedure*).
    This stored procedure is using some parameters, so my intention is
    1) Provide prompts for each parameter
    2) Allow the user to select parameter value from the prompt
    Can some one let me know if this is possible and if so how to do this.
    Thanks in Advance
    Mithun

    Dear,
    In report triggers you can write your procedure/functions or call it like
    function AfterPForm return boolean is
    begin
    myprocedure(:mydate);
    return (TRUE);
    end;
    Thanks
    Jamil

  • Should Output parameters always be declare at the beginning of the Stored Procedure?

    Should Output parameters always be declare at the beginning of the Stored Procedure?

    Usually input parameters listed first followed by output parameters. This is just a custom, not a requirement.
    Blog: How to architect stored procedure parameters?
    BOL: http://msdn.microsoft.com/en-us/library/ms187926.aspx
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Using stored procedures that take parameters

    I'm trying to invoke (MSSQL) stored procedures from Visual Composer. I've got the tool to see the procedures, but when the data service definition is created, there are no inputs, even though the procedures take parameters. When I run the Test Data Service wizard and press execute, I get an error saying a parameter wasn't provided. The input area on the left of the wizard window shows no input parameters and if I click the add button, I get nothing.
    Am I doing something wrong?
    Thanks.

    Hi
    I think you should check the stored procedure. If the stored procedure defines the input parameters correctly or not.
    Regards
    Inder

Maybe you are looking for