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.

Similar Messages

  • 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

  • How to send a Varying Array param to a PL/SQL Stored Procedure from Java

    * I am VERY new to jdbc, and even somewhat new to Java
    * I'm using Java 1.5, Oracle 10g.
    * I need to call the following PL/SQL Stored Procedure from Java:
    procedure setEventStatus
    i_deQueueStatus in deQueueStatus_type
    *deQueueStatus_type is the following (an array of deQueueStatus_OBJ):
    CREATE OR REPLACE TYPE deQueueStatus_OBJ as object
    eventID number (20),
    dequeuestatus varchar2(20)
    CREATE OR REPLACE TYPE deQueueStatus_TYPE IS VARYING ARRAY(500) of deQueueStatus_obj
    *I have created a Java object as follows:
    public class EventQueueDeQueueStatus
         long      eventID;
         String      dequeueStatus;
         EventQueueDeQueueStatus(long eventID, String dequeueStatus)
              this.eventID = eventID;
              this.dequeueStatus = dequeueStatus;
    I have an ArrayList of these.
    I need to pass this list to the Stored Procedure. How do I create a java.sql.Array so I can call CallableStatement.setArray to set the parameter? Or do I use something else? I have tried setObject with both the ArrayList and also with a primitive array, but got "Invalid Column Type" both times.
    Any help would be greatly appreciated. I just got this task today, and I have to make it work by Tuesday :-( !
    Thanks,
    Kathy

    Kathy,
    Search the archives of this forum and the JDBC forum for the terms STRUCT and ARRAY and you can find some sample code on the JDBC How-To Documents page and the JDBC Samples which can both be accessed from this page:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
    Good Luck,
    Avi.

  • Calling pl/sql stored procedure from shell script ( kshell)

    hello.,
    i have written a stored procedure. i need to call this stored procedure from a unix shell script ( korn shell).
    can anyone please help me how can i do it.actually there are 3 stored procedures. so my shell script has to call each stored procedure, execute it then go to next stored procedure execute it.
    if by chance inbetween any stored procedure do not execute then the shell script has to tell me that this stored procedure failed to execute.
    please help me in this.
    thanks
    madan

    Sorry Madan,
    Following is the complete solutiion:
    !# /usr/bin/ksh
    sqlplus -s user/pass@server << EOF > a.log
    exec proc1;
    exec proc2;
    exec proc3;EOF
    if [ $? -eq 0 ]
    then
            echo "\n Procedures completed successfully at `date`"
    else
            echo "!!! FAILED!!!"
            echo "Details can be found in a.log File"
    fi

  • Urgent : while calling a pl/sql stored procedure I am getting this error.

    Error iam getting like this:
    IDALException: ORA-06550: line 1, column 7: PLS-00201: identifier 'BORGPURCHASEDELEGATION_SEL' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored [ com.commerceone.ebs.infra.dal.idal.BasicSQL.oracleExceptionHandler(BasicSQL.java:863)]
    ADALException: Default Message[ com.commerceone.ebs.infra.dal.adal.Adal.execute(Adal.java:765)]
    ADALException: Default Message[ com.commerceone.ebs.infra.dal.adal.Adal.executeEbo(Adal.java:605)]
    BusinessFatalException: Default Message[ com.commerceone.ebs.wf.business.PurchaseBorgDelegation.getData(PurchaseBorgDelegation.java:483)]
    CommandException: Default Message[ com.commerceone.ebs.apps.profile.command.UserProfilePurchaseDelegationSaveCmd.execute(UserProfilePurchaseDelegationSaveCmd.java:124)]
    ActionException: Default Message[ com.commerceone.ebs.apps.base.action.ActionImpl.executeCommand(ActionImpl.java:107)]
    JobException: Default Message[ com.commerceone.ebs.apps.ui.WebJobImpl.executeAction(WebJobImpl.java:115)]
    JobException: Default Message[ com.commerceone.ebs.apps.ui.BuyerJob.executeAction(BuyerJob.java:750)]
    JobException: Default Message[ com.commerceone.ebs.apps.ui.BuyerJobWrapper.run(BuyerJobWrapper.java:64)]
    Thanks
    raji

    This has happened to me when I do not have the proper grants and/or synonyms set up. My JDev/J2EE connection user does not own the database objects so I need to grant access to the database object owner's database account and create synonyms available to the connection user's database account. If you are using the same database account in your JDev/J2EE connection object as you are using to run the stored proc in SQL*Plus, this is not your problem.
    I would test each part of the database involvement. For example, if you create a database view (with no additional grants or synonyms) in the user account that owns that stored procedure, can you create an ADF BC view object from that view in JDev and can you run the BC tester in JDev on it? If so, the connection user and object owner user accounts are probably the same.
    Another thing to try is, instead of executing the stored procedure, do something like this:
    stmt = "DECLARE v_dummy; BEGIN SELECT 1 INTO v_dummy FROM dual; END;";If that works, your calling mechanism for the stored procedure works.

  • Running a SQL Stored Procedure from Power Query with Dynamic Parameters

    Hi,
    I want to execute a stored procedure from Power Query with dynamic parameters.
    In normal process, query will look like below in Power Query. Here the value 'Dileep' is passed as a parameter value to SP.
        Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData 'Dileep'"]
    Now I want to pass the value dynamically taking from excel sheet. I can get the required excel cell value in a variable but unable to pass it to query.
        Name_Parameter = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
        Name_Value = Name_Parameter{0}[Value],
    I have tried like below but it is not working.
    Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData Name_Value"]
    Can anyone please help me with this issue.
    Thanks
    Dileep

    Hi,
    I got it. Below is the correct syntax.
    Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData '" & Name_Value & "'"]
    Thanks
    Dileep

  • Calling SQL Stored procedure from PLSQL function

    Hi,
    I have created a simple function to return a value that is pulled back from SQL server.
    FUNCTION
    FUNCTION CALC_PASS_FAIL
    i_lidded_sn IN TMP_CHIP_ATTR.LIDDED_SN%TYPE
    RETURN NUMBER
    IS
    tmp_result NUMBER;
    BEGIN
    [email protected](i_lidded_sn,'OadmBarActive',tmp_result);
    RETURN tmp_result;
    END CALC_PASS_FAIL;
    OUTPUT
    --When executed as a procedure, i get the required output:
    DECLARE
    x INT;
    BEGIN
    x:=EQDAS_MISC.CALC_PASS_FAIL('OADM004548');
    dbms_output.put_line(x);
    END;
    0 <------ expected output
    PL/SQL procedure successfully completed.
    When executed as a simple function call, i don't get any output:
    SELECT CALC_PASS_FAIL ('OADM004505') FROM dual;
    Any input will be greately appretiated.
    Thanks,
    Shashi
    PS: I am using the DB Link setup usign DG4MSQL

    just wondering it works as procedure as the function misses double quotes:
    dbo.GetChipPareto
    should be
    "dbo"."GetChipPareto"
    Message was edited by:
    kgronau
    Tested a small example using a function like:
    create or replace function test(
    v_ut1 in varchar2)
    RETURN varchar2
    IS
    v_ut2 varchar2(255);
    BEGIN
    "dbo".OTG_TEST3@dg4msql( v_ut1, v_ut2);
    RETURN v_ut2;
    END test;
    The function calls a SQL Server procedure OTG_TEST3 just returning the passed string and it guarantees data integrity.
    Result using a stored procedure:
    SQL> DECLARE
    2 ret integer;
    3 v_ut1 varchar2(255);
    4 v_ut2 varchar2(255);
    5 BEGIN
    6 v_ut1 :='Hello World';
    7 v_ut2 :='';
    8 "dbo".OTG_TEST3@dg4msql( v_ut1, v_ut2);
    9 dbms_output.put_line('Input value: ' ||v_ut1||' - Output value: '
    ||v_ut2);
    10 END;
    11
    12 /
    Input value: Hello World - Output value: Hello World
    And calling now the function:
    select test('Hello') from dual;
    returns Hello

  • Calling PL/Sql Stored Procedure from java file

    Having problem in calling oracle stored procedure using bc4j.

    in ApplicationModuleImpl you can use following e.g.
    on client side use a custom method to access
    try {
    DBTransaction dBTransaction = getDBTransaction();
    String stmt = "CALL CHANGE_OWNER( ?, ?)";
    CallableStatement callableStatement = dBTransaction.createCallableStatement(stmt,DBTransaction.DEFAULT);
    callableStatement.setString( 1, oldOwner );
    callableStatement.setString( 2, newOwner );
    callableStatement.execute();
    } catch (SQLException ex) {
    throw new JboException(ex);
    }

  • 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

  • Unable to get the data from ms sql stored procedures using crystal report 10

    Dear,
    I am using the crystal report 10 and MS SQL 2000. I created stored procedures and after making the connection, i am unbale the data from that procedure. When i run stored procedure on MS SQL server it works fine.
    Please help me.
    Best Regards
    Pankaj
    [email protected]

    Dear,
    I am using the crystal report 10 and MS SQL 2000. I created stored procedures and after making the connection, i am unbale the data from that procedure. When i run stored procedure on MS SQL server it works fine.
    Please help me.
    Best Regards
    Pankaj
    [email protected]

  • 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 PL/SQL stored procedure from XML template

    I've a requirement to call a store procedure/function/package from XML template. How can i achieve this?

    >
    XML template
    >
    do you mean "data template" with sql statement?
    below using package in sql statement and data structure element for data template
    <?xml version="1.0" encoding="UTF-8" ?>
    <dataTemplate name="XXCUSTOM_PKG" defaultPackage="XXCUSTOM_PKG" version="1.0">
    <sqlStatement name="Q_INVOICES">
    select
    XXCUSTOM_PKG.invoice_type()
    from <some_table>
    </sqlStatement>
    <dataTrigger name="beforeReportTrigger" source="XXCUSTOM_PKG.beforereport"/>
    <dataStructure>
    <element name="in_title"  dataType="varchar2" value="XXCUSTOM_PKG.in_titleformula()"/>     
    </dataStructure>
    <dataTrigger name="afterReportTrigger" source="XXCUSTOM_PKG.afterreport()"/>
    </dataTemplate>or it's xml data for report?

  • 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

  • Call to PL/SQL Stored Procedure in the HTML expression field

    Hi,
    I need to display an image in a report based on the value of the underlying field. (Y/N)
    I created a solution based on http://www.dba-oracle.com/t_easy_html_db_display_image_html_expression.htm
    Unfortunately this does not work for me. The PL/SQL written in the HTML expression field is not being executed. The result is something like : <img src="PKG_IMAGES.display_YN_checkmark_image?p_image=Y">
    What am I missing?
    Tx for your help.

    kcaluwae wrote:
    Hi,
    I need to display an image in a report based on the value of the underlying field. (Y/N)
    I created a solution based on http://www.dba-oracle.com/t_easy_html_db_display_image_html_expression.htm
    Unfortunately this does not work for me. The PL/SQL written in the HTML expression field is not being executed. The result is something like : <img src="PKG_IMAGES.display_YN_checkmark_image?p_image=Y">
    What am I missing?Ensure that the Display As Column Attribute for the report column is Standard Report Column.
    However, the linked article appears to be very out of date. If using APEX 3.1 or later, see About BLOB Support in Forms and Reports for a better alternative.
    There's an OBE tutorial that followed the introduction of declarative BLOB support in 3.1 as well. (That might be an earlier version but it is still relevant to APEX 4.x.)

  • How to call PL-SQL script/stored procedure from Java?

    Assume I want to call a PL-SQL stored procedure from external Java program.
    How can I do this?
    Is there a simple "Hello world" example for this?
    Peter

    This forum is for Oracle only not for java
    Ug

Maybe you are looking for