Include Button that executes PL/SQL procedure to SQL query based region

I would like to add two columns to a SQL query region.
These columns would not be sourced from the query, but rather would be used to execute a PL/SQL procedure.
For example, I would like to have a manager approve or deny adding an additional employee to the department.
There would be one button for APPROVE. And, one button for DENY.
The PL/SQL procedure would execute to perform the required DML based upon the selected action (either APPROVE or DENY).
A sample output would look like this:
<APPROVE>, <DENY>, John Doe, Accountant
<APPROVE>, <DENY>, Jane Doe, Accountant
Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?
Thanks!
-Reid

Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?Conditional page item? You can associate processes with buttons on a page

Similar Messages

  • JDBC - Pl/SQL-Procedure or SQL-Statement???

    Hi,
    we have got the following problem:
    Our program is entirely written in Java. It has to communicate with an ORACLE 8i database (Version 8.1.7). The big question is whether to call pl/sql-procedures which include the sql-statement (select/ insert/update) or to write the sql-statements in the Java-code directly.
    We messure the time in our test-database. The procedure took twice the time of the direct statement, althoug the sql-statement had to be parsed each time.
    What is the better way: pl/sql-procedure or sql-statements? On which conditions depend the choose?
    (For your information: our statements aren't difficult. In our testdatabase aren't much datasources.)
    Here is a snippet of our code:
    1. PL/SQL-Prozedure:
    CallableStatement cs = conn.prepareCall("begin dbrb_test_pkg.test(?,?,?); end;");
    cs.registerOutParameter(1, OracleTypes.CURSOR);
    cs.registerOutParameter(2, OracleTypes.CURSOR);
    cs.registerOutParameter(3, OracleTypes.CURSOR);
    cs.execute();
    ResultSet rs1 = ((OracleCallableStatement)cs).getCursor(1);
    ResultSet rs2 = ((OracleCallableStatement)cs).getCursor(2);
    ResultSet rs3 = ((OracleCallableStatement)cs).getCursor(3);
    2. SQL-Statements directly in Java-Code:
    String statement1b = "SELECT bva_id, bva_datva FROM bva";
    ResultSet rs1b = stmt.executeQuery(statement1b);
    String statement2b = "SELECT brb_id, brb_datein FROM brb";
    ResultSet rs2b = stmt.executeQuery(statement2b);
    String statement3b = "SELECT bper_id, bper_nz1 FROM bper";
    ResultSet rs3b = stmt.executeQuery(statement3b);
    Thanks a lot.
    Claudia and Nicole

    this is a case-to-case basis.
    it's ok to use the Statement/PreparedStatement if you're constructing your SQL or DML (insert/update/delete) statements. like when you're WHERE condition is dynamically created. this can be done also in PL/SQL (CallabeStatement) but passing of data is very tedious for you.
    the PL/SQL is much better to use if all your SQL or DML statements are fixed. besides, this is easier to maintain. when you need to change a statement, you don't need to check the statement in SQL prompt then make the necessary changes in your java codes, then compile the class. when you're using PLSQL, you just need to change and recompile the PL you made. then presto! it's done. as long as you don't change the parameters the PL receives and sends, it should perfectly work with your java code. =)

  • How to pass Unix environment variable to a SQL procedure or SQL * Plus

    Can any body suggest me how to ,
    How to pass Unix environment variable to a SQL procedure or SQL * Plus file..
    I am trying to invoke a SQL Procedure from Unix
    by passing the value of a Unix environment variable.
    Is it possible..?
    Thanks in advance.
    Regards,
    Srinivas Jaltaru

    Within your shell script you can use what is known as a "here document" which is basically a way of wrapping a call to Oracle. The following call to Oracle loops and writes rows to files with numerically increasing file names. Two unix shell variables are used, one in a select statement and one in a spool command :
    <pre>
    #!/bin/bash
    export ORACLE_SID=DEV05
    FILENO=1007351
    while [ ${FILENO} -le 1008400 ]
    do
    FILENAME=farm_${FILENO}.txt
    DUMMY=`sqlplus -s user20/user20 <<SQLSTOP
    set lines 73
    set pages 0
    set head off
    set termout off
    set echo off
    set feedback off
    select rpad(searchx, 8)
    from blastx@PRODUCTION
    where searchx = ${FILENO} ### here's a shell variable
    spool /export/home/user20/sql/psiblast/BACKUP2_D/${FILENAME} ### here's a shell variable
    spool off
    SQLSTOP`
    FILENO=`expr ${FILENO} + 1`
    done
    exit 0
    </pre>

  • Executing pl/sql procedure in SQL Workshop

    Hello.
    My understanding is that the only way to execute a pl/sql procedure in the SQL Workshop is via SQL Scripts, because running it under SQL Commands causes
    "ORA-00900: invalid SQL statement".
    Here is the statement I would like to run:
    execute efax_letter_to_pharmacist ('8888888888','ASDFSFSFSF','1','APN123456789','81');
    and here is the message I get when I run it under SQL Scripts:
    You have requested to run a script that does not contain any runnable statements.
    Script Name TEST
    Created on 02/14/2008 10:47:15 AM by ADMIN
    Updated on 02/14/2008 10:56:45 AM by ADMIN
    Number of Statements 0
    Script Size in Bytes 86
    thanks
    Boris

    Boris,
    Execute is a SQL*Plus command.
    It should work if you call your procedure in a begin-end block. e.g:
    begin
      efax_letter_to_pharmacist ('8888888888','ASDFSFSFSF','1','APN123456789','81');
    end;

  • Error while executing Multiple Stored Procedure through .sql file

    Hi Guru's.
    I am new to ORACLE. I am facing problem while creating Stored Procedure through .sql file.
    I have one test.sql file with Stored Procedure is like,
    CREATE OR REPLACE PROCEDURE skeleton1
    AS
    BEGIN
         DBMS_Output.Put_Line('skeleton1');
    END skeleton1;
    CREATE OR REPLACE PROCEDURE skeleton2
    AS
    BEGIN
         DBMS_Output.Put_Line('skeleton2');
    END skeleton2;
    Now when i try to execute this test.sql file through SQL PLUS it gives me Error like this
    I am opening test.sql file from SQL PLUS,
    SQL>
    1 CREATE OR REPLACE PROCEDURE skeleton1
    2 AS
    3 BEGIN
    4 DBMS_Output.Put_Line('skeleton1');
    5 END skeleton1;
    6 /
    7 CREATE OR REPLACE PROCEDURE skeleton2
    8 AS
    9 BEGIN
    10 DBMS_Output.Put_Line('skeleton2');
    11* END skeleton2;
    SQL> /
    Warning: Procedure created with compilation errors.
    SQL> show errors;
    Errors for PROCEDURE SKELETON1:
    LINE/COL ERROR
    6/1 PLS-00103: Encountered the symbol "/"
    SQL>
    Please suggest how to create multiple CREATE PROCEDURE using single .sql script file....
    Regards,
    Shatrughan

    Hi,
    Try this
    CREATE OR REPLACE PROCEDURE skeleton1
    AS
    BEGIN
    DBMS_Output.Put_Line('skeleton1');
    END ;
    CREATE OR REPLACE PROCEDURE skeleton2
    AS
    BEGIN
    DBMS_Output.Put_Line('skeleton2');
    END;
    /Save the file and call it.
    Regards,
    Bhushan

  • How to insert BLOB datatype image using PL/SQL Procedure and SQL Loader

    Hi,
    How to insert an image into database using PL/SQL Procedure and also how to insert using SQL Loader. Please help by giving sample code and process description.
    Thanks,
    Vijay V

    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:232814159006

  • How execute this stored procedure from SQL PLUS???

    Hello folks....
    Help me please...
    I have this procedure....
    CREATE OR REPLACE PROCEDURE TEST(COD OUT VARCHAR2, NUM OUT
    VARCHAR2, ID OUT VARCHAR2)
    AS
    BEGIN
    END;
    SO, I4D LIKE TO EXECUTE IT FROM SQL PLUS::
    BUT, I DONT KNOW HOW TO DO..PLEASE SEND ME A SAMPLE..
    THANK U

    Thank u man!!!
    look, my error before was :
    SQL> set serveroutput on
    SQL> declare
    SQL> cod varchar2(100);
    SQL> num varchar2(100);
    SQL> id varchar2(100);
    SQL> begin
    SQL> TEST( cod, num, id );
    SQL> EXEC DBMS_OUTPUT.put_line( cod || ' ' || num || ' ' ||
    id );
    SQL> end;
    SQL> /
    i put the EXEC....
    thank u!!!

  • Button that execute block code.

    Hello.
    I want to execute a block of code with the push of a button but I cannot find the solution.
    Attached is my vi. Any help is welcomed.
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    ButtonExecution.vi ‏9 KB

    Hello vakost;
    A few points:
    - The mechanical action of your Boolean is set to "Latch when Released". This means it will reset to False after being read once.
    - You have no software control timing in your loop, this is what's known as a "greedy loop" and will execute as fast as it possibly can
    Due to this, your True case will execute, but only once when you release the button, and the button will be reset to False before you likely see it because the loop is probably running many thousands of times per second. If you turn on execution highlighting to slow down the VI's execution to something you can observe, you should see the Boolean indicator turn on briefly before resetting.  You should still place a wait function inside your loop to slow things down to a reasonable speed, however.
    A few other tips:
    - You don't need to place the Boolean indicator inside the case structure if you want to update it in either case (you're using a value property node in the other case) - just place it outside the structure and wire the value you want to set out of the case
    - You've created a while loop with no stop condition, and the VI has to be aborted to stop it.  Generally you'll want to give the user a stop button to exit the VI, aborting is almost never a good idea.
    Regards,
    - You don't really need the case structure in this circumstance, you could just wire the Boolean OK button directly to the indicator.  My impression is that this is just a demonstrative example or experiment in how case structures work, though, so that's probably alright.
    Hope that helps!
    Tom L.

  • Find the user that executed the SQL procedure

    We are using Oracle 10g R2 on Linux.
    I want to know the OS user that executed the purging procedure (PURGE). For this, i am using the following query which is not returning any row:
    select *
    from DBA_HIST_ACTIVE_SESS_HISTORY ash, DBA_HIST_SQLTEXT s
    where ASH.SQL_ID = s.SQL_ID
    and UPPER(s.SQL_TEXT) like '%PURGE%';Is the above query fine?

    Moazzam wrote:
    We are using Oracle 10g R2 on Linux.
    I want to know the OS user that executed the purging procedure (PURGE). For this, i am using the following query which is not returning any row:Since what you are doing to get the user indirectly is not working would another approach be helpful?
    Since you want to know who is running the procedure would a log table you could insert into at the start or end of the procedure help, to store the information you are interesting in seeing?
    Or, can you get the information you want from other system views? V$SESSION has the OSUSER column as well as SQL_ID and other join columns for other views (like V$SQL).

  • How to execute an Stored procedure in SQLDeveloper?

    Hi
    Thank you for reading my post
    I want to know how i can execute an Stored procedure in SQL developer 1.1.0.21
    for example those sotred procedure from HR schema.
    one of them is add_job_history
    when i click on it and select run i see a new dialog with some sql as follow:
    DECLARE
      P_EMP_ID NUMBER;
      P_START_DATE DATE;
      P_END_DATE DATE;
      P_JOB_ID VARCHAR2(10);
      P_DEPARTMENT_ID NUMBER;
    BEGIN
      P_EMP_ID := NULL;
      P_START_DATE := NULL;
      P_END_DATE := NULL;
      P_JOB_ID := NULL;
      P_DEPARTMENT_ID := NULL;
      HR.ADD_JOB_HISTORY(
        P_EMP_ID => P_EMP_ID,
        P_START_DATE => P_START_DATE,
        P_END_DATE => P_END_DATE,
        P_JOB_ID => P_JOB_ID,
        P_DEPARTMENT_ID => P_DEPARTMENT_ID
    END;I checked the help and it said i should replace =>P_emp_id with some number
    I did that and i get error.
    can some one give me a sample for executing this procedure?
    thanks

    Remove the NULL values with the data you want to use in the SP.
    BEGIN
    P_EMP_ID := 32;
    P_JOB_ID := 'boss';
    For the date you have to chose the approriate string....

  • Get the report list in a PL/SQL procedure

    Hi to all,
    I need to get the list of the personal report of a specified user in a PL/SQL procedure, is this possible?
    My procedure should delete not "standard" report of a specified portal user.
    Then i must have the list of all user's reports and after do my delete logic.
    Jhon Dhon

    Jhon -
    It sounds to me that what you want to do is have a list that is generated based upon the identification of an individual. You can do this a number of ways, but I think you would want to write a straight query to accomplish this rather than a PL/SQL procedure. A query to accomplish what you're looking to do would look something like this:
    SELECT
    person_name,
    person_id_number,
    other info you need to see in the output
    FROM
    table_name (that contains the info you need to see)
    WHERE
    conditional clauses to obtain only data you wish to see
    AND :p_person_id = table_name.person_id_number
    The AND clause line will return the employee the user wishes to see based upon that person's ID number. This information is asked for in a parameter form before the report is run. The :p_person_id is referred to as a bind variable. You can read more about this on Metalink or OTN.
    HTH,
    Steve

  • 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

  • Problems trying to insert rows from PL/SQL procedure with existing seq..

    hello. please help me.
    i have a button that is calling an anonymous PL/SQL block and i am struggling with inserting records automatically when this button is clicked. an ordinary before insert DB trigger is launched:
    reate or replace TRIGGER "SPECSYS"."BI_SPEC_INSTRUCTS"
    before insert on "SPEC_INSTRUCTS"
    for each row
    begin
    if :NEW."ID" is null then
    select "SPEC_INSTRUCTS_SEQ".nextval into :NEW."ID" from dual;
    end if;
    end;
    in my PL/SQL I am trying to create a record automatically. stupid question that this undoubtedly is, how do i do this? if i leave the sequence column = null surely the trigger should take care of inserting the sequence into this column automatically?
    i have tried making the sequence column = null, leaving it out altogether (ie specifying all colums except this one on the insert statement) but with no success!

    this is not the problem!

  • How can i disable a submit button and execute submit_action method on click

    Good Day,
    On my page I have a submit button that execute the submit_action method of the page backing bean that submit data captured on the page into a database and activate another class that send mail at the same time on a click of the submit button,the mail process takes a while before returning back to the page.I was able to disable the submit button to prevent the user from keep click while the process is running but the issue is on clicking the submit button it only disable the submit button without executing the submit_action method of the page backing bean.How can i disable the submit button and execute submit_method of the backing bean at the same time.
    Thanks in advance.

    I tried this out on one of my pages to see if it works.
    First, I added the following JavaScript to my submit button's onClick event:
    this.disabled=true; return true;When I clicked the submit button, it was disabled but the form was not submitted.
    I deleted the JavaScript from the onClick event and added the following JavaScript to the form's onSubmit event:
    var button = document.getElementById("form1:submitButton"); button.disabled=true; return true;When I click the submit button, it was disabled and the form was submitted but the button's action method was not called.
    The next thing I tried was to change the onSubmit event code:
    var button = document.getElementById("form1:submitButton"); setTimeout("button.disabled=true", 500); return true;This seemed to work. The difference was that I added a 1/2 second delay before disabling the button.
    See if that works for you. If not then I'm fresh out of ideas.

  • PL/SQL procedure -- log files?

    Say when i execute a PL/SQL procedure using SQL* Plus. Is there a place where these executions are stored/logged? Any trace files?
    And, when a Java program calls my stored procedure, is there a place these transactions are stored, just to check what exactly is being passed to my stored procedure and what the procedure gave back as result set?
    Any pointers will be appreciated. Thanks.

    Hi
    Use a system.out.println(parametername) to check what values you are passing to the procedure.. you can see the results in your application server console.
    Thanks

Maybe you are looking for

  • Dynamic INSERT from associative array

    Ok, this would be an one-liner in python or perl, but as a newbie in PL/SQL, it feels like swimming in molasses. So before going on and reinvent the wheel, is there any builtin or sample code that generates dynamically an insert statement from a hash

  • Trouble with "Place Photoshop button".  It is not importing or "placing" my PSD file.

    So I have a triple layer PSD file of a custom facebook icon that I am trying to "place" into Muse.  (PSD file includes transparent backgound, layer 1 image, and layer 2 image).  When I go to the "Place Photoshop button" and select my PSD file contain

  • How do I split open an iMac?

    My 24 inch iMac has died. It seems that the power supply is the culprit. Without knowing for sure, I am going to open the back of the computer and take a look. Perhaps there is something as simple as a blown fuse. Task one is to figure out how to spl

  • **URGENT**Second opinion needed

    Hey, Currently have Iphone 3g, want to get the new blackberry bold. Prefer blackberries. Just would like some feedback on why to switch or not to switch,advantages vs disadvantages that I may not be thinking about. Have done research just need a gene

  • Small unreadable fonts in several applications

    I recently installed Adobe Reader 8 for Mac OS X 10.5. When I tried to activate the Adobe Reader "search document" feature, the new search page that popped up had a font so small that I could not read any of the text. All text appeared to be fuzzy sm