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.

Similar Messages

  • 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;

  • Pl/sql stored procedure code2 check the emial id is correct or not

    if the mail id is [email protected]@.com
    then how we do validations means
    there must be only one @
    i wnat all tghis type of validations 2 check the email id is correct or not?
    the procedure that i wnat to validate akll the validations

    This appears to be a duplicate of your existing thread
    pl/sql stored procedure for email id validations
    I'll answer there.
    Justin

  • What happens to the report if the underlying stored procedure to execute the report take atleast 3 hrs to run

    Hi,
    I have a report which is calling a stored procedure..
    Stored procedure exceutes 4-5 stored procedure and then returns the count each procedure it ran using union all statement... The stored procedure takes around 3-4 hrs to run because it is looking at quarterly data and YTD data.
    So once the report is kicked off and the procedure behind it runs and runs how will communicate to the report to show the final data... the final data will just be 5 rows with counts.
    I think we are running into a issue where the stored procedure runs and runs and then the report goes into la la land and has no clue what to do...
    Can you please shed some light on this..
    Thanks
    Karen

    Hi Karen,
    When we render a report, the report would process the following procedures:
    Open connections to data source and reading data rows from data extensions for all datasets, means retrieve data. Then process the engine requests, including the tablix, grouping, sorting, filtering, aggregations and subreport processing, means process report.
    Finally, render the report, including the pagination modules and on-demand expression evaluations.
    So the report rending has to wait until the stored procedure is executed. To improve the performance, we can consider the three aspects:
    Improve the performance of the stored procedures. Such as index and join. For better support, I suggest you can post a new thread about this issue in Transact-SQL forum at:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=transactsql. It is appropriate and more experts will assist you.
    Simplify the report. For example, avoid including a reference to [&TotalPages] or any complex expressions in the page header and page footer. For more details, please see the following document:
    http://technet.microsoft.com/en-us/library/bb522806(v=sql.105).aspx
    Using cashing if you have a long-running query that cannot be tuned further. For more details, please refer to the following article:
    http://msdn.microsoft.com/en-us/library/ms159241(v=sql.110).aspx
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to list all tables/stored procedures used by the report

    All the reports i create are getting data from stored procedure(s). Is there a way to obtaining a listing of all the stored procedures without having to open report by report and check under Database > Set Datasource Location > Properties > Table Name?
    Finding this info it would be extremely valuable, as it would help me to judge the impact of any changes that i might be considering to one or more of the stored proc.
    So far i maintained a manual listing but it is not up-to-date and reliable. I would rather prefer to get an updated listing every time i want to change/drop a stored procedure.
    Thanks so much for your help.
    Rick

    Dell can you be a little bit more specific about the SDK solution. I could ask one of the developers to help me but i need to gather more details.
    I took a look .rpt inspector Pro but it does not do what i need. All i need is the the listing of all the database tables (in my case stored procs) used in my reports. No need to replace or change anything. I need to scan the directory where i have all the reports for the different applications and get report names and table/stored procs used. i can export the txt file to excel and that's all.

  • 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

  • Very Odd PL/SQL Stored Procedure Behavior

    I'm writing a jsp/struts front-end for a legacy app that makes extensive use of stored procedures. I've sucessfully created a login page, a search page, and a master record detail/edit page. On the master record detail there are a series of subordinate data grids, each with links to individual pages for record editing.
    If I edit the master record and click my save button (a commit action), the appropriate stored proc is called and everything works as it should.
    BUT, if I click on the edit link to a subordinate table, I am taken to the screen, I can make changes, and when I click save (another commmit event) the stored procedure for that table is not called. No errors, the struts action takes me back to the previous screen (correctly), but nothing is saved.
    The weird part is, once I've returned to the master record page, if I edit the master record and click the same save button as before, the stored procedure for the subordinate table that I had just looked at is fired.
    I know my struts actions are correct, since the pages navigate correctly (at least, I 'think' I know that). I used the same code in the EO Impl to set up my call to the stored procs.
    Does anybody have ANY idea what might be causing this? I'm lost and confused at this point.
    (EO Impl Code below)
    /*doesn't print dodml until I click save on the master record...this is the code for the child. */
    protected void doDML(int operation, TransactionEvent e)
    System.out.println("dodml");
    switch (operation) {
    case DML_INSERT: {
    callInsertExternalNumber("I");
    break;
    case DML_UPDATE: {
    callInsertExternalNumber("U");
    break;
    void callInsertExternalNumber(String function) {
    CallableStatement st = null;
    try {
    System.out.println("calling stored proc");
    String stmt = "BEGIN mySchema.InsertNumber(?,?,?,?,?,?,?); END;";
    DBTransaction tr = getDBTransaction();
    st = tr.createCallableStatement(stmt,1);
    if (getExternalKey() != null) {
    st.setLong(1,getExternalKey().longValue());
    ...etc. etc. The calling stored proc doesn't get printed until I click save on the master record.

    Hi
    you could use JPublisher Wizard in JDeveloper to generate Java Wrapper classes for pl/sql stored procedures.
    check out the online demos http://technet.oracle.com/products/jdev/info/jdev/jpublisher/s000.html
    Also there is information in the online doc.
    Check the release notes for supported database versions.
    raghu

  • Stored Procedure call from JDBC sender for Oracle Database

    Hi,
    I have a requirement to call stored procedure using JDBC sender adapter for retriving data from an Oracle database.
    I need to execute first stored procedure call from Querry SQL statement and then trigger second stored procedure call for confirming the succesful retrival of those records from the update SQL statement.
    Querries:
    1. Can we trigger stored procedure from Update statement of JDBC sender.
    2. Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
    3. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
    Please note PI does not have direct access to main table and hence the need to have separate stored procedure calls.
    The PI version is PI 7.11 sp4.
    Appreciate your inputs.
    Thanks.
    Siddhesh S.Tawate

    >1. Can we trigger stored procedure from Update statement of JDBC sender.
    I think not possible using update statement.
    > Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
    Yes using select query you can call stored procedure.
    >. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
    No select and update handles in the same session using the same thread so if one transaction fails update should not proceed.

  • Problems with datatypes while callling MS-SQL stored procedure

    Hi
        We have a stored procedure in MS-SQL server ( Sql Server 2000 ) that we are invoking from XI 3. ( SP18) using a receiver adapter communication channel . One of the parameters of the stored procedure has a decimal data type . In XI design time - in the mapping - to the stored procedure data type - we have specified 'DECIMAL' as the type for attribute of the import parameter of the stored procedure . My source field in the mapping is of type string.
    This is resulting in an error on the Adapter Engine - 'Cannot convert datetime to decimal'  ( as seen in RWB ) -
    Are we right in specifying DECIMAL as the type in the XI mapping to the type attribute of the stored procedure parameter ?
    Any pointers, thoughts shared on this is appreciated. Correct answers will be rewarded.

    Sai and Others
                         The problem was that - among the big number of stored procedure parameters - that were to be passed from XI to the stored procedure call - we had to disable a few of the fields inbetween - inorder to test the stored procedure call with the main parameters that were to be passed.
    This disabling of the selective fields inbetween - messed up the order inbetween the XI stored procedure datatype and the actual stored procedure definition. We learnt a lesson not to disable fields within a stored procedure - now the call to the stored procedure is going through without using any conversion function for the string to decimal - as long as a decimal value keeps appearing at the source field always ( which is the case here )
    Thanks for your pointers, thoughts and suggestions...

  • PL/SQL stored procedure?

    Hi,
    Is any body could help me to execute
    an PL/SQL stored procedure via JDev3.1
    (using Oracle conection, No JDBC).
    Please provide sample code if possible?
    Thanks in Advance.
    Reza

    Hi
    you could use JPublisher Wizard in JDeveloper to generate Java Wrapper classes for pl/sql stored procedures.
    check out the online demos http://technet.oracle.com/products/jdev/info/jdev/jpublisher/s000.html
    Also there is information in the online doc.
    Check the release notes for supported database versions.
    raghu

  • 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>

  • 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 a sql stored procedure in java...... HELP

    Hi I am making an application for taking backup in sql automatically so i have created a dts package which is called by a stored procedure. Now the problem is that how to call that stored procedure in a Java program so that after running my java program i get my database backup.
    Please please solve my problem.
    thanks in advance.
    If possible please send the code.
    Message was edited by:
    Andy_Davis
    Message was edited by:
    Andy_Davis

    Hi... I am trying to create a dts package which is called by a stored procedure... How can i do this? IF possible can you please send me the code as well..
    Thanks a ton...
    Susan_Davis

  • 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

Maybe you are looking for

  • Migration from broken iMac to new iMac

    I have a 24" early 2009 iMac with Leopard that has a faulty screen. The computer will boot into OSX but I can't see anything on the main display (not even the Apple logo when booting). I have a replacement 27" iMac with Snow Leopard coming tomorrow a

  • Preview in browser not working since update

    Since I updated to Muse cc 2014 the program locks when I try to preview in browser. A massage stating that "Adobe muse CC has encountered an error and will exit" appears followed by "pendingProcessInfo not found in pending processes", I then have to

  • Writing multiple images to one file using ImageIO

    I am having trouble saving and reading multiple images from to/from one file. Here is the best i can come up with: //this is utilizing an ObjectOutputStream because i need to also save some objects to the file ObjectOutputStream oos = new ObjectOutpu

  • Using .AVI in Premiere Pro.

    Hello, First of all I want to point out that it's about a MacBook Pro and Adobe Premiere Pro CS3. This is the problem: I am an anime editor. I download videos of anime and edit them with my MacBook Pro. Back when i had windows, it was easy: i just in

  • How to re-download Adobe Premiere/Photoshop

    My computer is in the shop and probably will be for the rest of time. Meanwhile, I am using by bf's laptop and need to start work on a presentation asap, which I need to edit video clips and for. I have a Cloud Membership and bought Photoshop...but I