Dynamic SQL Stored Procedure call in Pro*C Application

Hello All
Could you help with a sample Pro*C program (or snippet) which has a dynamic call to a stored procedure? The procedure to be called is determined at run time and so also the number of parameters to it.
Is this even possible using Pro*C?
Thanks in Advance
RD

Hi Colin & Faust
We found sample pro*c programs for dynamically calling PL/SQL blocks but not for dynamically calling stored procedures.
Heres the program we compiled successfully but it doesnt work, it gives a core dump on execution. Could you point out whats wrong.
#include<stdio.h>
#include<iostream>
#include<fstream>
#include<stdlib.h>
#include<sqlca.h>
#include<string>
#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<thread.h>
#include<sqlda.h>
#include<sqlcpr.h>
using namespace std;
#define TRUE 1
int main()
EXEC SQL BEGIN DECLARE SECTION;
char *UserID = getenv( "DATABASE" );
char query[100];
EXEC SQL END DECLARE SECTION;
SQLDA *bind_des;
EXEC SQL CONNECT :UserID;
EXEC SQL WHENEVER SQLERROR CONTINUE;
bind_des = SQLSQLDAAlloc( 0, 2, (size_t)10, (size_t)0 );
bind_des->N = 2;
strcpy( query, "CALL sel_dept( :empno,:name );");
//Calling stored procedure sel_dept( no NUMBER IN, name VARCHAR2 OUT)
EXEC SQL PREPARE sql_stmt from :query;
EXEC SQL DESCRIBE BIND VARIABLES FOR sql_stmt INTO bind_des;
bind_des->N = bind_des->F;
//cout << " bind_des->N after assigment = " << bind_des->N;
//--------------------- Enter the Input values -----------------------------
//parameter :1
bind_des->L[0] = 4;
/* Allocate storage for value and null terminator. */
bind_des->V[0] = (char *) malloc(bind_des->L[0] + 1);
/* Store value in bind descriptor. */
strcpy(bind_des->V[0], "50");
/* Set datatype to STRING. */
bind_des->T[0] = 2;
//parameter :2
bind_des->L[1] = 20;
/* Allocate storage for value and null terminator. */
bind_des->V[1] = (char *) malloc(bind_des->L[1] + 1);
/* Store value in bind descriptor. */
strcpy(bind_des->V[1], "");
/* Set datatype to STRING. */
bind_des->T[1] = 5;
EXEC SQL EXECUTE sql_stmt;
//cout<<"name"<<"\t"<bind_des->V[0]<<"\t"<<bind_des->V[1]<<endl;
cout << "name"<<"\t";
cout << "bind_des->V[0]=" << bind_des->V[0]<<"\t";
cout << "bind_des->V[1]=" << bind_des->V[1]<<"\t"<<endl;
for (int i = 0; i < bind_des->F; i++) /* for bind descriptor */
free(bind_des->V);
free(bind_des->I[i]);
SQLSQLDAFree(0, bind_des);
EXEC SQL COMMIT;
return 0;

Similar Messages

  • Actuate 7 PL/SQL Stored Procedure Call Before the Report Run.

    Hi,
    I need a small help to call a pl sql stored procedure in actuate 7.
    I wrote a code a on component content
    Function runProc(procName as String, connection As AcDBConnection )
    ' Insert your code here
    Dim statement As AcDBStatement
    Dim results as string
    ' Prepare statement
    Set statement = connection.Prepare("BEGIN " & procName & "; END;" )
    If statement Is Nothing Then
    results = "Failed to prepare statement."
    results = results & " " & connection.GetSpecificErrorText( )
    results = results & " " & connection.GetGeneralErrorText( )
    Exit sub
    End If
    ' Execute sprocoutparam
    If statement.Execute() = 0 Then
    results = "Stored procedure " & procName & "execution failed."
    results = results & " " & connection.GetSpecificErrorText( )
    results = results & " " & connection.GetGeneralErrorText( )
    Else
    results = "Stored procedure " & procName & " execution success."
    End if
    ShowFactoryStatus(results)
    End FunctionNow this Code I am calling on the Chart Start Method
    Sub Start( )
        Super::Start( )
        ' Insert your code here
        Dim ProcName as String
        Dim connectionObject As AcDBConnection
        ProcName="DELETECUSTOMER(1234)"
        runProc(ProcName, connectionObject )
    End SubNow when i Run the Report i get this Error !
    NewReportApp::Frame::Chart%Start(9): Invalid procedure reference. - (runProc)
    1 Semantic Error(s) found
    Thanks,
    Asif

    hi,
    Finally Figured Out Here....
    Steps to Call the Stored Procedure In Actuate 7
    1 – Right Click on Content – Frame and go to properties and method Tab.
         1 – Click on New Button to you create own custom method.
         2 – Write the following code :
    Sub runProc(procName as String, connection As AcDBConnection )
         Dim statement As AcDBStatement
         Dim results as string
         Set connection = GetConnection()
         'Prepare statement
         Set statement = connection.Prepare("BEGIN " & procName & "; END;" )
              If statement Is Nothing Then
                   results = "Failed to prepare statement."
                   results = results & " " & connection.GetSpecificErrorText( )
                   results = results & " " & connection.GetGeneralErrorText( )
                   MsgBox "Procedure Not Called....Badddddd"
                   Exit sub
              End If
         ' Execute sprocoutparam
              If statement.Execute() = 0 Then
                   results = "Stored procedure " & procName & "execution failed."
                   results = results & " " & connection.GetSpecificErrorText( )
                   results = results & " " & connection.GetGeneralErrorText( )
                   MsgBox "Procedure Not Called....Badddddd" & results
              Else
                   results = "Stored procedure " & procName & " execution success."
                   MsgBox "Procedure Called....Wowwww"
              End if
              ShowFactoryStatus(results)
    End Sub2 – Now let call the stored procedure before our actual report query runs.
         1 - Right Click on Content – Frame and go to properties and method Tab.
         2 - Select the Start Method and Click on Override button.     
         3 - Write the following code:
    Sub Start( )
         Dim ProcName as String
         Dim connectionObject As AcDBConnection
         Set connectionObject = GetConnection()
         ProcName="XXTEST ()"
         runProc( ProcName, connectionObject )
        Super::Start ( )
    End Sub3 – Now design your report as usual using the Textual Query window.

  • Calling SQL stored procedure dynamically

    Hallo,
    could anybody tell me how to call HANA SQL stored procedure dynamically?
    The coding looks like this:
    v_ProcedureName := '"' || KpiNamespace || '::' || KpiName || '"';
    v_SQL := 'CALL ' || :v_ProcedureName || '( lt_outKPI )';
    EXEC :v_SQL;
    For this call I get the error message:
    "Transaction rolled back by an internal error: wrong number or types of parameters in call: Physical table is not allowed in OUT table variable position: LT_OUTKPI: line 1 col 55 (at pos 54)"
    The procedure to be called dynamically has a table output parameter.
    Thanks in advance,
    Best Regards,
    Alexey Romanov.
    Hi Alex,
    Can you share your requirement on exactly what is the need to call the procedure dynamically?
    For your question, have a look on the below:
    1) Have a procedure named EMPLOYEE_DETAILS
    http://scn.sap.com/servlet/JiveServlet/downloadImage/2-14895702-415799/236-170/pastedImage_0.png
    2) Created one more procedure named Dynamically as shown below:
    CREATE PROCEDURE Dynamically ()
    AS
    BEGIN
    DECLARE QUERY VARCHAR(1000);
    QUERY := 'call  EMPLOYEE_DETIALS(?)';
    EXECUTE IMMEDIATE (:QUERY);
    END;
    3) Output:
    http://scn.sap.com/servlet/JiveServlet/downloadImage/2-14895702-415800/210-189/pastedImage_3.png
    Regards,
    Krishna Tangudu
    Hi Krishna,
    Thanks for your reply!
    Unfortunately, I can neither go to ‘full discussion’, nor open the pictures, you have attached, nor see you reply.
    That’s why I just add my reply to the problem description.
    The procedure name is composed out of 2 parts on-the-fly, that is why I have to call it dynamically:
    create local temporary table "#KPIEvals"(           
              "KpiNamespace" NVARCHAR(256) CS_STRING,           
              "KpiName" NVARCHAR(32) CS_STRING,               
              "KpiText" NVARCHAR(256) CS_STRING,           
              "Responsible" NVARCHAR(256) CS_STRING );
    FOR cur_row as c_cursor DO        
         v_SQL := '';     
         v_ProcedureName :=  '"' || cur_row."KpiNamespace" || '::' || cur_row."KpiName" || '"';     
         v_SQL := 'CALL ' || :v_ProcedureName || '( lt_outKPI )';     
         EXEC :v_SQL;                
         v_SQL := 'INSERT INTO "#KPIEvals" SELECT * FROM :lt_out_kpi';     
         EXEC :v_SQL;                
    END FOR;
    I guess there might be 2 reasons for the problem:
    1.     All the procedures are called dynamically in a loop.
    2.     All the procedures have an output parameter, which is a table.
    Hope that helps,
    Best Regards,
    Alex.

    Hi Alexey, I think what you may need to do in this case is to do the insert into your temp table from within the dynamically called procedure, therefore no need for output param in your procedure call. You can then select from the temp table in your main procedure. Hope that makes sense.
    Peter

  • How to write a PL/SQL stored procedure in Oracle to call Webservice

    Can any one pelase send me a code on how to write a PL/SQL stored procedure in Oracle database to call the Webservice ?
    Thanks,
    Rajesh

    Were you able to solve this problem

  • How to call pl/sql stored procedure in JDBC query dialogbox

    Hi,
    how to call pl/sql stored procedure in JDBC query dialogbox(reports 9i) .
    Cheers,
    Raghu

    please refer : Re: problem If you have more doubts, please ask in that question.

  • How to call PL/SQL stored procedure using ODBC?

    Could anyone tell me how can I call PL/SQL stored procedure using
    ODBC? Are there any sample codes?
    Thanx!
    null

    You are correct on all counts, they all should work.
    Oracle Product Development Team wrote:
    : Hi,
    : I don't know the exact syntax in ODBC, but reasoning by analogy
    : with other API's, I'd bet one of the following works
    : (for a call to: procedure my_proc(n1 number, n2 number);):
    : "{ my_proc(1,2); }"
    : "{ call my_proc(1,2); }"
    : "{ begin my_proc(1,2); end }"
    : "begin my_proc(1,2); end;"
    : "begin my_proc(1,2); end"
    : Hope this helps. - Pierre
    : jiangbuf (guest) wrote:
    : : Could anyone tell me how can I call PL/SQL stored procedure
    : using
    : : ODBC? Are there any sample codes?
    : : Thanx!
    : Oracle Technology Network
    : http://technet.oracle.com
    null

  • How to call PL-SQL/stored procedure in Creator

    Anybody can tell how to call PL-SQL/Stored procedures inside creator...

    Hi!!!
    You can see this topic http://forum.sun.com/jive/thread.jspa?threadID=106046
    There is how to call oracle stored procedures. Also I put a lot of links in these topic doing reference stored procedures. I have one that it tells specially how to call oracle stored procedures from java, is in spanish but you can understand the code.;-)
    http://yoprogramador.vampisol.com/index.php?title=pl_sql_oracle_desde_java&more=1&c=1&tb=1&pb=1
    Byeee

  • Error calling PL/SQL stored procedure

    Hi,
    I'm pretty new to JDeveloper having used NetBeans for the last few years.
    I'm getting an error when trying to call a PL/SQL stored procedure. When I click on any of the oracle errors I get an "unable to find source file" message. The errors occurs in call.execute(). The error message and Java code are listed below. Any help is much appreciated.
    Cheers,
    Stevie
    Errors:
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 33
         at java.lang.String.charAt(String.java:558)
         at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:877)
         at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:811)
         at oracle.jdbc.driver.OracleSql.getSql(OracleSql.java:284)
         at oracle.jdbc.driver.OracleSql.getSqlBytes(OracleSql.java:538)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:169)
         at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:873)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1161)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3001)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3093)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4286)
         at oracle.CallPLSQL.callLMO(CallPLSQL.java:118)
         at oracle.TestHarness.main(TestHarness.java:18)
    Jave Code:
    package oracle;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Types;
    public class CallPLSQL {
    private Connection conn;
    public CallPLSQL() {
    *Constructor.
    try {
    //Register Oracle Database Drive
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //set connection
    String connectionString="jdbc:oracle:thin:TSD/TSD@DEV:1526:DEVELOP";
    this.setConn(DriverManager.getConnection(connectionString,"TSD", "TSD"));
    } catch (SQLException ex) {
    public int callproc () throws SQLException {
    CallableStatement call;
    String callString = "{call proc" +
    call = conn.prepareCall(callString);
    call.setInt(1, 120289);
    call.setInt(2, 2008);
    call.registerOutParameter(3, Types.INTEGER);
    call.registerOutParameter(4, Types.INTEGER);
    call.registerOutParameter(5, Types.INTEGER);
    call.registerOutParameter(6, Types.DATE);
    call.registerOutParameter(7, Types.VARCHAR);
    call.registerOutParameter(8, Types.INTEGER);
    call.registerOutParameter(9, Types.INTEGER);
    call.execute();
    int i = call.getInt("app_id");
    return i;
    public void setConn(Connection conn) {
    this.conn = conn;
    public Connection getConn() {
    return conn;
    }

    I've fixed it now. I'd missed a } in prepareCall. What a doughball.

  • Can a SQL Server stored procedure call an SAP function module?

    Can a SQL Server stored procedure call an SAP function module.? The stored procedure will be called via a trigger when data records are added to a Z table.

    You have two options:
    - the other software can use the RFC SDK and call directly in the system
    - the other software can use a database connect
    Markus

  • Creating a SQL Stored procedure to call a CF function

    I need to create a method to migrate data from a DMZ inside a firewall.  To do this I was thinking of making a call from the DMZ web server (using CF) to an internal SQL server database stored procedure.  The stored procedure would then call a CF template on the internal web server to pull data inside the firewall.  Not my first choice on implementation but as a consultant I don’t make the rules I create the code to enforce them... Anyway these are the steps I need to follow.
    1.)    Call the stored procedure and pass an int value with the call.
    2.)    The Stored procedure calls a URL and passes the INT with it. I.E.  http://Mylocalhost/Xferdata/MyXferTemplate.cfm?MyIntValue=”PASSED IN INT VALUE”
    3.)    The MyXferTemplate does the actual data migration for me.
    My question is how do I create a simple stored procedure to do this on SQL Server 2008???  After looking at the CF documentation I don’t think there will be much of a problem making the call to the stored procedure… its just writing the stored procedure…  Any and all help is greatly appreciated!!!
    Have an Ordinary Day...
    Kurtis   ~|:-)

    So far this is what I got... When I "execute' this code in SQ
    L Server management studio it compiles without any errors but when I run it I get the message "http: is not recognized as an internal or extermnal command."
    /**********************************  Code to create the SP **************************/
    USE 
    [KDLTransfer]
    GO
    /****** Object: StoredProcedure [dbo].[Migrate_DMZ_Data] Script Date: 03/07/2011 16:48:50 ******/
    SET 
    ANSI_NULLS ONGO
    SET 
    QUOTED_IDENTIFIER ONGO
    -- =============================================
    -- Author: KDL
    -- Create date: 3/7/2011
    -- Description: Migrate data
    -- =============================================
    ALTER 
    PROCEDURE [dbo].[Migrate_DMZ_Data]  
    -- Add the parameters for the stored procedure here
    @MyIntValue
    int = null
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for procedure here
    EXEC xp_cmdshell 'http://localhost/IREC/KDL/KDL.cfm?@MyIntValue, no_output';
    END
    /**************** Code to call the SP ******************/
    execute  Migrate_DMZ_Data @MyIntValue = N'5'

  • Calling ORACLE/SQL stored procedure...

    Hello,
    Is it possible to invoke non-parametrized Stored Procedures (a procedure that, neither having IN parameter nor OUT parameter) from BizTalk.?
    Any suggestion/solution?
    Thanks,
    Prajakt.
    Praj Dixit

    Praj,
    Yes possible.
    Create a .NET helper which will call the stored procedure and handle the return value/recordset from sp and in your BizTalk artifacts call this .NET helper/wrapper to SQL stored procedure. 
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Calling PL/SQL stored procedure from JSP tag

    Hello,
    I need to call a PL/SQL procedure from a JSP tag , I donot want to use any Bean to call the PL/SQL procedure. How would I call PL/SQL stored procedure from within JSP using JSP tag library, need some code.
    Thank you
    Syed

    need to call a PL/SQL procedure from a JSP tag , I donot want to use any Bean to call the PL/SQL procedure. How would I call PL/SQL stored procedure from within JSP using JSP tag library, need some code.
    regards
    Indira Rani Bandi

  • Remote Stored Procedure Call Dispatcher WEB WERVICE

    Hello all,
    Environment: Windows OS, Oracle 10g, mod_plsql
    I am looking for solutions to the following problem:
    A way to dispatch calls to stored procedures from client to server with a minimal impact on performance.
    We are looking at two possible solutions:
    1) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through mod_plsql.
    2) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through a web service.
    Solution 1) is not the preferred one as you may already know that mod_plsql will not be supported starting 12g.
    Solution 2) is the one we prefer as we believe that web services will be ever more supported in the future. When we move to 11g we may turn this web service into a native one (avoiding overhead in the OC4J for hosting the web service etc.).
    We are looking for code examples and information pointers of how we could implement this dispatcher as a stored procedure in a DB package. We know that the implementation should be similar to the one done for mod_plsql in the OWA schema but the code there is obfuscated, so we could not borrow ideas from there.
    We are not sure how to deal with the generalization of the above stated problem. We need to be able to pass to this dispatcher the stored procedure package and name we are invoking, ordered list of parameters (or parameters map), and the transport strategy (XML, JSON, etc.).
    Basically, we are notsure how to deal with the USING clause of the EXECUTE IMMEDIATE statement. We can dynamically generate the SQL statement corresponding to the stored procedure we want to call, but we are not sure how to bind the parameters we are passing?
    Also, we know that EXECUTE IMMEDIATE may be slow sometimes. So if could avoid it, this could further improve performance.
    Perhaps the run-time generalized stored procedure execution may not be what we are looking for?! Perhaps we should include several design-time steps?! What about a script that given a package name (or just a single stored procedure) would generate a wrapper package which stored procudures' names would correspond to their respective counterparts in the given package which would take two parameters - the list of parameters in some sort of format, and the transport (content delivery strategy) and would return the result in the given content delivery strategy?! This script may also define the XSD of the XML message a stored procedure is called with (the parameter map) as well as the XSD of the XML result the stored procedure returns. Also the script could generate client code with the given language strategy (Java, .NET, etc.) for calling the RSPCDispatcher web service.
    We request the following from the Oracle community folks:
    a) Please, give us any relevant information that could be helpful to resolve this problem.
    b) Any resource of how to inspect stored procedures in a package, its parameters, parameter types and direction (IN, OUT, or INOUT), etc.
    Thank you very much in advance.
    Regards,
    Georgi

    Hello all,
    Environment: Windows OS, Oracle 10g, mod_plsql
    I am looking for solutions to the following problem:
    A way to dispatch calls to stored procedures from client to server with a minimal impact on performance.
    We are looking at two possible solutions:
    1) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through mod_plsql.
    2) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through a web service.
    Solution 1) is not the preferred one as you may already know that mod_plsql will not be supported starting 12g.
    Solution 2) is the one we prefer as we believe that web services will be ever more supported in the future. When we move to 11g we may turn this web service into a native one (avoiding overhead in the OC4J for hosting the web service etc.).
    We are looking for code examples and information pointers of how we could implement this dispatcher as a stored procedure in a DB package. We know that the implementation should be similar to the one done for mod_plsql in the OWA schema but the code there is obfuscated, so we could not borrow ideas from there.
    We are not sure how to deal with the generalization of the above stated problem. We need to be able to pass to this dispatcher the stored procedure package and name we are invoking, ordered list of parameters (or parameters map), and the transport strategy (XML, JSON, etc.).
    Basically, we are notsure how to deal with the USING clause of the EXECUTE IMMEDIATE statement. We can dynamically generate the SQL statement corresponding to the stored procedure we want to call, but we are not sure how to bind the parameters we are passing?
    Also, we know that EXECUTE IMMEDIATE may be slow sometimes. So if could avoid it, this could further improve performance.
    Perhaps the run-time generalized stored procedure execution may not be what we are looking for?! Perhaps we should include several design-time steps?! What about a script that given a package name (or just a single stored procedure) would generate a wrapper package which stored procudures' names would correspond to their respective counterparts in the given package which would take two parameters - the list of parameters in some sort of format, and the transport (content delivery strategy) and would return the result in the given content delivery strategy?! This script may also define the XSD of the XML message a stored procedure is called with (the parameter map) as well as the XSD of the XML result the stored procedure returns. Also the script could generate client code with the given language strategy (Java, .NET, etc.) for calling the RSPCDispatcher web service.
    We request the following from the Oracle community folks:
    a) Please, give us any relevant information that could be helpful to resolve this problem.
    b) Any resource of how to inspect stored procedures in a package, its parameters, parameter types and direction (IN, OUT, or INOUT), etc.
    Thank you very much in advance.
    Regards,
    Georgi

  • Unable to use the values returned by a PL/SQL stored procedure in a XSQL page

    Hi,
    I've been messing around with XML and XSQL in particular. I was trying to write a xsql page to display a report with account totals...I have the following .xsql which calls a PL/SQL stored procedure :
    <?xml version="1.0"?>
    <xsql:query connection="pfcdm" xmlns:xsql="urn:oracle-xsql">
    <xsql:set-session-param name="zasset_total" value="100">
    <xsql:dml connection="pfcdm">
    rraman.sp_vw_id(zasset_total,zinvm_total,zmkt_val);
    </xsql:dml>
    </xsql:set-session-param>
    select 'Asset total is {@zasset_total}' as "ASSET_TOTAL" from dual
    </xsql:query>
    My procedure sp_vw_id returns the values that it should. But, I am not sure how to declare variables within a page, and to output the return values. There is very scanty documentation on the usage of <xsql:dml> or <xsql:ref-cursor-function>.
    Any response would be greatly appreciated.
    Thanks,
    Raja

    Here is the example from the Oracle9i (complete rewrite) of the XSQL Chapter in our Oracle documentation.
    Question
    I using <xsql:dml> to call a stored procedure which has one OUT parameter, but I was not able to see any results. The executed code results in the following statement:
    <xsql-status action="xsql:dml" rows="0"/>
    Answer
    You cannot set parameter values by binding them in the position of OUT variables in this release using <xsql:dml>. Only IN parameters are supported for binding. You can create a wrapper procedure that constructs XML elements using the HTP package and then your XSQL page can invoke the wrapper procedure using <xsql:include-owa> instead.
    For an example, suppose you had the following procedure:
    CREATE OR REPLACE PROCEDURE addmult(arg1 NUMBER,
    arg2 NUMBER,
    sumval OUT NUMBER,
    prodval OUT NUMBER) IS
    BEGIN
    sumval := arg1 + arg2;
    prodval := arg1 * arg2;
    END;You could write the following procedure to "wrap" it, taking all of the IN arguments that the procedure above expects, and then "encoding" the OUT values as a little XML datagram that you print to the OWA page buffer:
    CREATE OR REPLACE PROCEDURE addmultwrapper(arg1 NUMBER, arg2 NUMBER) IS
    sumval NUMBER;
    prodval NUMBER;
    xml VARCHAR2(2000);
    BEGIN
    -- Call the procedure with OUT values
    addmult(arg1,arg2,sumval,prodval);
    -- Then produce XML that encodes the OUT values
    xml := '<addmult>'&#0124; &#0124;
    '<sum>'&#0124; &#0124;sumval&#0124; &#0124;'</sum>'&#0124; &#0124;
    '<product>'&#0124; &#0124;prodval&#0124; &#0124;'</product>'&#0124; &#0124;
    '</addmult>';
    -- Print the XML result to the OWA page buffer for return
    HTP.P(xml);
    END;This way, you can build an XSQL page like this that calls the wrapper procedure:
    <page connection="demo" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-owa bind-params="arg1 arg2">
    BEGIN addmultwrapper(?,?); END;
    </xsql:include-owa>
    </page>This allows a request like:
    http://yourserver.com/addmult.xsql?arg1=30&arg2=45
    to return an XML datagram that reflects the OUT values like this:
    <page> <addmult><sum>75</sum><product>1350</product></addmult>
    </page>

  • Added new parm to an existing SQL stored procedure CR 11 doesn't like it

    Hi
    I have added a new parameter to an existing SQL stored procedure (SQL 2000).  This stored procedure is currently being called from a Crystal XI report.  It prompts for a date which works great.  (The report was created with this parameter).  I added a new parameter to the stored procedure.  When I do a preview in Crystal, it prompts for the new parameter, but is NULL when I look at the SQL query and it brings back no data.  If I try to verify the database, it tells me that I am missing parameter @ProcessType (varchar(5))--(name of new parameter).  I have physically added this parameter to the crystal report with the select expert and still no luck.  I have already tried renaming the procedure but am unable to update datasource location because of this parameter.  The report is very detailed and I do NOT want to create a new report.

    Unfortunately, I have tried and retried to do this.  Nothing changes.  I usually would get a message like database has changed, proceeding to fix report.  I don't get this.  It merely tells me database is up to date and only returns the 1 parameter, yet when I go to the datasouce and try to update it, it tells me that I have not supplied the new parameter.
    I have tried everything, from closing Crystal reports and then going so far as to reboot my machine, just in case their was some kind of caching going on.
    I have even asked other people I work with to look at it to make sure I am not doing something dumb...

Maybe you are looking for

  • How can I move a folder to another catalog using LR 3

    I have imported a large amount of folder into cat#1, but now i have decided to create cat#2. I have tried to move the "folders" and not "catalog" using the following workflow: 1- Opening cat #1, make selection of folder to be moved 2- Go to file and

  • ICR FBICR3 runtime error

    Hello experts, FBICR3 is performing an authority check on the field company. When I start the transaction for a company I have authorization on, the program is running fine. When I start the transaction for a company I'm not authorized on, I get the

  • Why convert to iPod a H264 file ?

    This is the greatest mystery to me (except some mystic ones): Hanbrake a DVD to H264 (with all the settings for Ipod compatibility) : you get a mp4 file. This is still not compatible with ITunes and then cannot be transferred to iPod. Open it with QT

  • When adding an image to the composition. Ae CC crashes what should i do?

    Please someone help?

  • Button inside a symbols

    Hello I have a button inside a symbol and I would when you click to play this symbol. The symbol is "Anim_Perso". https://creative.adobe.com/file/47b82617-3124-4eab-9482-ac94b30674c4 https://creative.adobe.com/file/47b82617-3124-4eab-9482-ac94b30674c