Run Procedure From a Report

Hi All,
I have what seems like a simple question. How do you run a procedure from reports? I have a procedure that I would like to pass some user defined parameters to from the parameter form, then run the procedure. The procedure populates a table that the report uses as a source for its data. In theory you should be able to give global values to your parameters and them use an after parameter form/before report trigger that kicks off your procedure. I have tried those "execute" commands from the reports help but no luck.
Does anyone have the answer?
Cheers,
Bradley

Hi Bradley,
You would run the procedure like you would run a procedure in PL/SQL. Which means you should not include the word "execute".
procedure_name(:p_param1,:p_param2);
I hope this helps,
Tom

Similar Messages

  • Call a pl/sql stored procedure from a report link

    Hello everyone:
    I have a report with a link in a column, which takes you to another page and passes values to that page, but also need the link, run a stored procedure before going to the other page.
    In the Forum I found cases similar to this, but none of the examples is clear to me how I do this. It seems that the target of the link should be URL, and also I have to call the stored procedure with a javascript function.
    My questions are:
    - Is this the best method to make what I need?
    - How should be the syntax of the link that takes me to another page and run the "stored procedure"
    - How and where I put the function "javascript" to run the "stored procedure"
    BDD: Oracle 11 g
    Apex version 4.1
    Best regards
    Gerard

    Hi,
    Change the link to call an apex.submit process. (javascript).
    Edit:
    I've set up a basic example.
    Region 1 (just so you can see the value getting set):
    select :P27_HIDDEN item_Value
    from dual
    Region 2:
    select rownum id, dbms_random.string('U', 12) sss
    from dual
    connect by level <= 20
    item attributes for ID:
    Target: URL
    URL: javascript:apex.submit({request:'NAVIGATE', set:{'P27_HIDDEN':#ID#}});
    (P27_HIDDEN is just a hidden item i created)
    http://apex.oracle.com/pls/apex/f?p=54920:27
    Edit2:
    In your case, then you can just have a page process based on conditions request = expression1, expression1: NAVIGATE..... then a page branch to go to the desired page, also with the same conditions
    Edit3:
    Im not sure what examples you are referring to , as you didn't supply any links; but you mention calling the stored procedure from javascript, so would likely involve some AJAX, but imo not necessary.

  • Calling a form based on a procedure from a report

    I have a report and want the user to link to a form based on a stored procedure passing params from the report record. That I can do using the link option. But to complicate matters I have more than one form based on a procedure and depending on values in the reports data depends on which form will be called (passing values to the form (all based on stored procedures).
    How can I do this ?
    Any advice would be really appreciated.

    If you want to display other HTML page after successful submission, you need to use
    either go or call method.
    I created a form on SCOTT.EMP and a report on SCOTT.EMP and the report accept a parameter for
    the deptno. Here is my on successfull submission code:
    declare
    l_dept number;
    l_url varchar2(2000);
    begin
    l_dept := p_session.get_value_as_number('DEFAULT', 'A_DEPTNO', 1);
    l_url := 'scott.rpt_mask_1.show?p_arg_names=emp.deptno&p_arg_values='&#0124; &#0124;l_dept;
    go(l_url);
    end;
    null

  • Run procedure from SQL Workshop Command window?

    hi, this one is simple.
    how to run a created procedure from APEX SQL Workshop SQL Command window?
    simon

    Simon,
    begin [proc_name]; end;
    -Carsten

  • Error Calling Oracle Stored Procedure From Within Report

    Hi,
    I have a report that calls an oracle stored procedure which returns a ref cursor. The report is working ok in our development environment when called from our development website through .NET.
    When the report is moved and accessed from our UAT website we get the following error :-
    Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for Oracle Description: One or more errors occurred during processing of command. Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for Oracle Description: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'RHS_GET_CAND_SECTION_REFS' ORA-06550: line 1, column 7: PL/SQL: Statement ignored Native Error: Failed to open a rowset. Error in File C:\WINDOWS\TEMP\temp_d663a952-bef6-4bf7-bf1a-5e288afdb612 {9B6DFB38-A436-4940-9D80-B4C23DFFFF19}.rpt: Failed to open a rowset.
    If we open the report manually we are prompted to enter database connection info. If we enter the UAT connection details the report runs ok. If we save the report and try to open it from UAT website through .NET it now opens ok.
    If we then move that same report back to the development environment and open from our development website it fails with the same error above.
    Both connections are using Microsoft OLE DB drivers and the Oracle databases are the same version (10.2.0.1.0).
    Is the connection information being stored in actual report and somehow being used when the report is opened through .NET?
    Any help appreciated
    Regards
    Paul

    Hi,
    Please let me know if the issue occurs with the crystal reports designer, if you are facing issues with the .NET application then a need to create a post [here|SAP Crystal Reports, version for Visual Studio;.
    Regards,
    Hitesh

  • How to execute an stored procedure from the Report Region

    Have stored procedure "LER_KRONOS_PAYCODE_HOURS_P" compiled and ready.
    (previously tested)
    Region Source:
    DECLARE
    v_SITE_ID VARCHAR2(8);
    v_SDATE VARCHAR2(8);
    v_EDATE VARCHAR2(8);
    v_LEVEL3 VARCHAR2(60);
    BEGIN
    v_SITE_ID :=P4_SITES_LOV;
    v_SDATE :=P4_SDATE;
    v_EDATE :=P4_SEDATE;
    v_LEVEL3 :=P4_LEVEL3;
    EXECUTE LER_KRONOS_PAYCODE_HOURS_P(v_SITE_ID,v_SDATE,v_EDATE,v_LEVEL3);
    END;
    Error When run the page:
    ORA-06550: line 11, column 12: PLS-00103: Encountered the symbol "LER_KRONOS_PAYCODE_HOURS_P" when expecting one of the following: := . ( @ % ; immediate The symbol ":=" was substituted for "LER_KRONOS_PAYCODE_HOURS_P" to continue.

    You need the execute keyword only when you run it directly from sqlplus.. that will tell sqlplus to append the keyword begin and end after the procedure call.
    Example.
    SQL > exec proc1 (input1);
    will tell sqlplus to run it as a block.. saying
    sql> Begin
              proc1(input1);
          end;Inside the procedure , in your code, you dont need the execute keyword.
    But, why do you want to execute a procedure inside the source for a report region..?

  • Calling Stored procedure from portal report

    I have a simple portal report. ie.
    select empname
    from emp
    where dept = :dept
    The users can customize the portlet and change the value of the bind variable (:dept).
    On the Additional PL/SQL section of the report I need to call a procedure and
    pass the value of the bind variable. Since the portlet is not being called from
    another, p_arg_names and p_arg_values will not give me anything. In the above example I would
    need to pass the value of ":dept" to the procedure. How do I get the value?

    Hi,
    Have you tried the 'get_value' function?..The syntax is
    declare
    l_dept number(5);
    begin
    l_dept := get_value('dept');
    /* further process */
    end;
    where 'dept' is name of the bind variable.
    -Krishnamurthy

  • Run Procedure From A List Item

    I am using Apex 3.2
    I have created a list of the shared components, which I will be using as a menu on my Home page.
    Is it possible to fire a procedure, once a certain item on the list is clicked. I do not want to put the process on the page that the list directs to, as I only want the procedure to run if they have come from the Home page and not any other page.
    Any ideas appreciated.
    Gus
    Edited by: Gus C on Feb 3, 2011 12:59 AM

    Hi Gus,
    I'm not sure about adding to a list item, but you could create an application item and a couple of application processes that may be able to do that.
    First, create an Application Item called G_LAST_PAGE
    Second, create an Application Process that runs "On Load: Before Header (page template header)" that is a PL/SQL Anonymous Block of whatever your code needs to be. Make this conditional on "Value of Item in Expression 1 = Expression 2" and enter G_LAST_PAGE into Expression 1 and enter 1 into Expressioin 2.
    Then create a second Application Process that has a higher sequence number than the first one. This should run "On Load: ..." and should be a PL/SQL Anonymous Block of:
    BEGIN
    :G_LAST_PAGE := :APP_PAGE_ID;
    END;This should be unconditional
    As the user moves from page to page (using your list item menu or by changing the URL or via links/branches), the value of G_LAST_PAGE gets updated. But before the update happens, the first process checks the value of G_LAST_PAGE - if it is 1 (ie, the user has just left page 1), then the process fires. Otherwise, it just proceeds to update G_LAST_PAGE with the page they are are now on.
    Andy

  • Running procedures from XSQL with PostgreSQL

    All,
    We are using XSQL with postgreSQL. It works fine till we try to run a postgreSQL Function. We setup the function to return a ref cursor, but it still didn't work. Below is the xsql file. Any help would be appreciated. Thanks.
    <?xml version="1.0"?>
    <page connection="pg-sunpos5" xmlns:xsql="urn:oracle-xsql">
    <xsql:ref-cursor-function max-rows="5" tag-case="lower" null-indicator="yes">
    card_type_f()
    </xsql:ref-cursor-function>
    </page>

    Here is a little more information on the problem. The definition of the postgresql function being run is below. Also the error message we receive when running the xsql template. Thanks.
    CREATE FUNCTION card_type_f() RETURNS refcursor AS '
    DECLARE
    rc refcursor;
    BEGIN
    OPEN rc FOR SELECT * from card_type;
    RETURN rc;
    END;
    ' LANGUAGE plpgsql;
    page>
    <xsql-error action="xsql:ref-cursor-function">
    <statement>card_type_f();</statement>
    <message>
    This Statement [] defines a procedure call (needs ?= call <stmt> to be considered a function.
    </message>
    </xsql-error>
    </page>

  • How to call a PL/SQL Procedure from a Report Column Hyperlink

    Hallo!
    Normally a link on a column value in a report leads you to a page in your application or to another URL.
    And you can send the value of this cell to the calling page.
    I want, that oracle executes a procedure with the values as in-Parameters if I click on this hyperlink.
    Must I call a dummy page and define this procedure in the header of this page or exit there other ways?
    Can you give ma an example?
    Thanks a lot!
    Gerhard

    Paul - When a column link is used to invoke a On Demand Process in that way, wouldn't that result in a blank page (unless of course the ODP emits a well-formed HTML document)? You could set the link target to a no-op like *#* and use a onclick handler in the Link Attributes to call a Javascript that uses the htmldb_get object to call the ODP. In fact, I don't think I have ever seen a ODP used in any other context.

  • Run procedure from Java

    i have a procedure like this :
    create or replace procedure sp_InsertUpdate_T_STUDENT
    nResID out NUMBER,
    nID in NUMBER,
    vchNAME in VARCHAR2,
    vchSURNAME in VARCHAR2,
    nAGE in NUMBER,
    nCNAUTHORID in NUMBER
    as
    begin
    if nID<=0 then
    insert into T_STUDENT (NAME,SURNAME,AGE,CNAUTHORID) values (vchNAME,vchSURNAME,nAGE,nCNAUTHORID );
    else
    update T_STUDENT set NAME=vchNAME,SURNAME=vchSURNAME,AGE=nAGE,CNAUTHORID=nCNAUTHORID
    where ID=nID;
    end if;
    select ID into nResID from T_STUDENT where NAME=vchNAME and
    SURNAME=vchSURNAME and AGE=nAGE and CNAUTHORID=nCNAUTHORID;
    end;
    and in java i have getStudent method which call this procedure :
    String procname = "{call sp_InsertUpdate_T_STUDENT(?,?,?,?,?,?)}";
    OracleCallableStatement ps = null;
    ResultSet rs = null;
    int id = -1;
    try {
    ps = (OracleCallableStatement)conn._connection.prepareCall(procname);
    ps.registerOutParameter(1,OracleTypes.INTEGER);
    ps.setInt(2, beanClass.getID());
    ps.setString(3, beanClass.getNAME());
    ps.setString(4, beanClass.getSURNAME());
    ps.setInt(5, beanClass.getAGE());
    ps.setInt(6, beanClass.getCNAUTHORID());
    int n = ps.executeUpdate();
    but here is an error occure :
    java.sql.SQLException: ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "PAATA.SP_INSERTUPDATE_T_STUDENT", line 18
    ORA-06512: at line 1
    i don't know why :( please help me ...

    Paata,
    It appears to me that your question has more to do with PL/SQL than JDBC, so allow me to suggest the PL/SQL:
    PL/SQL
    Also, the PL/SQL Web page has links to sample code:
    http://www.oracle.com/technology/tech/pl_sql/index.html
    And you can also access Oracle's "PL/SQL User's Guide and Reference" from here:
    http://tahiti.oracle.com
    Good Luck,
    Avi.

  • How to run procedure from SQL Commands

    I have tried several ways, for example:
    EXECUTE POPULATE_HIERARCHY(121121);
    but I get the error: ORA-00900: invalid SQL statement.

    BEGIN
      POPULATE_HIERARCHY(121121);
    END;

  • How to select a procedure in package from crystal report

    I want to select a oracle procedure in package from a crystal report. I can able to select stored procedure from crystal report if I check the option storedprocedure in file menu--option-SQL tab.

    Thanks Jayanthi,
    We had already read the article, but did not interpret it correctly. We found the solution in an SAP OSS note.
    We had to use method get_document_handle to get an OLE link and continue from there with OLE. The article however is very brief on that part and has no example.
    So for anyone who would like to do the same or simular:
    - call method do_document->get_document_handle:
        EXPORTING
           no_flush = ''
        IMPORTING
           error = do_error
           handle = do_handle
           retcode = do_retcode.
    - GET PROPERTY OF do_handle-obj 'Application' = do_ole_application.

  • Calling a stored procedure in crystal report

    I am using crystal reports 11 on the front end connected to mssql server in the back end and i have a stored procedure written in mssql and has a view created. i want to know how do i call a stored procedure from crystal report when i run my report and how to pass the values from my prompt to the stored procedure

    As long as the stored procedure returns a result set, the procedure should look and act just like table and the report will know what parameters are need to execute the procedure.  If this does not answer your question, please provide more specifics.

  • Error connecting to stored procedure in crystal report

    Hello
    I'm using crystal reports 2008 with the latest service pack.
    i'm trying to access stored procedure using the mysql jdbc driver 5.17. The crystal report has been designed which works fine with a login that created the stored procedure but when i try to run with another login that will used to run the crystal reports
    The login has access to execute the stored procedure but entered in the crystal report it complains about
    "User does not have access to metadata required to determine stored procedure parameter types. If rights cannot be granted, configure with {noAccessToProcedureBodies=true} to have driver generate parameters that represent INOUT strings irregardless of actual paramter types"

    Hi Sharon
    Thanks for response.
    I have checked that the user has permission to read and write. When i try and execute the stored procedure in the database by login with the user, it runs fine.
    When i try and call the stored procedure from crystal reports it throws that error message.
    regards
    Naresh

Maybe you are looking for

  • CE 7.2 SP03 Post Installation activities

    Hi, Could you please share any documents or links related to CE 7.2 post installation configurations such as: SLD, ECM, Service Registry, ESR, NWDI, BPM VC, GP and Composite Voice. Thanks in advance! Regards, Patana

  • Bean-Managed Persistent Entity Bean - SDA

    Hello, I wrote a BMP Entity Bean and it should use a data dictionary that i already have defined, but i do not know what should i write in the ejb-jar.xml file in order to get it works. Could you please tell me what should i write? <resource-ref>   <

  • 10.1.3 JBO - show JSP line # on error, not the java one?

    Hi, Another issue I'm bumping into on the JBO migration to 10.1.3(.1) are OC4J's stack traces for the JSPs are showing the line number of the error from the compiled java class, not the JSP file. Previous version used to do this. How can I get this b

  • Sriptwarning when creating contact print

    hello when i try to create a contact print, there is an error with the following details: when i first tried to create one it was working fine. i thought that i might have messed sth. up since i started working with a tablet/pen. so i un- and reinsta

  • BEFORE/AFTER CREATE ON SCHEMA

    All, I have a schema ORA and i have 60 tables and i have a audit table(stats_log)... but i have to eliminate 8 tables from audit (DDL,DML) operations... CREATE TABLE stats_log ( operation VARCHAR2(30), obj_owner VARCHAR2(30), object_name VARCHAR2(30)