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

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.

  • Calling Oracle procedure with two OUT parameters

    Hi I am having an Oracle procedure which return ref cursor. I also want to result one more out parameter result. How Can I call the procedure in SQL. Below is the way I am calling my stored procedure with one parameter.
    proc_Test (p_resultset=> My_cursor)
    How can I call the procedure when I have one more OUT parameter. Second parameter returns 0 or 1.
    Thanks in adv

    Yes its possible to use multiple parameter as OUT type in procedure.
    SQL>set serveroutput on size 1000000;
    SQL>CREATE OR REPLACE PROCEDURE myproc(p_cv OUT SYS_REFCURSOR, p_num OUT NUMBER) AS
      2  BEGIN
      3    OPEN p_cv FOR SELECT 'Hello Oracle' sayhello FROM DUAL ;
      4    p_num := 1;
      5  END;
      6  /
    Procedure created.
    SQL>VAR cv REFCURSOR;
    SQL>VAR num NUMBER;
    SQL>EXEC myproc(:cv, :num);
    PL/SQL procedure successfully completed.
    SQL>PRINT cv;
    SAYHELLO
    Hello Oracle
    SQL>PRINT num;
           NUM
             1
    SQL>
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Calling a Procedure with IN & OUT Parameters

    Hello,
    I usually call my procedures using the following way
    declare variable error_msg varchar2(50)
    exec simple_msg('ABC,'ABC','ABC',:error_msg);
    CREATE OR REPLACE PROCEDURE SIMPLE_MSG (
    ID IN VARCHAR2,
    URL IN VARCHAR2,
    LIST IN VARCHAR2,
    ERROR_MSG OUT VARCHAR2
    Now my question is i am trying to call a proc which has IN OUT parameters. Can somebody guide me on how to call the proc. Thanks
    CREATE OR REPLACE PROCEDURE SIMPLE_MSG (
    ID IN VARCHAR2,
    URL IN VARCHAR2,
    LIST IN VARCHAR2,
    NAME IN OUT VARCHAR,
    ERROR_MSG OUT VARCHAR2

    Hi,
    IN OUT parameters are passed just like OUT paramenters: you must pass a variable.
    If you need to set the IN OUT parameter before calling the procedure, then either
    (a) use a separate EXEC command:
    EXEC  :name := 'Original name';
    EXEC  simple_msg ('ABC', 'ABC', 'ABC', :name, :error_msg);or
    (b) use an anonymous PL/SQL block, like this:
    BEGIN
        :name := 'Original name';
        simple_msg ('ABC', 'ABC', 'ABC', :name, :error_msg);
    END;
    /The parameter can be either a bind variable (as shown above), or a local variable (that can be used only in the block).

  • Call stored procedure with OUT parameter

    Hello,
    I have created a short-lived process. Within this process I am using the "FOUNDATION > JDBC > Call Stored Procedure" operation to call an Oracle procedure. This procedure has 3 parameters, 2 IN and 1 OUT parameter.
    The procedure is being executed correctly. Both IN parameters receive the correct values but I am unable to get the OUT parameter's value in my process.
    Rewriting the procedure as a function gives me an ORA-01460 since one of the parameters contains XML (>32K) so this is not option...
    Has someone been able to call a stored procedure with an OUT parameter?
    Regards,
    Nico

    Object is Foundation, Execute Script
    This is for a query, you can change to a stored procedure call. Pull the value back in the Java code then put into the process variable.
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import java.sql.*;
    PreparedStatement stmt = null;
    Connection conn = null;
    ResultSet rs = null;
    try {
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("java:IDP_DS");
    conn = ds.getConnection();
    stmt = conn.prepareStatement("select FUBAR from TB_PT_FUBAR where PROCESS_INSTANCE_ID=?");
    stmt.setLong(1, patExecContext.getProcessDataLongValue("/process_data/@inputID"));
    rs = stmt.executeQuery();
    rs.next();
    patExecContext.setProcessDataStringValue("/process_data/outData", rs.getString(1));
    } finally {
    try {
    rs.close();
    } catch (Exception rse) {}
    try {
    stmt.close();
    } catch (Exception sse) {}
    try {
    conn.close();
    } catch (Exception cse) {}

  • How to call stored procedure with multiple parameters in an HTML expression

    Hi, Guys:
    Can you show me an example to call stored procedure with multiple parameters in an HTML expression? I need to rewrite a procedure to display multiple pictures of one person stored in database by clicking button.
    The orginal HTML expression is :
    <img src="#OWNER#.dl_sor_image?p_offender_id=#OFFENDER_ID#" width="75" height="75">which calls a procedure as:
    procedure dl_sor_image (p_offender_id IN NUMBER)now I rewrite it as:
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number)could anyone tell me the format for the html expression to pass multiple parameters?
    Thanks a lot.
    Sam

    Hi:
    Thanks for your help! Your question is what I am trying hard now. Current procedure can only display one picture per person, however, I am supposed to write a new procedure which displays multiple pictures for one person. When user click a button on report, APEX should call this procedure and returns next picture of the same person. The table is SOR_image. However, I rewrite the HTML expression as follows to test to display the second image.
    <img src="#OWNER#.Sor_Display_Current_Image?p_n_Offender_id=#OFFENDER_ID#&p_n_image_Count=2" width="75" height="75"> The procedure code is complied OK as follows:
    create or replace
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number) AS
        v_mime_type VARCHAR2(48);
        v_length NUMBER;
        v_name VARCHAR2(2000);
        v_image BLOB;
        v_counter number:=0;
        cursor cur_All_Images_of_Offender is
          SELECT 'IMAGE/JPEG' mime_type, dbms_lob.getlength(image) as image_length, image
          FROM sor_image
          WHERE offender_id = p_n_Offender_id;
        rec_Image_of_Offender cur_All_Images_of_Offender%ROWTYPE;
    BEGIN
        open cur_All_Images_of_Offender;
        loop
          fetch cur_All_Images_of_Offender into rec_Image_of_Offender;
          v_counter:=v_counter+1;
          if (v_counter=p_n_image_Count) then
            owa_util.mime_header(nvl(rec_Image_of_Offender.mime_type, 'application/octet'), FALSE);
            htp.p('Content-length: '||rec_Image_of_Offender.image_length);
            owa_util.http_header_close;
            wpg_docload.download_file (rec_Image_of_Offender.image);
          end if;
          exit when ((cur_All_Images_of_Offender%NOTFOUND) or (v_counter>=p_n_image_Count));
        end loop;
        close cur_All_Images_of_Offender;
    END Sor_Display_Current_Image; The procedure just open a cursor to fetch the images belong to the same person, and use wpg_docload.download_file function to display the image specified. But it never works. It is strange because even I use exactly same code as before but change procedure name, Oracle APEX cannot display an image. Is this due to anything such as make file configuration in APEX?
    Thanks
    Sam

  • Problem with database adapter on plsql procedure with in/out parameters

    running BPEL 10.1.3.1 and using the database adapter on a plsql procedure with in/out parameters I get errors
    the plsql procedure:
    create or replace procedure proc_with_clob_inout_parameter(
    p_string in varchar2,
    p_clob in out clob)
    is
    begin
    p_clob := p_string;
    end proc_with_clob_inout_parameter;
    In BPEL I call this procedure. When I only assign a value to the p_string parameters (in a BPEL assign) all is well. When I also assign a value to the p_clob parameter the error occurs:
    <part name="summary">
    <summary>
    file:/ora1/app/oracle/as101.3/bpel/domains/digitaaldossier/tmp/.bpel_janb_inout_1.0_f6908ccf864581b7265c362444e88075.tmp/twee.wsdl
    [ twee_ptt::twee(InputParameters,OutputParameters) ] - WSIF JCA Execute of
    operation 'twee' failed due to: Error while trying to prepare and execute
    an API.
    An error occurred while preparing and executing the
    JANB.PROC_WITH_CLOB_PARAMETER2 API. Cause: java.sql.SQLException: Parameter
    Type Conflict [Caused by: Parameter Type Conflict]
    ; nested exception is:
    ORABPEL-11811
    Error while trying to prepare and execute an API.
    An error occurred while preparing and executing the
    JANB.PROC_WITH_CLOB_INOUT_PARAMETER API. Cause: java.sql.SQLException: Parameter
    Type Conflict [Caused by: Parameter Type Conflict]
    Check to ensure that the API is defined in the database and that the
    parameters match the signature of the API. Contact oracle support if error
    is not fixable.
    </summary>
    </part>
    In BPEL 10.1.2.0 this isn't a problem. I tested it against a 10.2.0.1 and a 10.2.0.2 database and in both situations I get the error with BPEL 10.1.3.1 and no error with BPEL 10.1.2.0
    it appears to be a problem in the database adapter...
    anyone with the same problems and/or a solution?

    Not of any use to you, but we had exactly the same problem on Friday when we applied AS 10.1.2.2 Patchset on top of BPEL 10.1.2.0.2.
    The clob in our pl/sql proc wan't declared as in/out but for some reasons JDeveloper had created a clob on the Output Parameter type in the db partner link xsd. I removed this and it worked. This code had been untouched , and working fine, for months.
    I'll be raising an SR today.
    Rob J

  • Calling Stored Procedure with TestStand to SQL 2000

    When I run the Stored Procedure in the query analyzer it returns the recordset fine. I am not specifying any parameters. I am Using TestStand 2.01 and SQL Server 2000. I am using the OPEN SQL STATEMENT step to call the SP. When I run the SP in TestStand I get no data returned. If I run the SQL statment in TestStand I get the data that I am requesting. Does TestStand not support stored procedures.

    Hi,
    The instructions that I posted were for TestStand 3.0. In version 3.0 you can call stored procedures with input/output paramateres and to support this functionality the data operation step support several new modes.
    TestStand 2.0.1 does not support parameters on stored procedures, but it does support calling stored procedures that do not take parameters. To be able to access the data back from the database you need to set the cursor location (in the Advanced tab of the Open SQL Statement step) to Client (http://digital.ni.com/public.nsf/websearch/0EF68BF97AB1A61F86256B8E007D70C0?OpenDocument).
    By changing the cursor to Client I was able to succesfully call a stored procedure from TestStand 2.0.1 and to read back the recordse
    t return by the database. Please let me know if you are still experiencing dificulties.
    Best regards,
    Alejandro del Castillo
    National Instruments

  • Toplink support for stored procedure with 2 OUT  REF CURSOR ?

    Can Toplink StoredProcedureCall be used with Oracle PLSql procedure with 2 OUT parameters. Parameter type is Ref Cursor (Oracle PLSQL resulset)
    Regards

    In a TopLink StoredProcedureCall using an OUT CURSOR the cursor is assumed to map to the result set for the TopLink query.
    For example if you had a stored procedure READ_ALL_EMP that returned a out cursor of EMP rows, you could use that procedure in a TopLink mapped Employee class mapped to the EMP table and use the stored procedure in a ReadAllQuery for the Employee class.
    If the procedure does not return data that maps to objects, you can use a DataReadQuery to access the data. The out cursor would be returned as a Vector of DatabaseRows that contain the data from the cursor rows.
    If the procedures data is complex and does not map to objects, it may be better to access the procedure directly through JDBC.

  • Reg:execute procedure with in out parameters

    hi,
    what is the code to execute a procedure with in out parameters.can anyone give me an example
    thanks

    872296 wrote:
    thanks for the reply.
    i am very much new to oracle database.i need this code to put in one of my informatica mapping.
    so can you just elaborate what does 'karthick' mean?is it the name of the procedure.No, karthick is the value of the variable that is being passed into the procedure called "P" in karthicks example, then if that procedure changes the value inside, the variable will have that new value passed back out of the procedure to it.
    PROCEDURE prc_mv (name VARCHAR2)
    IS
    BEGIN
    dbms_mview.refresh (mv_name);
    END prc_mv;
    PROCEDURE refresh (response IN OUT NUMBER)
    IS
    BEGIN
    dbms_mview.refresh('mv1','C');
    dbms_mview.refresh('mv2','C');
    response := 1;
    EXCEPTION
    WHEN OTHERS
    THEN
    response := 0;
    END refresh;
    can you give the code for this procedure.Yes.
    DECLARE
      v_response NUMBER;
    BEGIN
      refresh(v_response);
    END;Though your code is awful. There's no point in having the response parameter as an IN OUT if you're not going to pass IN a value and use that in the code anywhere. In your case it only needs to be an OUT parameter because you're just passing back OUT a value. You are also masking any exceptions that happen by using a WHEN OTHERS clause.
    Better code would be something like...
    FUNCTION refresh (mv_name) RETURN NUMBER IS
      v_response NUMBER := 0; -- default response value
      e_mv_not_exist EXCEPTION; -- exception variable
      PRAGMA EXCEPTION_INIT(e_mv_not_exist, -23401); -- connect exception name to internal oracle error number
    BEGIN
      dbms_mview.refresh(mv_name,'C');
      v_response := 1;
    EXCEPTION
      WHEN e_mv_not_exist THEN -- handle specific expected exception
        -- if the materialized view does not exist, handle it gracefully as we don't want to stop
        response := 0;
    END refresh;
    declare
      v_response NUMBER;
    begin
      v_response := refresh('mv1');
      if v_response = 0 then
        -- the materialized view did not exist
      else
        -- the materialized view refreshed ok
      end if;
    end;where your exception handler explicity checks for expected exceptions such as :
    ORA-23401: materialized view "SCOTT"."FRED" does not exist... and any other exceptions that you're not expecting will be raised for you to see.
    It's also better as a function because you don't need to pass in a response value, you just want to get a response value back.
    There's rarely a good need to use OUT or IN OUT parameters. (there's some cases, but it's not something to consider doing as part of your regular design)

  • Database procedure with IN/OUT parameters

    Hi,
    I have a procedure with multiple OUT parameters,
    but I do not know how to get the values of these out parameters in the calling procedure.
    What I mean is I can simply get the value of a function from a calling procedure as:-
    declare
    val1 number;
    begin
    val1 := func_get_num;
    end;
    How can I get the values of OUT parameters of a procedure in a similar way?

    like
    SQL> var ename_v varchar2(30);
    SQL> var empno_v number;
    SQL> create or replace procedure get_employee(empno out number, ename out varchar)
      2  as
      3  begin
      4     select empno, ename into empno, ename from emp where rownum <=1;
      5  end;
      6  /
    Procedure created.
    Elapsed: 00:00:00.51
    SQL> exec get_employee(:empno_v, :ename_v);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.12
    SQL> print empno_v
       EMPNO_V
           666
    SQL> print ename_v;
    ENAME_V
    fdddfdf1
    SQL>

  • Calling stored procedure with output parameters in a different schema

    I have a simple stored procedure with two parameters:
    PROCEDURE Test1(
    pOutRecords OUT tCursorRef,
    pIdNumber IN NUMBER);
    where tCursorRef is REF CURSOR.
    (This procedure is part of a package with REF CURSOR declared in there)
    And I have two database schemas: AppOwner and AppUser.
    The above stored procedure is owned by AppOwner, but I have to execute this stored procedure from AppUser schema. I have created a private synonym and granted the neccessary privileges for AppUser schema to execute the package in the AppUser schema.
    When I ran the above procedure from VB using ADO and OraOLEDB.Oracle.1 driver, I got the following error when connecting to the AppUser schema:
    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
    but when I was connecting to the AppOwner schema, everything is running correctly without errors.
    Also, when I switch to the microsoft MSDAORA.1 driver, I can execute the above procedure without any problems even when connecting to the AppUser schema.
    I got this error only when I am trying to execute a stored procedure with an output parameter. All other procedures with only input parameters have no problems at all.
    Do you know the reason for that? Thanks!

    If anyone has figured this one out let me know. I'm getting the same problem. Only in my case I've tried both the "OraOLEDB.Oracle" provider and the "MSDAORA" provider and I get an error either way. Also my procedure has 2 in parameters and 1 out parameter. At least now I know I'm not the only one with this issue. :)
    '*** the Oracle procedure ***
    Create sp_getconfiguration(mygroup in varchar2, myparameter in varchar2, myvalue out varchar2)
    AS
    rec_config tblconfiguration.configvalue%type;
    cursor cur_config is select configvalue from tblconfiguration where configgroup = mygroup and configparameter = myparameter;
    begin
    open cur_config;
    fetch cur_config into rec_config;
    close cur_config;
    myvalue := rec_config;
    end;
    '** the ado code ****
    dim dbconn as new adodb.connection
    dim oCmd as new adodb.connection
    dim ors as new adodb.recordset
    dbconn.provider = "MSDAORA" 'or dbconn.provider = "OraOLEDB.Oracle"
    dbconn.open "Data Source=dahdah;User ID=didi;Password=humdy;PLSQLRSet=1;"
    set ocmd.activeconnection = dbconn
    cmd.commandtext = "{call fogle.sp_getconfiguration(?,?)}"
    'i've also tried creating a public synonym called getconfiguration and just refering to procedure by that.
    ' "{call getconfiguration(?, ?)}"
    ' "{call getconfiguration(?,?, {resultset 1, myvalue})}"
    'and numerous numerous other combinations
    set oPrm = cmd.createparameter("MYGROUP", advarchar, adparaminput, 50, strGrouptoPassIn$)
    cmd.parameters.append oPrm
    set oPrm = cmd.createParameter("MYPARAMETER", advarchar, adParamInput, 50, strParameterToPassIn$)
    cmdParameters.append oPrm
    set rs = cmd.execute

  • Calling Stored procedure with Parameters in PowerPivot DataModel

    Hi All,
    I wanted to call a SQL stored procedure from PowerPivot(Excel) on based on changing slicer's value. 
    Currently, we can call stored procedure wihtout any parameter from Data Model tab using 
    Exec stored_proc_name in Table Properties window.
    What if I want to call the same procedure with a parameter whouse value will come by changing slicer's value. I  meant, changing slicer value will act as a parameter to that stored procedure & it should return updated results. 
    Is this possible in PowerPivot?

    Hi Rameshwar,
    According to your description, you call a SQL Server stored procedure in PowerPivot data model, now the problem is that you need to pass a parameter to the stored procedure, right?
    Based on my research, it seems that we cannot achieve this requirement directly in current version of PowerPivot data model. Here is a similar thread for you reference.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/5350228d-bc62-4a3b-a1a6-e847483e2858/powerpivot-for-excel-2013-call-execute-stored-procedure-with-parameters?forum=sqlkjpowerpivotforexcel
    If you have any concern about this behavior, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that they can be, Microsoft might consider to add this feature
    in the following release after official confirmation.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Problem calling stored procedure with user-defined type of input parameters

    Hi,
    I have to call a stored procedure with IN parameters, but these are user-defined types of input parameters.
    function fv_createnews (
    pit_groups in T_APPLICATION_USER_GROUPS,
    pit_documents in T_DOCUMENTS
    return varchar2;
    TYPE T_APPLICATION_USER_GROUPS IS
    TABLE OF varchar2(500)
    INDEX BY binary_integer;
    TYPE T_DOCUMENT IS record (
    name varchar2(256)
    ,url varchar2(1024)
    ,lang varchar2(30)
    ,foldername varchar2(150)
    TYPE T_DOCUMENTS IS
    TABLE OF T_DOCUMENT
    INDEX BY binary_integer;
    How can I do this using the TopLink 10.1.3 API.
    I already found following related posts, but I still can' t make it up:
    Using VARRAYs as parameters to a Stored Procedure
    Pass Object as In/Out Parameter in Stored Procedure
    Or do I have to create my own PreparedStatement for this special stored procedure call using Java and Toplink?

    As the related posts suggest, you will need to use direct JDBC code for this.
    Also I'm not sure JDBC supports the RECORD type, so you may need to wrap your stored functions with ones that either flatten the record out, or take OBJECT types.

  • 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

Maybe you are looking for