Calling Stored Procedure with in Stored Procedure

I have one stored procedure A, I want to call Stored procedure A from Stored Procedure B and want to give input parameter to Stored Procedure A within Stored Procedure B using while loop.
i.e I have one stored procedure A which uses Telephone number as input parameter and pull out data
I want to create one more stored procedure B which will call stored procedure A internally and give telephone number one by one using while loop and push the result in Table C.

>
I have one stored procedure A, I want to call Stored procedure A from Stored Procedure B and want to give input parameter to Stored Procedure A within Stored Procedure B using while loop.
i.e I have one stored procedure A which uses Telephone number as input parameter and pull out data
I want to create one more stored procedure B which will call stored procedure A internally and give telephone number one by one using while loop and push the result in Table C.
>
Doesn't sound a good idea in terms of performance or design. OK, what's your query?
The concept is:
create or replace procedure Proc_A (p_phone varchar2)
is
Begin
   Insert into Tablec (col1, col2, col3, phone) values (val1, val2, val3, p_phone);
Exception
  When no_data_found then
   do what...
End;
Create or Replace Procedure Proc_B as
Begin
For i in (select phone_no from customer)
Loop
  Proc_A(i.phone_no);
End Loop;
End;
/Once again, I have to say, it's a bad idea. You may well do it within a single procedure or even a single SQL. Tell us your exact requirements and we'll be able to help you
Edited by: user12035575 on Sep 5, 2011 8:26 PM

Similar Messages

  • 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) {}

  • JDBC-Adapter-Receiver Calling Stored Procedure with Input-Typ Record

    Hallo,
    I´ m trying calling a stored-procedure with two input-parameter; one of typ record (oracle) and one of type tabel of records. Is this possible (I think there are only types like string, integer etc. possible)? When not is there another possibility to work with that type?
    Thanks in advance,
    Frank

    Hi Frank,
    I think stored procedures will not take Array of Records as a Input. If you want to make a loop funtionality etc then JDBC adapter will work accordingly. You need to just call the stored procedure from the JDBC adapter. It will work for the array of records(multiple occurences).
    Receiver JDBC Procedures.
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Alternative option is you can make use of Java Proxy and from there you can call stored procedure ..I think it is possible.. not tried.
    Hope this helps
    Regards,
    Moorthy

  • 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

  • How to call stored procedure with parameters?

    I created a stored procedure in db like:
    CREATE PROCEDURE dbo.MySP
    @name varchar(50),
    @access_date datetime
    AS
    BEGIN
    --insert data into a table
    End
    Then I create pb function to call this sp like( I use pb 11.5)
    datetime ll_date
    ll_date =datetime(today(), now())
    DECLARE mytest PROCEDURE FOR MySP @objname = :is_name, @access_date = :ll_date USING is_tran;
    IF is_tran.SQLCode <> 0 THEN
          MessageBox ( "Error", "DECLARE failed" )
          RETURN
    END IF
    EXECUTE mytest;
    IF ( is_tran.SQLCode <> 0 ) and ( is_tran.SQLCode <> 100 ) THEN
          MessageBox ( "Error", "EXECUTE failed" )
          RETURN
    END IF
    Then I run the app, first time to call this function without any error, but no data inserted, no thing happen.
    keep in the app and call the function again, give me error declare error.
    debug give me SQLCode = 100.
    SP is fine, I can insert data with isql like:
    exec MySP 'name', '2014-06-18'
    How to figure out the problem and fix it?

    You didn't mention the database in question, but the first thing I would recommend is making the call via and RPCFUNC declaration on a user object to type transaction rather than embedded SQL.  Embedded SQL (IMHO) should be a last resort.
    See:  Using Transaction Objects to call Stored Procedures

  • 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

  • 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

  • Calling Stored Procedure with a DATE input parameter

    Hi. A question about Date input parameters when calling a stored procedure...
    I have a procedure that takes a DATE parameter as input. I would like that DATE value to include a Time element.
    My Application Module method takes an input parameter as java.util.Date (myParamDate) - which will preserve a time element(?).
    However when I create the CallableStatement, I'm trying to set the parameter using setDate like this (for param 5):
                st = getDBTransaction().createCallableStatement("begin cs_my_pck.request_values(?,?,?,?,?,?,?,?); end;", 0);           
                Connection myConn = st.getConnection();
                ArrayDescriptor myArrDesc  =  ArrayDescriptor.createDescriptor("CS_FIELD_TABT", myConn);
                Array sqlParamNameArray = new oracle.sql.ARRAY(myArrDesc, myConn, paramNames.toArray());
                Array sqlParamValueArray = new oracle.sql.ARRAY(myArrDesc, myConn, paramValues.toArray());
                Array sqlFilterNameArray = new oracle.sql.ARRAY(myArrDesc,myConn,filterNames.toArray());
                st.setString(1, repType);
                st.setObject(2, sqlParamNameArray);
                st.setObject(3,sqlParamValueArray);
                st.setObject(4,sqlFilterNameArray);
                java.sql.Date myRepDate = new java.sql.Date(myParamDate.getTime());
                st.setDate(5,myRepDate);
                System.out.println("Report Date = " + myRepDate.toString());
                st.setString(6,repUser);
                st.setString(7,repAttach);
                // set out param
                st.registerOutParameter(8, Types.NUMERIC);
                st.execute();I understand java.sql.Date does NOT include a Time element. But setDate() accepts only a java.sql.Date so my procedure parameter ends up with a zero time element.
    How do I call this procedure retaining the Time element?
    Thanks.

    It includes time element, if you want more precision go with timestamp.
    http://docs.oracle.com/javase/6/docs/api/java/sql/Date.html

  • Calling Stored Procedure with CLOB parameter

    Hi,
    i have one procedure with IN parameter CLOB which is taking xml file and stored in one table column and this table column datatype is also CLOB. And this procedure called by .Net program but problem is when the file will come more than 32KB calling procedure failed. But as i know CLOB can stored up to 4GB data.
    Is that Limitation of oracle or .Net version
    please let me know the solution for that,
    Create Procedure Insert_File(P_XMLFILE IN CLOB)
    as
    begin
    insert into instances
    values(p_xmlfile);
    commit;
    end;
    regards,
    Madan

    Hi Thanks for your reply,
    Actually this procedure called by .net program and the XML file has passed in that parameter which come from some FTP(its inbound) and this files we are storing into above mentioned table.
    Error has come while calling stored procedure Through .net
    Error Details:
    Error calling stored procedure. 0 retry attemps has failed. Error: System.Exception: Error while calling stored procedure on Oracle: INSERT_FILE: System.Data.OracleClient.OracleException: ORA-01460: unimplemented or unreasonable conversion requested

  • Call stored procedure with a few unusal conditions

    What is the best way for a stored procedure that has been passed an unknown number of parameters to call another stored procedure, (whose name is passed in as a parameter to procedure1), that returns a ref cursor or a dbms_sql cursor.
    For example:
    Procedure1 - passed unknown # of parameters in an array/table calls stored procedure2 that returns a ref cursor that you eventually want to pass all the way back down to the client.
    I am using Oracle 11g.
    1). I have gotten this to work using derivedparameters in .net - but this is considered bad practice due to the overhead, etc...
    2). I have gotten this to work using execute immediate and bind variables.
    EXECUTE IMMEDIATE v_sqlstmt using p_strarry(1), p_strarry(2), p_strarry(3), p_strarry(4), p_strarry(5), p_rc;
    The problem with this technique is that you need to create a case statement that will use a different execute immediate statement for each arraycnt, since the using clause cannot be created dynamically. Also, considered bad. If I increase the number of elements in the array beyond what I have coded for then I need to add more when clauses to my case statement.
    3). I have gotten this to work with execute immediate that contains no binding variables - but my understanding is that this causes the shared pool to populate and causes the server to have to be flushed, periodically.
    4). I have read that with an unknown number of bind variables you need to use dbms_sql - I have been unable to find any reference as to a way I can return a ref cursor to the dbms_sql.cursor in a list of bind variables or a dbms_sql.cursor that returns multiple rows from a table to the original dbms_sql_cursor.
    In case what I have said is not specific enough - a code snipplet from the execute immediate using bind variables, (1 above).:
    PROCEDURE eiroutebvsproc(p_sprocname in varchar2,
    p_strarry in StrArry,
    p_rc IN OUT SYS_REFCURSOR)
    IS
    v_sqlstmt varchar2(300);
    v_arrycnt int;
    BEGIN
    v_sqlstmt := 'begin ';
    v_arrycnt := p_strarry.count;
    CASE
    WHEN (v_arrycnt = 1)
    THEN v_sqlstmt := '';
    WHEN (v_arrycnt = 2)
    THEN v_sqlstmt := '';
    WHEN (v_arrycnt = 3)
    THEN v_sqlstmt := '';
    WHEN (v_arrycnt = 4)
    THEN v_sqlstmt := '';
    WHEN (v_arrycnt = 5)
    THEN v_sqlstmt := v_sqlstmt || p_sprocname || '(:2, :3, :4, :5, :6, :7);';
    v_sqlstmt := v_sqlstmt || ' end;';
    EXECUTE IMMEDIATE v_sqlstmt using p_strarry(1), p_strarry(2), p_strarry(3), p_strarry(4), p_strarry(5), p_rc;
    ELSE v_sqlstmt :='ERROR';
    END CASE;
    this creates an anonymous block - that calls the 2nd procedure - The 2nd procedure name is passed into procedure1 as p_sprocname.
    p_strarry contains an unknown # of parameters to be passed to the 2nd procedure. The 2nd procedure returns a ref cursor that is also an out parameter for procedure1 allowing for the ref cursor to be passed all the way back to the client.
    Thank You,
    Keith

    user10651723 wrote:
    What is the best way for a stored procedure that has been passed an unknown number of parameters to call another stored procedure, (whose name is passed in as a parameter to procedure1), that returns a ref cursor or a dbms_sql cursor.There would be no good way to do that, like there is no real good way to bang your head against a brick wall.
    If the application can tell the first procedure than name of the procedure to call, why can it not just call the required procedure instead?

  • Calling Stored Procedure with OraClob as parameter IN

    I am using Visual C++ and using oo4o the ole way
    I am try to call stored procedure that have Clob as parameter in
    it seems the the OraParameters Add method don't have the ability since it can only receive variantt.
    How do I do it
    Thanks
    Yoav

    fyi
    Related to the solution/workaround posted by Luc.
    see "Do Oracle's JDBC drivers support PL/SQL tables/result sets/records/booleans? "
    at http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#34_05
    regards
    Jan Vervecken

  • Securely calling stored procedure with APEX URL

    I have a web server that needs to call a stored procedure on an Oracle database (v10.2.0.4.0-64bit), and to do so without storing schema credentials on the web server it has been recommended to call the procedure using a URL to APEX, and granting execute privileges on the package storing the procedure to APEX_PUBLIC_USER.  However, this allows anyone on the network to call the procedure if they have the URL.  Is there any way to make sure that either Apex or the procedure only responds directly to requests from the web server?

    Nick,
    Assuming you are talking about application server ( not web server ).
    It is common practice to create new user on Oracle database (often called proxy user, so you don't have to use schema credentials). Grant this user privileges to call package you need. Then on application server store encrypted credentials for this new user.
    Application (java or .net) then connects to Oracle using new user credentials and executes packaged procedure.
    Using Apex is the same. You need to have Authentication enabled (hence to store user id and password). If not, it is not secure.
    Making any application (including Apex) to respond to request from specific IP  is possible by inspecting ip from request header (Apex : UTL_HTTP.GET_HEADER ).
    There are problems however:
    1.If connection is made by proxy, request ip can change.
    2.Hackers can use "ip spoofing" to emulate request from permitted server.
    Another option would be to set up proxy server rules, permitting traffic between selected servers only.
    HTH
    Thomas

  • Problems calling stored procedure with DG4IFMX

    Hi guys,
    I am trying to call stored procedures from Informix Database which is connected through Oracle Database Gateway for Informix.
    I have run select,update,delete successfully but when i try to run a stored procedure nothing happens.
    for example :
    when i run
    call "branko"@link_informix(1)
    it returns that it is successfully executed, without any error, but as u can see bellow no entry is entered in the branko_test table
    at informix :
    drop procedure branko;
    create procedure "informix".branko(_vlez integer)
    returning boolean;
    if _vlez = 1 then
    insert into branko_test values('test uspesen','1');
    else
    insert into branko_test values('test uspesen 2','2');
    end if;
    end procedure;
    the procedure runs ok when called from informix.
    Thank you for any help
    P.S i have even tried running:
    declare
    ret integer;
    begin
    ret := DBMS_HS_PASSTHROUGH.EXECUTE_IMMEDIATE@link_informix('execute procedure branko(2)');
    end;
    but the same thing is happening, no entry in the table branko_test.

    Found the root cause:
    when using dbaccess to call the original procedure it reports on the screen (expression)
    => removing the return value as it is not handled
    -> looks like the unhandled return value boolean. Modifying the procedure to
    drop procedure branko;
    create procedure "informix".branko(_vlez integer)
    if _vlez = 1 then
    insert into branko_test values('test uspesen','1');
    else
    insert into branko_test values('test uspesen 2','2');
    end if;
    end procedure;
    allows me to execute the procedure using passthrough
    DECLARE
    result VARCHAR2(50);
    BEGIN
    result := DBMS_HS_PASSTHROUGH.EXECUTE_IMMEDIATE@dg4ifmx('execute procedure informix.branko(1)');
    END;
    Edited by: kgronau on May 6, 2011 7:31 AM

  • Java call stored procedure with nested table type parameter?

    Hi experts!
    I need to call stored procedure that contains nested table type parameter, but I don't know how to handle it.
    The following is my pl/sql code:
    create or replace package test_package as
    type row_abc is record(
    col1 varchar2(16),
    col2 varchar2(16),
    col3 varchar2(16 )
    type matrix_abc is table of row_abc index by binary_integer;
    PROCEDURE test_matrix(p_arg1 IN VARCHAR2,
    p_arg2 IN VARCHAR2,
    p_arg3 IN VARCHAR2,
    p_out OUT matrix_abc
    END test_package;
    create or replace package body test_package as
    PROCEDURE test_matrix(p_arg1 IN VARCHAR2,
    p_arg2 IN VARCHAR2,
    p_arg3 IN VARCHAR2,
    p_out OUT matrix_abc
    IS
    v_sn NUMBER(8):=0 ;
    BEGIN
    LOOP
    EXIT WHEN v_sn>5 ;
    v_sn := v_sn + 1;
    p_out(v_sn).col1 := 'col1_'||to_char(v_sn)|| p_arg1 ;
    p_out(v_sn).col2 := 'col2_'||to_char(v_sn)||p_arg2 ;
    p_out(v_sn).col3 := 'col3_'||to_char(v_sn)||p_arg3 ;
    END LOOP ;
    END ;
    END test_package ;
    My java code is following, it doesn't work:
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    Connection con = DriverManager.getConnection
    ("jdbc:oracle:thin:@10.16.102.176:1540:dev", "scott", "tiger");
    con.setAutoCommit(false);
    CallableStatement ps = null;
    String sql = " begin test_package.test_matrix( ?, ? , ? , ? ); end ; ";
    ps = con.prepareCall(sql);
    ps.setString(1,"p1");
    ps.setString(2,"p2");
    ps.setString(3,"p3");
    ps.registerOutParameter(4,OracleTypes.CURSOR);
    ps.execute();
    ResultSet rset = (ResultSet) ps.getObject(1);
    error message :
    PLS-00306: wrong number or types of arguments in call to 'TEST_MATRIX'
    ORA-06550: line 1, column 8:
    PL/SQL: Statement ignored
    Regards
    Louis

    Louis,
    If I'm not mistaken, record types are not allowed. However, you can use object types instead. However, they must be database types. In other words, something like:
    create or replace type ROW_ABC as object (
    col1 varchar2(16),
    col2 varchar2(16),
    col3 varchar2(16 )
    create or replace type MATRIX_ABC as table of ROW_ABC
    /Then you can use the "ARRAY" and "STRUCT" (SQL) types in your java code. If I remember correctly, I recently answered a similar question either in this forum, or at JavaRanch -- but I'm too lazy to look for it now. Do a search for the terms "ARRAY" and "STRUCT".
    For your information, there are also code samples of how to do this on the OTN Web site.
    Good Luck,
    Avi.

  • Calling stored procedures with output parameters using RDO and VB

    I have a simple test procedure defined as follows:
    CREATE OR REPLACE PROCEDURE test_sp (inval1 IN VARCHAR2,
    inval2 IN NUMBER, inval3 OUT VARCHAR2, inval4 OUT NUMBER) IS
    BEGIN
    inval3 := 'RETURN TEST';
    inval4 := 10;
    END;
    I am attempting to call this procedure from VB 5.0 using RDO and the Oracle ODBC Driver 8.01.06:
    dim rdoQd as rdoQuery
    dim grdoCn as rdoConnection
    strSQL = "{ call test_sp('SOMETHING',?,?,?) }"
    Set rdoQd = grdoCn.CreateQuery("", strSQL)
    rdoQd(0).Direction = rdParamInput
    ' get error# 40041 at above line
    ' "Object Collection: Couldn't ' find item indicated by text."
    rdoQd(0).Type = rdTypeINTEGER
    rdoQd(0).Value = 5
    rdoQd(1).Direction = rdParamOutput
    rdoQd(1).Type = rdTypeVARCHAR
    rdoQd(2).Direction = rdParamOutput
    rdoQd(2).Type = rdTypeINTEGER
    Set rdoApp = rdoQd.OpenResultset()
    MsgBox (CStr(rdoQd(1)))
    MsgBox (CStr(rdoQd(2)))
    When I run this VB code, I get the above mentioned error. If I use placeholders for all parameters (like "{ call test_sp (?,?,?,?) }" ), no error occurs.
    I really need to use the first type of syntax from above and not have to use placeholders for all parameters. Is there a way to accomplish this?
    TIA,
    Esther

    Are you getting any warning while importing the stored procedure?
    Please check the below datatypes:
    While creating the stored procedure, if you have used varchar(MAX), please ALTER it to varchar(255) and reimport to DS.
    Also, the datatype of $message (global variable or local variable) used inside DS should also be varchar(255)
    Try a print statement in between.
    ADMIN.DBO.SPJOBSUMMARY(69,$message,$rtCode,$rtVal);
    print('Message is '||$message);
    smtp_to('leighattest.com.au', 'Results of ' || job_name(), $rtCode || '//' || $rtVal || '~~' || $message || '//', 0,0);
    and see in the job log if DS is able to retrieve the output from DB.
    Regards,
    Suneer

Maybe you are looking for