Trigger calling procedure, then commit problems

I am new to this so please forgive my stupidity!
I have a trigger:
CREATE OR REPLACE TRIGGER live_account_trigger
   AFTER INSERT
   ON sforce_live_test
   FOR EACH ROW
BEGIN
   mapsapp.live_account_upsert;
END live_account_trigger;
/which calls a procedure:
CREATE OR REPLACE PROCEDURE live_account_upsert
AS
   l_page   LONG;
   l_url    VARCHAR2 (1000) := 'http://sfdc-db-d1/~msimonds/live_upsert.php';
BEGIN
   --COMMIT;
   l_page := UTL_HTTP.request (l_url);
END;
/which invokes UTL_HTTP. What this process is supposed to do is set off a trigger to run the script in the procedure which simply inserts new records which are input into the table. Now if I do the following as a test:
insert into sforce_live_test (customer_name, schedule_id) values ('Fox and the Hound', 8020);
to kick off the trigger, the information is placed into the table and the script runs (it emails me to tell me it has processed) but the new data is not being sent to salesforce. It seems that it does not perform a COMMIT, becuase if I run the script via my web browser, it runs just fine after I run the script
What can I do to place a COMMIT into the procedure, because I get an error if I place it on

Okay that is a little beyond my knowledge at current time, i guess I need to do some research.
Maybe I need to explain what I am trying to accomplish and you could tell me if the JOB is the best solution before I continue:
We have an internal sales system which has all our major clients on it. New accounts are created and old accounts are updated from this internal system. Currently there is a view that is updated once every 24 hours from one Oracle DB to my instance of Oracle. I have a series of PHP account scripts that are set on CRON jobs that run once a week to send the new accounts and updated accounts to our instance of Salesforce.com over their API using SOAP
I created a staging table and the trigger which kicks off once an insert (for now, testing) into the staging table and then the UTL_HTTP to kick off a new account PHP script to send that transaction straight into salesforce. Kind of a live update instead of running the weekly CRON jobs
So I created this trigger (changed it since then to incorporate the procedure also):
CREATE OR REPLACE TRIGGER MAPSDATA.live_account_trigger
   AFTER INSERT
   ON sforce_live_test
   FOR EACH ROW
DECLARE
   l_page   LONG;
   l_url    VARCHAR2 (1000) := 'http://sfdc-db-d1/~msimonds/live_upsert.php';
BEGIN
   l_page := UTL_HTTP.request (l_url);
END live_account_trigger;
/But if I do a test by simply doing something like this:
insert into sforce_live_test (customer_name, schedule_id) values ('Fred Flinstone', 9060); to kick off the trigger (Mask/Test the creation of a new account), it does not pick up Fred Flinstone when the UTL_HTTP runs, it only updates the current records which are in the table prior to the test insert above.

Similar Messages

  • Trigger call procedure - Commit not allow

    Hi all,</p>
    <p style="margin-top: 0; margin-bottom: 0">I need help.</p>
    <p style="margin-top: 0; margin-bottom: 0"> </p>
    <p style="margin-top: 0; margin-bottom: 0">I have One table name</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">
    <font FACE="Courier" SIZE="2" COLOR="#808000">EVENTS. </font></font>
    <font FACE="Courier" SIZE="2">I have create two trigger on that table. </p>
    <p style="margin-top: 0; margin-bottom: 0">Trigger 1 is to add a running number
    to events table into "id" column.</p>
    <p style="margin-top: 0; margin-bottom: 0">Trigger 2 is to pass that running
    number in to other procedure after the new row in events complete fill in
    database.</p>
    <p style="margin-top: 0; margin-bottom: 0"> </p>
    <p style="margin-top: 0; margin-bottom: 0">The error is : Commit not allow in
    trigger.</p>
    <p style="margin-top: 0; margin-bottom: 0">The commit is only on my procedure.
    How i want to make it run? Help me.</p>
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">
    <p style="margin-top: 0; margin-bottom: 0"> </p>
    <p style="margin-top: 0; margin-bottom: 0"> </p>
    <p style="margin-top: 0; margin-bottom: 0"> </p>
    </font><font FACE="Courier" SIZE="2" color="#FF0000">
    <p style="margin-top: 0; margin-bottom: 0"><b>TRIGGER 1</b></p>
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">
    <p style="margin-top: 0; margin-bottom: 0">CREATE<font FACE="Courier" SIZE="2">
    </font>OR<font FACE="Courier" SIZE="2"> </font>REPLACE<font FACE="Courier" SIZE="2">
    </font>TRIGGER<font FACE="Courier" SIZE="2"> AUTONUM_EVENTS_ID1</p>
    </font>
    <p style="margin-top: 0; margin-bottom: 0">BEFORE<font FACE="Courier" SIZE="2">
    </font>INSERT</p>
    <p style="margin-top: 0; margin-bottom: 0">ON<font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#808000">EVENTS</font></p>
    <p style="margin-top: 0; margin-bottom: 0">REFERENCING<font FACE="Courier" SIZE="2">
    </font>NEW<font FACE="Courier" SIZE="2"> </font>AS<font FACE="Courier" SIZE="2">
    </font>NEW<font FACE="Courier" SIZE="2"> </font>OLD<font FACE="Courier" SIZE="2">
    </font>AS<font FACE="Courier" SIZE="2"> </font>OLD</p>
    <p style="margin-top: 0; margin-bottom: 0">FOR<font FACE="Courier" SIZE="2">
    </font>EACH<font FACE="Courier" SIZE="2"> </font>ROW</p>
    <p style="margin-top: 0; margin-bottom: 0">begin</p>
    <p style="margin-top: 0; margin-bottom: 0">    select<font FACE="Courier" SIZE="2">
    EVENTS_ID_SEQ</font>.nextval<font FACE="Courier" SIZE="2"> </font>into<font FACE="Courier" SIZE="2">
    </font>:new.ID<font FACE="Courier" SIZE="2"> </font>from<font FACE="Courier" SIZE="2">
    dual</font>;</p>
    <p style="margin-top: 0; margin-bottom: 0">end;</p>
    <p style="margin-top: 0; margin-bottom: 0">/</p>
    <p style="margin-top: 0; margin-bottom: 0"> </p>
    <p style="margin-top: 0; margin-bottom: 0">
    <font FACE="Courier" SIZE="2" color="#FF0000"><b>TRIGGER 2</b></font></p>
    <p style="margin-top: 0; margin-bottom: 0">CREATE</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">OR</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">REPLACE</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">TRIGGER</font><font FACE="Courier" SIZE="2">
    PROCESSINFO</p>
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">
    <p style="margin-top: 0; margin-bottom: 0">AFTER</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">INSERT</p>
    <p style="margin-top: 0; margin-bottom: 0">ON</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#808000">EVENTS</font></p>
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">
    <p style="margin-top: 0; margin-bottom: 0">REFERENCING</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">NEW</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">AS</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">NEW</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">OLD</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">AS</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">OLD</p>
    <p style="margin-top: 0; margin-bottom: 0">FOR</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">EACH</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">ROW</p>
    <p style="margin-top: 0; margin-bottom: 0">DECLARE</p>
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">
    <p style="margin-top: 0; margin-bottom: 0">BEGIN</p>
    </font><font FACE="Courier" SIZE="2">
    <p style="margin-top: 0; margin-bottom: 0"></font>
    <font FACE="Courier" SIZE="2" COLOR="#808000">    UpdateInfo</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">(:new.ID);</p>
    </font><font FACE="Courier" SIZE="2">
    <p style="margin-top: 0; margin-bottom: 0"></font>
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">EXCEPTION</p>
    </font><font FACE="Courier" SIZE="2">
    <p style="margin-top: 0; margin-bottom: 0"></font>
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">WHEN</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#ff0000">OTHERS</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">THEN</p>
    </font><font FACE="Courier" SIZE="2">
    <p style="margin-top: 0; margin-bottom: 0"></font>
    <font FACE="Courier" SIZE="2" COLOR="#008000"><i>-- Consider logging the error
    and then re-raise</p>
    </i></font><font FACE="Courier" SIZE="2">
    <p style="margin-top: 0; margin-bottom: 0"></font>
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">RAISE;</p>
    <p style="margin-top: 0; margin-bottom: 0">END</font><font FACE="Courier" SIZE="2">
    PROCESSINFO</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">;</p>
    <p style="margin-top: 0; margin-bottom: 0">/</p>
    </font>

    Because of the following :
    Restrictions on Trigger Implementation The implementation of a trigger is subject to the following restrictions:
          The PL/SQL block of a trigger cannot contain transaction control SQL statements (COMMIT, ROLLBACK, SAVEPOINT, and SET CONSTRAINT) if the block is executed within the same transaction.If you really want to do a commit then search for autonomous transaction.
    Hope that helps
    Regards
    Raj

  • Trigger calling ctx_ddl.sync_index problem

    Dear,
    In order to keep my context indexes up-to-date, I'm trying to write a trigger calling this PL/SQL procedure on update/insert/delete statement.
    However, there must be a problem in my trigger definition since it gives compilation errors! I don't see what 's wrong!
    This is my trigger definition:
    =========BEGIN==================
    create or replace trigger update_lexicon_expl_nl after insert or delete or update on lexicon begin execute ctx_ddl.sync_index('lexicon_expl_nl'); end;
    =========END===================
    The compilation error is something like:
    "Encountered ctx_ddl when expecting one of the following :=.(@;immediate"
    PS. calling 'execute ctx_ddl.sync('myindex') in SQL Plus is workigng OK
    Please help.
    Dirk

    You do not need to trigger that table,there are two way to 'update' index.
    1.Alter index your_index_name rebuild.
    2.Set up background DML process, which need you work with an DBA or you have ctxsys role.

  • Since I upgraded to IOS 7.0.2, many times I am unable to answer the calls. Then I have to switch off and on to answer the calls. I checked with my three friends who updated and they are also facing same problem. Kindly let me know the solution.

    Since I upgraded to IOS 7.0.2, many times I am unable to answer the calls. Then I have to switch off and on to answer the calls. I checked with my three friends who updated and they are also facing same problem. Kindly let me know the solution.

    Since other millions of people updated and do not have that problem - it means one of two.
    1.Your friends lied to you and do not have that problem and in that case only your installation of ios7 got corrupted and you need to restore your phone.
    2.Your friends didn't lie to you and all 4 of you need to restore phones (that way reinstalling ios 7 properly)
    here are instructions for restore and you may have to backup before restore.
    iTunes: Restoring iOS software - Support - Apple

  • Is it allowed to use parts of an existing record for building a new song in Garageband, e.g. the rhythm part of that record?  Is this what people call ripping or trimming? And if it is allowed, what is the procedure then?

    Is it allowed to use parts of an existing record for building a new song in Garageband - e.g. the rhythm part of that record?  Is this what people call ripping or trimming?  And if it is allowed, what is the procedure then?  Are there special programs for it?

    Dikkie wrote:
    Is it allowed to use parts of an existing record for building a new song in Garageband
    unless you pay royalties to the copyright owner of that song, it's illegal to use someone else's recordings to build your own (which software you use doesn't enter the equation):
    About Fair Use:
    http://www.bulletsandbones.com/GB/Tutorials.html#fairuse
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Oracle Forms 6i - mySQL (Commit Problem)

    Hi,
    i'm using Oracle Forms Builder 6i to connect to mySQL 3.23.49 via
    Oracle Open Client Adapter for ODBC 6.0.5.35.0
    Now I have a problem of controlling which form to commit if more than one form are opened.
    E.g. I need to open 2 forms (eg. A, B) and only want to commit the changes made on Form A
    1.
    I open the forms using the follows (i can't use OPEN_FORM('A', SESSION); since mySQL doesn't support)
    OPEN_FORM('A');
    OPEN_FORM('B');
    2.
    then I changed both forms
    Now the :SYSTEM.FORM_STATUS, :SYSTEM.RECORD_STATUS, :SYSTEM.BLOCK_STATUS are 'CHANGED'
    3.
    I then press my custom save button on form A (triggers KEY-COMMIT). Inside KEY-COMMIT, it calls COMMIT_FORM, then triggers
    ON-COMMIT eventually. In ON-COMMIT, i use the built-in COMMIT to commit the changes.
    Then I found that :SYSTEM.FORM_STATUS, :SYSTEM.RECORD_STATUS, :SYSTEM.BLOCK_STATUS are 'QUERY' which is normal. However both
    forms are committed.
    4.
    So I fixed it by: In ON-COMMIT, add RAISE FORM_TRIGGER_FAILURE; after COMMIT. Although it stops committing changes on another
    form. But :SYSTEM.FORM_STATUS, :SYSTEM.RECORD_STATUS, :SYSTEM.BLOCK_STATUS are still 'CHANGED'. Then I do a EXECUTE_QUERY
    after COMMIT_FORM to change back :SYSTEM.FORM_STATUS, etc to 'QUERY'
    5.
    It works. Only Form A is committed. However when Form A has a lot of records (eg. >500), it affects performance.
    Does anyone know how to solve this problem?
    Any help would be greatly appreciated
    Peter

    The question is not how you disable a key, it might be more how to disable a functionality. What functionality do you want to disable? By default F5 maps to the KEY-MENU-trigger, if thats the function you want to disable, write a NULL; in the KEY-MENU-trigger.

  • Call procedure while creating view in hana.

    Can we call procedure while creating a attribute view like
    CREATE VIEW "PAYROLLDBTEST"."@HourTransactionView"
    "DocEntry",
    "DocNum",
    "EmpID",
    "EmpCode",
    "FullName",
    "TableName",
    "TranName",
    "U_FromDate",
    "U_ToDate",
    "NoOfDays",
    "U_FromTime",
    "U_ToTime",
    "NoOfHours",
    "OvertimeHours",
    "UnpaidDays",
    "Weekends",
    "Holidays",
    "U_Remarks",
    "U_BatchNo",
    "ProjectCode"
    ) AS SELECT
      T0."DocEntry" AS DocEntry,
        T0."DocNum" AS DocNum,
       T0."U_EmpCode" AS EmpID,
    CALL PAYROLLDBTEST.GetEmpCodeFromEmployeeID('EmpID')  ,              (getting syntax error here).
        GetEmployeeFullName("@TRANSACTION_HOURS".U_EmpCode) AS FullName,
          T0."U_TransactionType" AS TranCode,
        GetHourTableName("U_TransactionType") AS TableName,
         GetHourTransactionName("U_TransactionType") AS TranName,
        T0."U_FromDate",
        T0. "U_ToDate",
          DAYS_BETWEEN("U_FromDate", "U_ToDate") + 1 AS NoOfDays,
          T0."U_FromTime" AS U_FromTime,
           T0."U_ToTime" AS U_ToTime,
        IFNULL("U_WorkHours", 0) AS NoOfHours,
         IFNULL("U_OvertimeHours", 0) AS OvertimeHours,
        IFNULL("U_PaidDays", 0) AS PaidDays,
         IFNULL("U_UnpaidDays", 0) AS UnpaidDays,
        IFNULL("U_WeekendsCount", 0) AS Weekends,
         IFNULL("U_HolidaysCount", 0) AS Holidays,
          T0."U_Remarks",
           T0."U_BatchNo",
        T0."U_ProjectCode" AS "ProjectCode"
        FROM
        "@TRANSACTION_HOURS" T0
        INNER JOIN
        "OHEM" T1
        ON
         T1."empID" = T0."U_EmpCode";

    Hello,
    The problem could be a SAPGUI related problem... Whats the current sapgui patch level ? Does it work when you try on another wokstation with the same user ?
    Could you please use SAPGUI 720 and update your patch level to 7 ? Then check the behaviour again.
    Best regards
    Rene

  • Each procedure have commit statement

    I call five procedure individually, and each procedure have commit statement from .net environment i.e. click event of submitt button call five procedure
    but now i want only one commit statement for all five proceduce if all procedure successfully
    executed.
    suppose first two procedure successfully execute then third procedure raise some exception, in that case previously execute procedure data successfully comitted, but i want them rollback because all five procedure does not successfully execute.

    What does this have to do with OCI? Sounds like a transaction control question...
    The answer is to commit at the end of the transaction from the client code, and not at the end of each procedure call.

  • Calling Procedures form Report 6i

    I would highly appreciate it if I can get advise on how to call procedures from report 6i.
    My procedure requires two input parameters and returns about six columns in all. The problem I have is in trying to figure out how to display the values returned on the report.
    I checked the on-line help to no avail. Thanks.

    You can put placeholder columns in your data model group and populate them by using them as the OUT parameters in your stored procedure, called from a formula column. The placeholder columns can then have fields referencing them in the report layout.
    HTH
    Paul Williams

  • Update user hook called procedure

    i have user hook pakage calling the registered user hook procedure like this
    XX_USER_HOOKS.CREATE_SIT_B(P_ID_FLEX_NUM => P_ID_FLEX_NUM
    ,P_PERSON_ID => P_PERSON_ID
    ,P_SEGMENT1 => P_SEGMENT1
    ,P_SEGMENT2 => P_SEGMENT2
    ,P_SEGMENT3 => P_SEGMENT3
    ,P_SEGMENT4 => P_SEGMENT4
    ,P_SEGMENT5 => P_SEGMENT5
    ,P_SEGMENT6 => P_SEGMENT6
    ,P_SEGMENT7 => P_SEGMENT7
    ,P_SEGMENT8 => P_SEGMENT8
    ,P_SEGMENT9 => P_SEGMENT9
    ,P_SEGMENT10 => P_SEGMENT10
    ,P_SEGMENT11 => P_SEGMENT11
    ,P_SEGMENT12 => P_SEGMENT12
    ,P_SEGMENT13 => P_SEGMENT13
    ,P_SEGMENT14 => P_SEGMENT14
    ,P_SEGMENT15 => P_SEGMENT15
    ,P_SEGMENT29 => P_SEGMENT29
    i just want to add new parameter for it, do i need to re register or something from this type, or just add the new parameter line in the call procedure and recompile the package???

    Hi,
    Yes you are correct that there cannot be commit in hook procedures and that's the reason I told you to commit assuming that if you are executing the packages from TOAD/PL-SQL Dev to test the working of the functionality before deploying, and many times we do simple mistake of not committing and viewing the data on forms.
    If you are getting the element entry created in the same month then there seems to be no reason why the element should not be visible on form. You can try doing a comparison of the element entries getting created from front end and the one which you are creating using hook. Create an element entry in the same month from front end and compare both the records from back-end to see if you are missing anything.
    Thanks,
    Sanjay

  • Call procedure

    Is there possible to call/exec procedure when it is assigned in variable?
    If Add(a,b) is my procedure, then taking the following command
    exec add(4,5)
    then it gives
    9
    Now i want
    Declare
    p varchar2='add(4,5)';
    begin
    --how can i call/exec the add procedureby using variable p.
    --p; /* not working */
    end;

    Hallo,
    I don't know if I understood right,
    but I think you just want to execute a procedure wich is stored in a variable.
    I think this workaround will help!
    declare
    v_statement_text VARCHAR (50):=' begin your_procedure; end;';
    begin
    execute immediate v_statement_text;
    end;
    Bye

  • Getting NLS setting issues when calling procedure

    Hi,
    Can anybody suggest me what could the problem in the below issue?.
    i am invokeing procedure using DBAdapter. My soa version is 11.1.1.5. When i am calling procedure first time it is working fine. But when i am invoke second time
    it is showing below error. I observed that i am getting error alternativly. So kinldy advice me what could be the issue.
    Error:
    Cause: java.sql.SQLException: ORA-20001: Oracle error -20001: ORA-20001: Oracle error -2074: ORA-02074: cannot SET NLS in a distributed transaction has been detected in fnd_global.set_nls.set_parameter('NLS_LANGUAGE','AMERICAN'). has been detected in fnd_global.set_nls. ORA-06512: at "APPS.APP_EXCEPTION", line 72 ORA-06512: at "APPS.FND_GLOBAL", line 240 ORA-06512: at "APPS.FND_GLOBAL", line 1410 ORA-06512: at "APPS.FND_GLOBAL", line 1655 ORA-06512: at "APPS.FND_GLOBAL", line 2171 ORA-06512: at "APPS.FND_GLOBAL", line 2313 ORA-06512: at "APPS.FND_GLOBAL", line 2251 ORA-06512: at
    Regards,
    Adhi

    Hi:
    Another way to avoid this, is to use an Non-XA Datasource.
    Hope this helps
    best

  • How I call procedure  in interactive report??

    Hi
    Is possible that call procedure in interactive report on APEX?
    Because
    in region source it asked only sql statement so I am confused and I dont know how call procedure in interactive report ?
    Edited by: esra aktas on 12.May.2011 11:04
    Edited by: esra aktas on 12.May.2011 12:05

    I am confused... Now, acoording to my senior porject in school my advisor want to that lots of procedures' name and arguments that I have collect them in a table. I collected procedures in table then I wrote a procedure that call wanted procedure by using dynamic sql and run that procedure..I select procedure name on selectlist on apex then that procedure run.
    So I want to my procedure's results must be as dataset in report . But report's source want to sql statement but I want to call the procedure as I mentioned.
    If you have any idea about my situations , I want to get your adviced.
    I have a this procedure.
    create or replace
    PROCEDURE CALLSPFROMTABLE(id number,arg1 varchar2,arg2 varchar2)  as
    table_name varchar2(30):='procedures';
    procname varchar2(1000);
    begin
    EXECUTE IMMEDIATE 'select procname from ' || table_name || ' where id='||id into procname;
    EXECUTE IMMEDIATE 'BEGIN '||procname||'('||arg1||','||arg2||'); END;';
    END;id=>:p1_SP , arg1=>:P1_YIL arg2=>:P1_BIRIM from selectlists
    Edited by: esra aktas on 12.May.2011 13:08
    Edited by: esra aktas on 12.May.2011 13:17

  • Exception handling in calling procedure

    Hi,
    i have a package where currently am making calls to private procedures from public procedure.
    and the senario is:-
    create package body p_tst
    is
    ex_failed exception;
    -- this is private proc
    procedure p_private
    is
    begin
    raise ex_failed;
    exception
    when ex_failed
    then
    raise;
    end p_private;
    procedure p_public
    is
    begin
    -- nomaking call to private
    -- procedure
    p_private;
    -- here i need to catch
    -- the raised exception
    -- passed from the called
    -- procedure
    when ex_failed
    end p_public;
    end;
    basically i want to catch the exception being passed from called procedure to calling procedure, and raise the same exception in calling procdure.
    is it possible to catch the same exception in the calling procedure?

    Yes, you can catch the same exception in the calling procedure, exceptions are propagated to the caller if they are not handled in the called procedure.
    Is this what you are trying to do?
    CREATE OR REPLACE PACKAGE p_tst
    AS
       PROCEDURE p_public;
       ex_failed   EXCEPTION;
    END;
    CREATE OR REPLACE PACKAGE BODY p_tst
    IS
       PROCEDURE p_private
       IS
       BEGIN
          RAISE ex_failed;
       END p_private;
       PROCEDURE p_public
       IS
       BEGIN
          p_private;
       EXCEPTION
          WHEN ex_failed
          THEN
             DBMS_OUTPUT.put_line ('error');
       END p_public;
    END;
    SQL> set serveroutput on;
    SQL> exec p_tst.p_public;
    error
    PL/SQL procedure successfully completed.

  • Executing operating system command within trigger or procedure

    Hello
    Can some one help me out as how to execute operating system command (unix or windows ex.. stop,start,cc,del or copy etc...) in a trigger or procedure.
    My requirement is, if some predefined error occure then listener listener should be stopped automatically.
    Thanks in advance
    kvss

    Here is some code to tell you how to do:
    First a small Java program that taker a string as a parameter and executes it as an os-command
    import java.lang.Runtime;
    import java.lang.Process;
    public class Commands extends Object {
    * Constructor
    public Commands() {
    // On NT the command should be like this "cmd /c del c:\temp\readme.txt"
    // exec execute('cmd /c del c:\temp\readme.txt');
    public static void execute (String cmd ) {
    try {
    Process p = Runtime.getRuntime().exec(cmd);
    try {
    p.waitFor();
    catch (java.lang.InterruptedException intex ) {
    intex.printStackTrace();
    System.out.println("Return = "+ p.exitValue());
    System.out.println(" Done ...");
    catch ( java.io.IOException iox) {
    iox.printStackTrace();
    ===================end of java ====
    Use loadjava to load it into the database and create a pl/sql wrapper around the java code.
    See the manual about loadjava details.
    Log in to sqlplus as SYSTEM and create a role for this purpose e.g. 'JAVA_ROLE'
    and exec the following as SYSTEM or SYS to make sure the user has the the needed privs.
    dbms_java.grant_permission('JAVA_ROLE','SYS:java.io.FilePermission','<<ALL FILES>>','read,write,execute,delete');
    dbms_java.grant_permission('JAVA_ROLE','SYS:java.lang.RuntimePermission','writeFileDescriptor',null);
    dbms_java.grant_permission('JAVA_ROLE','SYS:java.lang.RuntimePermission','readFileDescriptor',null);
    and you're done.

Maybe you are looking for

  • How can I send mail mail as different address using iCloud?

    I have setup Mail in OSX Lion to use my iCloud account ([email protected]) succesfully. When I compose a new message I would like to be able to send from an email address other than [email protected] (eg. [email protected] which is an email account I

  • Strange System.out.print behavior inside a for loop

    I'm trying to create a simple ASCII progress bar in the console that would display like this: |--------------------------------------------| ============================More equal signs would appear as time goes on. At least this is what I want to ha

  • Calculating Bandwidth

    How to calculate total bandwidth utilization of a circuit if i have In and Out data rate? Is there any formula?

  • Setting javac -source 5 in ktoolbar.

    Hi, I'm trying to compile a midlet that uses Java 5 (AKA Java 1.5 AKA Java 2 AKA Java <--right?) features such as enums and generics. I've been using the ktoolbar program to do this, but when I run it is says I must use -source 5 or higher to enable

  • How can I edit the background colour of captions?

    Hi I am new to Captivate, and am liking what I am able to produce. However, I would like to use our corporate colour as the background of the captions. Does anyone know of any way I can do this? Many thanks in anticipation. Anne