Invoking ORACLE Stored Procedure

Hello guys,
I have an ORACLE stored procedure which I need to invoke. I'm currently unable to invoke the stored procedure since I'm always getting the same error:
com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'test.set_pickup' (structure 'STATEMENTNAME'): java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'SET_PICKUP' ORA-06550: line 1, column 7: PL/SQL: Statement
I've faced several projects where we needed to invoke stored procedures but these were located in a DB2 or Microsoft SQL Server, and these problems never occured.
The procedure is set to the minimum, and is now only with one input parameter. I had an input and output parameter but for narrowing the problem I've removed the output.
The structure for the stored procedure is the one that is referred by SAP or mentioned thousand of times in this forum:
Statement_name
StoredProcedureName (attribute ACTION)
  TABLE
  P_TRANSACTION_ID (Attributes isInput, isOutput, type)
For the basics I'm only filling with one statement.
I've read some threads with a similar problem but with no response, or solved but with no suggestion on how they solved it.
Could you please help out?
Kind regards,
Gonçalo Mouro Vaz

Hi,
Is the structure in Oracle side is of the following format?
<StatementName>
<storedProcedureName action=u201D EXECUTEu201D>
    <table>realStoredProcedureeName</table>
<param1 [isInput=u201Dtrueu201D] [isOutput=true] type=SQLDatatype>val1</param1>
</storedProcedureName >
  </StatementName>
Can you paste the structure here?
Regards
Suraj

Similar Messages

  • Invoking Oracle stored procedures from within a JDBC channel for PI 7.1

    Hi ,
    Can anybody tell me that is it possible to invoke Oracle stored Procedure from within a JDBC  sender channel for PI 7.1.
    Its working in XI3.0 and XI 7.0 for Oracle DBMS versions >= 10.2.x. But I am not sure,whether it will work for PI 7.1 also.
    Thanks & Regards,
    Saru

    HI,
    refer below link,there is no much difference in PI7.1 ,executing stored procedure is same .
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b72b2fde93673e10000000a114a6b/content.htm
    Regards,
    Raj

  • How to invoke Oracle stored procedures in Web Intelligence Custom SQL ?

    Hi,
    Referring to some older posts, I see that there is a work around to invoke a stored procedure to return results for a Web Intelligence report. Its been posted for calling a MS SQL stored proc, whereas the mentioned method does not seem to work for an Oracle Stored Procedure.
    Steps I followed:
    a) This is the parameter I have added in the oracle.sbo file => <Parameter Name="Force SQLExecute">Procedures</Parameter>
    b) My stored procedure code is as follows:
    CREATE OR REPLACE PROCEDURE get_emp_details(var_first_name OUT VARCHAR) AS
    BEGIN
    SELECT first_name INTO var_first_name
    FROM EMP_DETAILS_VIEW
    WHERE EMPLOYEE_ID = 100;
    END;
    c) Custom SQL code I added in my Webi report:
    set nocount on;
    /* SELECT
    EMP_DETAILS_VIEW.FIRST_NAME
    FROM
    EMP_DETAILS_VIEW
    exec get_emp_details;
    On trying to validate the SQL it gives me the following error message: "The SQL query has 0 instead of 1 columns.(WIS 10810)"
    Has anyone been able to successfully call an Oracle Stored procedure using the above method ?
    Version of BO: XI R3 SP2
    Oracle version: 11gR2
    PS: I am aware that web intelligence since XI R3.1 does allow use of a dedicated Stored Procedure Universe. I would want to know if it could
    be made to run in a normal Universe(not a stored procedure Universe)
    Thanks for your time and inputs.
    Regards,
    Jez

    EXECUTE is a SQL Plus command. You can directly call SP in PL/SQL
    DECLARE
        modif number;
    BEGIN
    select data_length into modif from user_tab_columns where table_name='CONTROL' and column_name='POSITION';
    IF modif < 10 THEN
        droptable('CONTROL');
        execute immediate('CRETAE TABLE CONTROL ....';
    ...

  • Physical service to invoke Oracle stored procedure taking an object type

    Hello,
    I have some stored procedures in Oracle that take a complex object type as parameters. Can I invoke these directly from ODSI? If so, how do I create the physical service for this?
    Example:
    CREATE OR REPLACE TYPE "CCSUSERDV"."TEST_TYPE" as object (
    name varchar2(80),
    text varchar2(1000),
    some_other number
    CREATE OR REPLACE PACKAGE CCSUSERDV.TEST
    as
    function joinText(inVal in TEST_TYPE) return varchar2;
    end;
    CREATE OR REPLACE PACKAGE BODY CCSUSERDV.TEST
    AS
    FUNCTION joinText(inVal in TEST_TYPE) return varchar2 AS
    BEGIN
    if (inVal.text is not null) then
    return inVal.name || '-' || inVal.text;
    else
    return inVal.name || ':' || inVal.some_other;
    end if;
    END;
    END;
    I Want to be able to call TEST.joinText from OSDI. I know I could create a separate function that takes all the attributes of my object, but it would be considerably more convenient to implement in terms of the object instead, because there are several functions that take the same set of about 20 fields as a request.
    Thank you!!
    Jeff

    (1) Your best bet is to create a wrapper stored procedure that takes simple arguments and constructs the object, then calls your stored procedure with the object. You call the wrapper stored procedure from ODSI. JPublisher can create wrapper stored procedures for you.
    (2) If it is impossible for you to create a wrapper stored procedure in the database, you can create a physical data service from the existing stored procedure. You will notice that the function in the physical data service will have simple arguments (not the object), and if you try to execute it, it will fail. It's up to you to write an anonymous pl/sql block that wraps the existing stored procedure (basically what you would have had to write for (1)), and edit the metadata in the physical ds - where it has the name of the stored procedure, replace the name with your anonymous PL/SQL block.
    Below is what the CREATE_BATCH stored procedure from Oracle Process Manufacturing would look like. (it also has CURSOR args - so it is uglier than just Objects). It also demonstrates that you need to do a conversion of boolean args.
    xquery version "1.0" encoding "WINDOWS-1252";
    (::pragma xds <x:xds xmlns:x="urn:annotations.ld.bea.com" targetType="t:CERTIFY_BATCH" xmlns:t="ld:JdbcTest4DataServices/opm/CERTIFY_BATCH">
    <creationDate>2007-01-14T20:55:37</creationDate>
    <relationalDB dbVersion="10" dbType="oracle" name="oracleXeDataSource"/>
    </x:xds>::)
    declare namespace f1 = "ld:JdbcTest4DataServices/opm/CERTIFY_BATCH";
    import schema namespace t1 = "ld:JdbcTest4DataServices/opm/CERTIFY_BATCH" at "ld:JdbcTest4DataServices/opm/schemas/CERTIFY_BATCH.xsd";
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" kind="read" nativeName="DECLARE p_batch_header gme_batch_header%rowtype; x_batch_header gme_batch_header%rowtype; x_unallocated_material gme_api_pub.unallocated_materials_tab; TYPE rc IS REF CURSOR; PROCEDURE to_ref_cursor(x IN gme_api_pub.unallocated_materials_tab, ref_cursor IN OUT rc) IS l_data bea_unallocated_materials_tab := bea_unallocated_materials_tab(); BEGIN FOR i IN x.FIRST .. x.LAST LOOP l_data.EXTEND; l_data(i) := bea_unallocated_materials_type(x(i).batch_id, x(i).batch_no, x(i).material_detail_id, x(i).line_type, x(i).line_no, x(i).item_id, x(i).item_no, x(i).alloc_qty, x(i).unalloc_qty, x(i).alloc_uom); END LOOP; OPEN ref_cursor FOR SELECT * FROM TABLE ( CAST (l_data AS bea_unallocated_materials_tab) ); END; FUNCTION to_boolean(n IN NUMBER) RETURN BOOLEAN IS BEGIN IF (n = 0) THEN RETURN FALSE; ELSE RETURN TRUE; END IF; END to_boolean;BEGIN p_batch_header.batch_id := ?; p_batch_header.batch_no := ?; p_batch_header.plant_code := ?; p_batch_header.batch_type := ?; p_batch_header.actual_start_date := ?; p_batch_header.actual_cmplt_date := ?; gme_api_pub.certify_batch( p_api_version => ?, p_validation_level => ?, p_init_msg_list => to_boolean(?), p_commit => to_boolean(?), x_message_count => ?, x_message_list => ?, x_return_status => ?, p_del_incomplete_manual => to_boolean(?), p_ignore_shortages => to_boolean(?), p_batch_header => p_batch_header, x_batch_header => x_batch_header, x_unallocated_material => x_unallocated_material ); ? := x_batch_header.batch_id; ? := x_batch_header.batch_no; ? := x_batch_header.plant_code; ? := x_batch_header.batch_type; ? := x_batch_header.actual_start_date; ? := x_batch_header.actual_cmplt_date; ? := x_batch_header.plan_start_date; ? := x_batch_header.plan_cmplt_date; ? := x_batch_header.due_date; ? := x_batch_header.recipe_validity_rule_id; ? := x_batch_header.wip_whse_code; to_ref_cursor(x_unallocated_material, ?);END;" nativeLevel2Container="" nativeLevel3Container="" style="storedProcedure">
    <params xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes" xmlns:pn1="ld:JdbcTest4DataServices/opm/CERTIFY_BATCH" >
    <param name="BATCH_ID" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="BATCH_NO" kind="in" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="PLANT_CODE" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="BATCH_TYPE" kind="in" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="ACTUAL_START_DATE" kind="in" xqueryType="xs:dateTime" nativeTypeCode="93" nativeType="DATE"/>
    <param name="ACTUAL_CMPLT_DATE" kind="in" xqueryType="xs:dateTime" nativeTypeCode="93" nativeType="DATE"/>
    <param name="P_API_VERSION" kind="in" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="P_VALIDATION_LEVEL" kind="in" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="P_INIT_MSG_LIST" kind="in" xqueryType="xs:integer" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="P_COMMIT" kind="in" xqueryType="xs:integer" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="X_MESSAGE_COUNT" kind="out" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="X_MESSAGE_LIST" kind="out" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="X_RETURN_STATUS" kind="out" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="P_DEL_INCOMPLETE_MANUAL" kind="in" xqueryType="xs:integer" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="P_IGNORE_SHORTAGES" kind="in" xqueryType="xs:integer" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="BATCH_ID" kind="out" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="BATCH_NO" kind="out" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="PLANT_CODE" kind="out" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="BATCH_TYPE" kind="out" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="ACTUAL_START_DATE" kind="out" xqueryType="xs:dateTime" nativeTypeCode="93" nativeType="DATE"/>
    <param name="ACTUAL_CMPLT_DATE" kind="out" xqueryType="xs:dateTime" nativeTypeCode="93" nativeType="DATE"/>
    <param name="PLAN_START_DATE" kind="out" xqueryType="xs:dateTime" nativeTypeCode="93" nativeType="DATE"/>
    <param name="PLAN_CMPLT_DATE" kind="out" xqueryType="xs:dateTime" nativeTypeCode="93" nativeType="DATE"/>
    <param name="DUE_DATE" kind="out" xqueryType="xs:dateTime" nativeTypeCode="93" nativeType="DATE"/>
    <param name="RECIPE_VALIDITY_RULE_ID" kind="out" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="WIP_WHSE_CODE" kind="out" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="X_UNALLOCATED_MATERIAL" kind="out" xqueryType="pn1:X_UNALLOCATED_MATERIAL_ROW" nativeTypeCode="-10" nativeType="REF CURSOR"/>
    </params>
    </f:function>::)
    declare function f1:CERTIFY_BATCH($p_batch_header_batch_id as xsd:string, $p_batch_header_batch_no as xsd:decimal, $p_batch_header_plant_code as xsd:string, $p_batch_header_batch_type as xsd:decimal, $p_batch_header_actual_start_date as xsd:dateTime, $p_batch_header_actual_cmplt_date as xsd:dateTime, $p_api_version as xsd:decimal, $p_validation_level as xsd:decimal, $p_init_msg_list as xsd:integer, $p_commit as xsd:integer, $p_del_incomplete_manual as xsd:integer, $p_ignore_shortages as xsd:integer) as schema-element(t1:CERTIFY_BATCH) external;

  • Dynamic SQL and Oracle stored procedures

    Does anybody has any experience with invoking an Oracle stored procedures
    with output parameters, using dynamic SQL from Forte?
    Thanks,
    Dimitar

    I would be interested. We are currently using a homegrown DataMapper architecture with the Microsoft OracleClient. I would like to move to ODP.Net once a production version supporting ADO.Net 2.0 is available. After that, I would then like to look at using an off the shelf persistence framework such as EntitySpaces, NHibernate or IdeaBlade's DevForce.

  • Passing Arrays of User Defined Types to Oracle Stored Procedures

    Hi
    I am using WebLogic 8.14 & Oracle 9i with thin JDBC driver.
    Our application needs to perform the same DB operation for every item in a Java Collection. I cannot acheive the required performance using the standard Prepare & Execute loop and so I am looking to push the whole collection to Oracle in a single invocation of a Stored Procedure and then loop on the database.
    Summary of Approach:
    In the Oracle database, we have defined a Object Type :
    CREATE OR REPLACE
    TYPE MYTYPE AS OBJECT
    TxnId VARCHAR2(40),
    Target VARCHAR2(20),
    Source VARCHAR2(20),
    Param1 VARCHAR2(2048),
    Param2 VARCHAR2(2048),
    Param3 VARCHAR2(2048),
    Param4 VARCHAR2(2048),
    Param5 VARCHAR2(2048),
    and we have defined a collection of these as:
    CREATE OR REPLACE
    TYPE MYTYPE_COLLECTION AS VARRAY (100) OF MYTYPE
    There is a stored procedure which takes one of these collections as an input parameter and I need to invoke these from within my code.
    I am having major problems when I attempt to get the ArrayDescriptor etc to allow me to create an Array to pass to the stored procedure. I think this is because the underlying Oracle connection is wrapped by WebLogic.
    Has anyone managed to pass an array to an Oracle Stored procedure on a pooled DB connection?
    Thanks
    Andy

    Andy Bowes wrote:
    Hi
    I am using WebLogic 8.14 & Oracle 9i with thin JDBC driver.
    Our application needs to perform the same DB operation for every item in a Java Collection. I cannot acheive the required performance using the standard Prepare & Execute loop and so I am looking to push the whole collection to Oracle in a single invocation of a Stored Procedure and then loop on the database.
    Summary of Approach:
    In the Oracle database, we have defined a Object Type :
    CREATE OR REPLACE
    TYPE MYTYPE AS OBJECT
    TxnId VARCHAR2(40),
    Target VARCHAR2(20),
    Source VARCHAR2(20),
    Param1 VARCHAR2(2048),
    Param2 VARCHAR2(2048),
    Param3 VARCHAR2(2048),
    Param4 VARCHAR2(2048),
    Param5 VARCHAR2(2048),
    and we have defined a collection of these as:
    CREATE OR REPLACE
    TYPE MYTYPE_COLLECTION AS VARRAY (100) OF MYTYPE
    There is a stored procedure which takes one of these collections as an input parameter and I need to invoke these from within my code.
    I am having major problems when I attempt to get the ArrayDescriptor etc to allow me to create an Array to pass to the stored procedure. I think this is because the underlying Oracle connection is wrapped by WebLogic.
    Has anyone managed to pass an array to an Oracle Stored procedure on a pooled DB connection?
    Thanks
    AndyHi. Here's what I suggest: First please get the JDBC you want to work in a
    small standalone program that uses the Oracle thin driver directly. Once
    that works, show me the JDBC code, and I will see what translation if
    any is needed to make it work with WLS. Will your code be running in
    WebLogic, or in an external client talking to WebLogic?
    Also, have you tried the executeBatch() methods to see if you can
    get the performance you want via batches?
    Joe

  • Call to Oracle stored procedure that returns ref cursor doesn't work

    I'm trying to use an OData service operation with Entity Framework to call an Oracle stored procedure that takes an number as an input parameter and returns a ref cursor. The client is javascript so I'm using the rest console to test my endpoints. I have been able to successful call a regular Oracle stored procedure that takes a number parameter but doesn't return anything so I think I have the different component interactions correct. When I try calling the proc that has an ref cursor for the output I get the following an error "Invalid number or type of parameters". Here are my specifics:
    App.config
    <oracle.dataaccess.client>
    <settings>
    <add name="PGDATA_WC.ODATAPOC.GETWORKORDERSBYWINDFARMID.RefCursor.P_RESULTS" value="implicitRefCursor bindinfo='mode=Output'" />
    <add name="PGDATA_WC.ODATAPOC.GETWORKORDERSBYWINDFARMID.RefCursorMetaData.P_RESULTS.Column.0" value="implicitRefCursor metadata='ColumnName=WINDFARM_ID;BaseColumnName=WINDFARM_ID;BaseSchemaName=PGDATA_WC;BaseTableName=WORKORDERS;NATIVEDATATYPE=Number;ProviderType=Int32'" />
    <add name="PGDATA_WC.ODATAPOC.GETWORKORDERSBYWINDFARMID.RefCursorMetaData.P_RESULTS.Column.1" value="implicitRefCursor metadata='ColumnName=STARTTIME;BaseColumnName=STARTTIME;BaseSchemaName=PGDATA_WC;BaseTableName=WORKORDERS;NATIVEDATATYPE=Varchar2;ProviderType=Varchar2'" />
    <add name="PGDATA_WC.ODATAPOC.GETWORKORDERSBYWINDFARMID.RefCursorMetaData.P_RESULTS.Column.2" value="implicitRefCursor metadata='ColumnName=ENDTIME;BaseColumnName=ENDTIME;BaseSchemaName=PGDATA_WC;BaseTableName=WORKORDERS;NATIVEDATATYPE=Varchar2;ProviderType=Varchar2'" />
    <add name="PGDATA_WC.ODATAPOC.GETWORKORDERSBYWINDFARMID.RefCursorMetaData.P_RESULTS.Column.3" value="implicitRefCursor metadata='ColumnName=TURBINE_NUMBER;BaseColumnName=TURBINE_NUMBER;BaseSchemaName=PGDATA_WC;BaseTableName=WORKORDERS;NATIVEDATATYPE=Varchar2;ProviderType=Varchar2'" />
    <add name="PGDATA_WC.ODATAPOC.GETWORKORDERSBYWINDFARMID.RefCursorMetaData.P_RESULTS.Column.4" value="implicitRefCursor metadata='ColumnName=NOTES;BaseColumnName=NOTES;BaseSchemaName=PGDATA_WC;BaseTableName=WORKORDERS;NATIVEDATATYPE=Varchar2;ProviderType=Varchar2'" />
    <add name="PGDATA_WC.ODATAPOC.GETWORKORDERSBYWINDFARMID.RefCursorMetaData.P_RESULTS.Column.5" value="implicitRefCursor metadata='ColumnName=TECHNICIAN_NAME;BaseColumnName=TECHNICIAN_NAME;BaseSchemaName=PGDATA_WC;BaseTableName=WORKORDERS;NATIVEDATATYPE=Varchar2;ProviderType=Varchar2'" />
    <add name="PGDATA_WC.ODATAPOC.GETWORKORDERSBYID.RefCursor.P_RESULTS" value="implicitRefCursor bindinfo='mode=Output'" />
    </settings>
    OData Service Operation:
    public class OracleODataService : DataService<OracleEntities>
    // This method is called only once to initialize service-wide policies.
    public static void InitializeService(DataServiceConfiguration config)
    // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
    // Examples:
    config.SetEntitySetAccessRule("*", EntitySetRights.All);
    config.SetServiceOperationAccessRule("GetWorkOrdersByWindfarmId", ServiceOperationRights.All);
    config.SetServiceOperationAccessRule("CreateWorkOrder", ServiceOperationRights.All);
    config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
    [WebGet]
    public IQueryable<GetWorkOrdersByWindfarmId_Result> GetWorkOrdersByWindfarmId(int WindfarmId)
    return this.CurrentDataSource.GetWorkOrdersByWindfarmId(WindfarmId).AsQueryable();
    [WebGet]
    public void CreateWorkOrder(int WindfarmId)
    this.CurrentDataSource.CreateWorkOrder(WindfarmId);
    Here is the stored procedure:
    procedure GetWorkOrdersByWindFarmId(WINDFARMID IN NUMBER,
    P_RESULTS OUT REF_CUR) is
    begin
    OPEN P_RESULTS FOR
    select WINDFARM_ID,
    STARTTIME,
    ENDTIME,
    TURBINE_NUMBER,
    NOTES,
    TECHNICIAN_NAME
    from WORKORDERS
    where WINDFARM_ID = WINDFARMID;
    end GetWorkOrdersByWindFarmId;
    I defined a function import for the stored procedure using the directions I found online by creating a new complex type. I don't know if I should be defining the input parameter, WindfarmId, in my app.config? If I should what would that format look like? I also don't know if I'm invoking the stored procedure correctly in my service operation? I'm testing everything through the rest console because the client consuming this information is written in javascript and expecting a json format. Any help is appreciated!
    Edited by: 1001323 on Apr 20, 2013 8:04 AM
    Edited by: jennyh on Apr 22, 2013 9:00 AM

    Making the change you suggested still resulted in the same Oracle.DataAccess.Client.OracleException {"ORA-06550: line 1, column 8:\nPLS-00306: wrong number or types of arguments in call to 'GETWORKORDERSBYWINDFARMID'\nORA-06550: line 1, column 8:\nPL/SQL: Statement ignored"}     System.Exception {Oracle.DataAccess.Client.OracleException}
    I keep thinking it has to do with my oracle.dataaccess.client settings in App.Config because I don't actually put the WindfarmId and an input parameter. I tried a few different ways to do this but can't find the correct format.

  • Problem in calling Oracle stored procedure from Java.

    I am trying to invoke the Oracle stored procedure from Java. The procedure does not take any parameters and does not return anything. If I call it from SQL prompt it is working perfectly. I am calling it in my program as follows.
    callable_stmt=con.prepareCall("{call pkg_name.proc_name()}");
    callable_stmt.execute();
    The problem is the control-of-flow is getting strucked in the second line I wrote. It is not giving any error also.
    Please clarify me what's wrong with my code?
    Seenu.

    And how long does the stored procedure take to run from your client machine when running it via sqlplus?

  • Oracle Stored Procedure not working

    Hi Guy's,
    I want to connect directly from Visual Composer to Oracle Database 10.2.x.x using Oracle Stored Procedure and JDBC System to demonstrate how easy you can show data vith VC. So I have created a simple Oracle Stored Procedure, a JDBC System with a valid alias, User mapping (Portal User --> Oracle User).
    When I invoke the stored procedure I receive the following error: "Portal request Failed (Could not execute stored procedure)". The Stored Procedure is working fine in Oracle iSQL*Plus.
    Any idea's?
    Thanks,
    Ridouan

    Hi,
    did you use the portal JDBC as it is described here:
    <a href="https://wiki.sdn.sap.com/wiki/display/VC/Cannotseetables">https://wiki.sdn.sap.com/wiki/display/VC/Cannotseetables</a>
    Best Regards,
    Marcel

  • Executing an oracle stored procedure in xMII 11.5

    Dear all,
          I am facing problem executing an oracle stored procedure using sql query in MII. The SP does not have any input or output parameters & consists of only 2 insert statements. I tried to use Command Mode, FixedQuery & FixedQuery With output mode, but the SP doesn't run.
    This is the error i get when i use :
    execute InsertTest or exec InsertTest -  A SQL Error has occurred on query, ORA-00900: invalid SQL statement
    I read in one of the posts to use 'CALL' instead of 'exec' or 'execute'. Even with this i get error which states:
    A SQL Error has occurred on query, ORA-06576: not a valid function or procedure name
    The syntax i used is CALL InsertTest  -  'InsertTest' is the SP name.
    I also checked Sam's comment in one of the posts about jdbc driver. We are using oracle 9i, so i guess there is no problem with the version of DB.
    The stored procedure is working fine in SQL Developer, How else can i invoke the SP in MII?
    Any help would be greatly appreciated.
    Thanks,
    Sushma.

    Hi all,
    for insert create procedure
    CREATE PROCEDURE MII_TEST_INSUPD
    (ID_IN IN NUMBER,
    NAME_IN IN VARCHAR2)
    IS
    BEGIN
      -- UPDATE ROW
      UPDATE TEST SET
              NAME = NAME_IN
      WHERE
              ID = ID_IN;
      -- NOT RETURN INSERT NEW LINE IN TABLE
      IF SQL%ROWCOUNT = 0 THEN
         INSERT INTO TEST (ID, NAME) VALUES (ID_IN, NAME_IN);                        
      END IF; 
    END;
    In MII you create a query template
    Mode - Command
    FixedQuery - insert the code below
    CALL MII_TEST_INSUPD ([Param.1],'[Param.2]')
    for returns the grid using procedures in oracle you need create a package on oracle server
    CREATE PACKAGE PKG_test IS
      TYPE cursortype is ref cursor;
      PROCEDURE test (mycursor in out cursortype);
    END PKG_test;
    CREATE PACKAGE BODY PKG_test IS
      PROCEDURE test (mycursor in out cursortype) AS
      BEGIN
         open mycursor for select * from test;
      END;
    END PKG_test;
    In MII you create a query template
    Mode -  FixedQueryWithOutput
    FixedQuery - insert the code below
    CALL PKG_TEST.TEST(?)
    Danilo

  • How to invoke a stored procedure from SubmitEditForm.jsp

    Instead of directly inserting or updating
    the data I would like to invoked
    the stored procedure.
    Has anybody done this?

              Sam,
              BEA provides examples that are shipped with the product under
              <beahome>\weblogic700\samples\server\src\examples\
              Look at the jsp directory for JSP examples that access a database and look at
              say the jdbc\oracle\storedprocs.java for an example of java code calling out to
              a stored procedure - - by combining one of the jsp database examples with this
              stored procedure example you should be 'good to go'
              Chuck Nelson
              DRE
              BEA Technical Support
              

  • Help Required on Cross Referencing with Oracle Stored Procedure

    Hi Experts,
       I have a requirement which is having the requirements as follow,
    Web Application initially sends a request number to SAP ECC to fetch the response details through SAP PI (HTTP to RFC u2013 Synchronous). While fetching the response from SAP ECC system, SAP PI has to invoke a Oracle Stored Procedure based on some parameter from SAP ECC System and then composited data has to send back to Web Application by SAP PI.
    Request you to kindly suggest how to achieve the above.  JDBC lookup is not much extended to call stored procedure. It would be helpful if it will be a step by step as I am novice to SAP PI.
    Regards
    Archana

    you might very well have to use a BPM.
    open a sync/async bridge ->
    do a sync call to RFC ->
    Do a sync call to DB (use SP here) ->
    do a transformation from the response message of RFC and Response of DB (N:1) to for your response to original caller (http)
    Close the sync async bridge using the response message

  • Problem with calling a oracle stored procedure

    Hi,
    I am using the following callable statement to invoke a oracle stored procedure/function.
    String myCallableStmt="{?=call IB_DDL.CREATE_DATASET(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
    But I am getting the following errors which do not make sense to me
    Exception in thread "main" java.lang.NullPointerException
         at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:870)
         at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:956)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1159)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3389)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4222)
         at org.jtdemo.CreateDataSet.callCreateDatasetProcedure(CreateDataSet.java:246)
         at org.jtdemo.Main.main(Main.java:29)
    Can anyone help me here.
    Thanks in advance
    Kalyan

    May be I have used the word "procedure" loosely. Its infact a oracle function which returns a message of type Varchar2. Hence "{?=.....} here is used for registering the return value from the function. The remaining statement CREATE_DATASET(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?), here the first 14 are input parameters whereas the last one is the OUT parameter of the function. Hope this helps. Anways I am pasting my code below...
    CallableStatement cstmt = null;
              String myCallableStmt="{?=call IB_DDL.CREATE_DATASET(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
              try {
                   System.out.print("Creating DataSet.......\n");
                   cstmt = targetCon.prepareCall(myCallableStmt);
                   cstmt.setObject("USER_ID_IN",this.USER_ID_IN);
                   cstmt.setObject("TABLE_NAME_IN",this.TABLE_NAME_IN);
                   cstmt.setObject("LAYOUT_IN",this.layoutCollection);
                   cstmt.setObject("DATA_TABLESPACE_IN",this.DATA_TABLESPACE_IN);
                   cstmt.setObject("INDEX_TABLESPACE_IN",this.INDEX_TABLESPACE_IN);
                   cstmt.setObject("STRING_POOL_NAME_IN",this.STRING_POOL_NAME_IN);
                   cstmt.setObject("NUMBER_POOL_NAME_IN",this.NUMBER_POOL_NAME_IN);
                   cstmt.setObject("DATE_POOL_NAME_IN",this.DATE_POOL_NAME_IN);
                   cstmt.setObject("LINK_POOL_NAME_IN",this.LINK_POOL_NAME_IN);
                   cstmt.setObject("DATASET_LEVEL_CONSTR_TYPE",this.DATASET_LEVEL_CONSTR_TYPE);
                   cstmt.setObject("DATASET_LEVEL_CONSTR_BODY",this.DATASET_LEVEL_CONSTR_BODY);
                   cstmt.setObject("POOLING_IN",this.POOLING_IN);
                   cstmt.setObject("SEGMENTATION_IN",this.SEGMENTATION_IN);
                   cstmt.setObject("DATASET_PARTITIONING_IN",this.DATASET_PARTITIONING_IN);
                   cstmt.registerOutParameter("DATASET_ID_OUT",OracleTypes.INTEGER);
                   cstmt.registerOutParameter("RETURN_MESSAGE",OracleTypes.VARCHAR);
                   cstmt.execute();
                   String returnMessage = (String)cstmt.getObject("RETURN_MESSAGE");
                   System.out.print(returnMessage);
              }catch(SQLException e) {
                   e.printStackTrace();
              }

  • Calling OLE API from Oracle Stored Procedure

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

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

  • Shell script invoke from stored procedure

    Hi All,
    Can anyone tell me how to call UNIX SHELL SCRIPT from oracle stored procedure PL/SQL. Example with detailed explanation.
    Please Share the needful.
    Thanks in Advance
    Pricks

    Here, The example is given below, I want to invoke the Script which i mentioned like HERE INVOKE THE ABOVE SHELL SCRIPT in that place.
    CREATE OR REPLACE PROCEDURE spwritelog
         inFileName               VARCHAR2,
         inLogMsg               VARCHAR2,
         inLogLevel               CHAR(1),
         outRc OUT NUMBER
    AS
    tmpMsg                VARCHAR2(255);
    BEGIN
    outRc := 0;
         IF inLogLevel = 'X' THEN
              tmpMsg := "echo `date +'%Y-%m-%d %H:%M:%S'` ' " || inLogMsg || "' >> " || inFileName;
         HERE INVOKE THE ABOVE SHELL SCRIPT
         ELSIF inLogLevel = "9" THEN
              tmpMsg := "echo `date +'%Y-%m-%d %H:%M:%S'` ' " || inLogMsg || "' >> /tmp/spAllLog.err";
              HERE INVOKE THE ABOVE SHELL SCRIPT
         END IF;
    EXCEPTION
    WHEN OTHERS THEN
    outRc:=SQLCODE;
    END spwritelog;
    Please correct the code and tell.......
    please share the needful
    Edited by: 866916 on Aug 19, 2011 5:38 PM

Maybe you are looking for

  • Ipod touch wifi isnt connecting

    I am having a problem with my ipod touch i am not able to connect to the wifi, my brothers ipod is working on the wifi but mine isnt, it says 'unale to join the network" can anyone help me??

  • Can't figure out these anomalies.  Driving me nuts.

    The following code for the BouncingBalls assignment results in some anomalies that I can't figure out. The main problem is that there SEEM TO BE different responses: the balls reverse direction at the right and bottom, but not top and left. In the co

  • What is the best way to archive old footage (DVD, VHS, Super 8 etc.)

    Hello, I am starting a huge archiving projet of possibley 100-200 hours of footage from all kinds of sources (VHS tapes, Mini DV, Super 8 film). What is the best way to archive this footage at the highest possible resolution? What sort of file should

  • IPlanet frontend Web Server to backend WebServer

    I am working on a project which has IPlanet 4.1 Web Server on the front end and IPlanet Web Server 6.0 as the middle tier. At the moment we have a front end Servlet which deals withe forwarding requests to the App Server box. Getting the results and

  • GarageBand for voice-overs/production

    Hi all. I currently use ProTools to do voice-over work and audio production at home, and I'm just curious as to how well GarageBand measures up in this area. ProTools is fine, but keeping up with the upgrades and new plug-ins gets expensive...and ann