Trigger that executes the stored procedure does not

I have a trigger on a table which triggers the update of the column 'APPLICATION_OFFER_SENT '! The trigger looks like this:
CREATE OR REPLACE TRIGGER SCHEMA.COPY_APPLICATIONS
AFTER UPDATE
OF APPLICATION_OFFER_SENT
ON PPLE_T_APPLICATION 
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
    UPDATE_OR_INSERT_APPL(:old.PK_APPLICATION_NO);
END;
Simply, he runs a procedure and takes the "PK_APPLICATION_NO" as a single parameter.

When I run the SP itdefl: exec UPDATE_OR_INSERT_APPL (1042); It works very well.
But when its done through the relaxation it doesn't?



The Proc looks like this:
CREATE OR REPLACE PROCEDURE SCHEMA.UPDATE_OR_INSERT_APPL (IN_APPL_NO NUMBER) IS

CURSOR c1 IS
SELECT title, fullname, universityid, appl_no,  appl_no_hash, OFFER_EXPIRATION_DATE, APPLICATION_CANCEL_DATE, room_hall 
  FROM SCHEMA.ACCOM_APPLICATION_VIEW
 WHERE appl_no = IN_APPL_NO;

rowcnt NUMBER;

 BEGIN
  FOR rec IN c1
      LOOP  
      SELECT COUNT(*) INTO rowcnt FROM SCHEMA2.ACCOMM_OFFER_ACCEPTANCE a WHERE a.appl_no = IN_APPL_NO;
           
           IF rowcnt = 0  THEN
               INSERT INTO SCHEMA2.ACCOMM_OFFER_ACCEPTANCE (title, fullname, universityid, appl_no, appl_no_hash, offer_expiration_date, application_cancel_date, room_hall)
                    VALUES (rec.title, rec.fullname, rec.universityid, rec.appl_no, rec.appl_no_hash, rec.offer_expiration_date, rec.application_cancel_date, rec.room_hall);
                    COMMIT;
                    
                    
                    
           ELSIF rowcnt !=0 THEN
           
                UPDATE SCHEMA2.ACCOMM_OFFER_ACCEPTANCE t
                   SET (t.offer_expiration_date, t.application_cancel_date, t.room_hall) = (select OFFER_EXPIRATION_DATE, APPLICATION_CANCEL_DATE, ROOM_HALL from SCHEMA.ACCOM_APPLICATION_VIEW B
                                                                                                  where B.appl_no = IN_APPL_NO);        
          
           END IF;

      END LOOP; 
 END;
Published by: oraCraft on Oct / 09/2010 09:11

Published by: oraCraft on Oct / 09/2010 09:11

>
Validation is in my stored procedure, is not my trigger. I'm sure it's very good
>

It is not very well according to the Application Developer Fundametals guide...

>
DDL statements are not allowed in the body of a trigger. Furthermore, no control of transaction
statements are allowed in a trigger. SAVEPOINT, COMMIT and ROLLBACK cannot be
used. For system triggers, TABLE {CREATE/ALTER/DROP} instructions and
EDIT... COMPILE are allowed.
Note: A procedure is called by a trigger cannot perform the previous transaction control statements,
because the procedure runs in the context of the body of the trigger.
>

There is an exception to this rule if you use the pragma AUTONOMOUS TRANSACTION, but I do not see that in your trigger.

Kind regards
Bob

Tags: Database

Similar Questions

  • How can I force DAC to run always full load for one of the task that executes the stored procedure? And remaining tasks load incremental in the second and sub sequent executions.

    Hello

    How can I force DAC to run always full load for one of the task that executes the stored procedure? And remaining tasks load incremental in the second and sub sequent executions.

    Thank you

    Jay.

    Hi if your task is running an informatica mapping you can set your DAC task to run the full mapping for incremental and full loads, so tab task just point to the mapping.

    Hope that helps.

    Thank you

  • setting report parameters fails for the report that runs the stored procedure in QMR FDM 2.1.1

    Hello

    Can someone help us please on this issue we have; If a solution is already available somewhere on the forum please link me to it.

    Please see our situation;

    The script below was part of the customization of a colleague to a script of Oracle FDM ("AftFileImport").

    There are no screenshots at this stage that came back to us with a temporary workaround.

    More detailed description:

    We built a custom report of FDM ("FSBValidationErrorsforAllLocations") that accepts two parameters (CatKey, period) and which calls a procedure stored in SQL Server with the same two parameters. FDM SQL statement of the report is:

    RUN FSBValidationErrorsforAllLocations ' ~ time ~', ~ Cat Key ~

    It works through the User Interface.

    When you try to put the two settings by customizing the event Oracle 'AftFileImport'script, the report fails. Below the part of the code in the 'AftFileImport', where we tried to fill values:

    • objReport.mParametersClear
    • objReport.mParametersAddNew "CatKey", RES. PstrCat
    • objReport.mParametersAddNew 'Period', RES. PstrPer

    We must understand why the way above to the definition of the parameters does not work with stored procedures, as seems to be the only documented way Oracle of setting parameters.

    Please let me know if that's enough.


    Thank you in advance.

    Hello

    which is the error when you run the script?

    • objReport.mParametersAddNew "Cat Key", RES. PstrCat

    Try again with the white space as it is how you named your parameter in the report definition, didn t you?

    Also try to use the built like the following examples:

    objRP.mParametersClear
    objRP.mParametersAddNew 'Period', CDate (dtePeriod)
    objRP.mParametersAddNew 'Loc', CLng (lngLocation)
    objRP.mParametersAddNew 'CatKey", CLng (lngCatKey)
    objRP.mParametersAddNew "TargAcct", CStr (strAutoMapAcct)

    Concerning

  • For loop stored procedure does not

    Hello

    I wrote a stored procedure that does not work (I mean do not display data)
    I set serveroutput on option also.
    If I run as a single SQL query its working very well. so please help

    create or replace procedure show_empnos (p_deptno number)
    is
    emp_id emp. EMP_ID % TYPE;
    cursor cur_emps is
    Select emp_id emp where department_id = '12';
    Start
    for a cur_emps in
    loop
    dbms_output.put_line (emp_id);
    end loop;
    end;


    See, when I ran that a single SQL interrogate data dosplayed

    SQL > select emp_id from emp where department_id = '12';

    EMP_ID
    ----------
    * 101 *.
    * 101 *.
    * 101 *.

    Help, please.

    You declare a local variable EMP_ID you initialize ever, so it will always be NULL.
    In your cursor, you also select a column EMP_ID.

    The line

    dbms_output.put_line(emp_id);
    

    solve the use of uninitialized local variable and then print a NULL value (which would appear as a blank line in the output). Assuming you want to return the value of the column EMP_ID your cursor, you need

    dbms_output.put_line(a.emp_id);
    

    As a general approach, including local variables whose names match exactly in the name of a column will create problems on the line where you write the code assumes that you speak for column only to discover that the identifier is resolved to the local variable instead. If you need a local variable to store the EMP_ID, therefore, it would make much more sense to declare it as

    l_emp_id emp.EMP_ID%TYPE;
    

    While it is not accidentally get confused with the name of the column.

    Finally, if department_id is a NUMBER, it should be compared to a number, not a string, i.e.

    WHERE department_id = 12
    

    Justin

  • roles authenticated using stored procedures does not...

    Mr President.
    See the steps I went through that
    create user100 user identified by 123;
    create user101 user identified by 123;
    Grant create session, create role, create the procedure to user100;
    Grant connect to user101;
    change the quota of the user user100 10 M on users;
    grant create table to user100 with admin option;
    Conn user100/123
    create or replace procedure settingrole as
    Start
    dbms_Session.set_role ('dummy');
    end;
    /
    create the dummy role identified using user100.settingrole;
    grant create table to dummy;

    Grant execute on settingrole to user101;



    Conn user101/123

    execute user100.settingrole;
    now the error I get is ora-06565 cannot run set role in stored procedures
    ORA-065512 to the sys.dbms_session line

    can u help me please how to do this job

    You must create the procedure with the right of the applicant (article AUTHID CURRENT_USER). See more on the secure application role http://download.oracle.com/docs/cd/B28359_01/server.111/b28337/tdpsg_privileges.htm#CIHHGDAE tutorial

  • Why the Kill_session procedure does not work?

    Hi all

    I like to kill session grant the user of the app in the dev environment. So I did the following steps, but the procedure kills him the session while testing.

    Step 1:

    create or replace procedure kill_session
    (
    p_sid NUMBER,
    p_serial # NUMBER
    ) AS
    m_sql VARCHAR2 (1000);
    m_loginusername VARCHAR2 (30);
    m_killusername VARCHAR2 (30);
    m_schemaname varchar2 (30);
    BEGIN
    SELECT a.USERNAME, a.SCHEMANAME INTO m_killusername, m_schemaname
    SESSION $ v one
    WHERE a.sid = p_sid
    AND a.serial # = p_serial #;
    Select the user in double m_loginusername;
    IF m_loginusername = m_killusername AND m_schemaname NOT IN ('SYS', 'SYSTEM')
    THEN
    m_sql: =' the ALTER SYSTEM KILL SESSION ' | " ' || p_sid | «, » || p_serial # | '''|| "' IMMEDIATE ';
    EXECUTE IMMEDIATE m_sql;
    dbms_output.put_line ("'Session killed.");
    ON THE OTHER
    dbms_output.put_line (' User Login ' | m_loginusername |) "The user to Kill ' | m_killusername);
    dbms_output.put_line ('can't kill session from other users or Admin users');
    raise_application_error (-20101, ' can't kill the session to other users or Admin users, or self');
    END IF;
    EXCEPTION
    WHILE OTHERS THEN
    dbms_output.put_line ('Error in Session kill.' |) SQLERRM (SQLCODE));
    END kill_session;

    Step 2:

    Grant execute on sys.kill_session to the APP.
    Grant select on v_$ APP session;

    Step 3:

    To validate this permission to kill session, as a s/n, I created the TEST user and created a session. Then I tried to kill the TEST user's sid, but the procedure did not kill the session instead it gives power like PL/SQL executed successfully.

    By
    Mr.B

    Set serveroutput on

    SQL> set serveroutput on
    SQL> exec sys.kill_session(132,10);
    Session Killed.
    
    PL/SQL procedure successfully completed.
    
    {code                                                                                                                                                                                                                                                                                                                                        
    
  • RUN THE CALLBACK IMMEDIATE VS? TO EXECUTE THE STORED PROCEDURE

    Hello

    StatementExc: = SYMBOLS. DYNPLSQL_PLUGIN_CALL_BEGIN | rec_WfFunctionSourceCode.Schema | SYMBOLS. DOTc
    || rec_WfFunctionSourceCode.package | SYMBOLS. DOTc
    || rec_WfFunctionSourceCode.OPERATION_FUNCTION_CODE | SYMBOLS. DYNPLSQL_PLUGIN_CALL_END;

    -dbms_output.put_line (4 CALL ' | to_char (SYSTIMESTAMP));
    EXECUTE IMMEDIATE StatementExc with the HELP OF RetVal1, IN OUT eoBufferia;

    How to make the implementation of RECALL as an EXECUTE IMMEDIATE to exec Stored Procedure another package?

    Thanks in advance,

    Best regards

    Domenico Simone

    Hi, Domenico,.

    What is CALLBACK in PLSQL?

    Here is an example of use of object types [emulating callbacks | http://www.adp-gmbh.ch/blog/2005/august/19.html]

    Concerning
    Peter

  • When you add that bookmark the location menu does not appear.

    Firefox on Ubuntu 10.04 10.0.2 - when I add a bookmark the secondary menu (which allows to choose the location) does not appear. The bookmark is created in the bookmark main 'folder '. I can handle the bookmark after its creation, but it is not very effective.

    Any ideas how to fix this? Thanks in advance.

    Hello

    Please check if this happens in Safe Mode.

    Extensions of the issues

    Troubleshooting Extensions and themes

    Uninstalling the modules

    Uninstalling toolbars

  • CF claims Oracle stored procedure does not exist.

    Hello world

    Cold Fusion says

    Run database query error.

    [Macromedia] [Oracle JDBC Driver] [Oracle] ORA-06564: object CICOD. CI_GET_SUMMRPT_LANGUAGES. GET_LANGUAGE_PREFERENCES is no ORA-06512: at "SYS." DBMS_UTILITY", line 114 ORA-06512: at line 1
    The error occurred in /apache/ www_dev_7084/bes-partners/Integrated Reports/language_preferences_report.cfm of labour: line 41
    39 :   <cfprocparam  
    40 :     value="0" 
    41 :     cfsqltype="cf_sql_numeric">
    42 : </cfstoredproc>
    

    My Oracle package works very well when it is called from an Oracle procedue and I checked the CF user privileges for the package.

    My code is below.

    Any suggestions?

    Thanks in advance for your help,

    Lou

    Cold Fusion

    < cfstoredproc procedure = 'CI_GET_SUMMRPT_LANGUAGES. GET_LANGUAGE_PREFERENCES"dataSource ="cicod_dev">
    < cfprocresult
    name = "p_reply" >
    < cfprocparam
    value = "1 January 09.
    cfsqltype = 'cf_sql_date' >
    < cfprocparam
    value = "1 April 09 '.
    cfsqltype = 'cf_sql_date' >
    < cfprocparam
    value = "1".
    cfsqltype = "cf_sql_numeric" >
    < cfprocparam
    value = '0 '.
    cfsqltype = "cf_sql_varchar" >
    < cfprocparam
    value = '0 '.
    cfsqltype = "cf_sql_numeric" >
    < / cfstoredproc >

    Package Oracle statement

    create or replace
    PACKAGE CI_GET_SUMMRPT_LANGUAGES
    AS
    -See http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_17938 method 1: reference cursor method
    -p_reply_cursor Oracle and ColdFusion coding.
    TYPE p_reply_cursor
    IS
    REF
    CURSOR;
    PROCEDURE GET_LANGUAGE_PREFERENCES
    (
    p_reply ON p_reply_cursor
    p_start_date IN this update,
    p_end_date IN this update,
    p_sum_column in NUMBERS
    p_region_selections IN VARCHAR2,
    p_location_selection in NUMBER);
    -P_sum_column values determine the columns to SUM.
    c_registration_reregistration (1) CONSTANT INTEGER: = 1;
    c_served (1) CONSTANT INTEGER: = 2;
    END CI_GET_SUMMRPT_LANGUAGES;

    Oracle Package body (header only)

    PROCEDURE GET_LANGUAGE_PREFERENCES
    /*
    p_reply:... Cursor that contains the requested data.
    p_start_date:... Start date of request.
    p_end_date:... End date of query
    p_sum_column:... See GET_LANGUAGE_PREFERENCES.c_registration_reregistration
    and GET_LANGUAGE_PREFERENCES.c_served.
    p_region_selections. . Selections from region to report, separated by commas.
    p_location_selection:. Selection of rental to the report.
    */
    (
    p_reply ON p_reply_cursor
    p_start_date IN this update,
    p_end_date IN this update,
    p_sum_column in NUMBERS
    p_region_selections IN VARCHAR2,
    p_location_selection in NUMBERS)
    AS

    So that this works, the user associated with the Data Source ID "cicod_dev" must be the same for the owner of the Package "CI_GET_SUMMRPT_LANGUAGES".  Alternatively, you can code the name of the owner in your CF code...

    CFSTOREDPROC procedure = '. CI_GET_SUMMRPT_LANGUAGES. GET_LANGUAGE_PREFERENCES ".

    HTH

  • How to execute a stored procedure on Sybase with SQL Developer

    We have accessed Sybase 15 with SQL developer.

    We can see the data in the table, if we do not, run the stored procedure (for instance sp_who) developed on Sybase.

    Could you tell me how we execute the stored procedure on Sybase with SQL Developer Sybase?

    Thank you

    Shige

    We will not intended to be a Sybase ASE customer.

    But

    A SQL Developer... @dermotoneill: Workheet advice

  • Using the stored procedure

    We use the procedure attached to within an ASP application obfuscation of the password database. I am able to use the same procedure in CF without modification? Right now, I have tried with cfstoredproc but'm "Procedure 'dt_External_Encrypt' expects parameter '@Encrypted', which was not supplied."



    You do not use the ODBC driver.

    Most likely, there is a typing error in the code or the stored procedure is not also displayed (or a copy).

    Change procedure = "dt_External_Encrypt" to procedure = "dbo.dt_External_Encrypt" "

    Open Query Analyzer, 'Edit' code stored procedure and make sure that it is really such displayed.

    Finally, try changing returnCode 'no '.

    If all else fails, join the code exact CF code and code from Query Analyzer.

  • Procedure does not display output

    Hello!

    The following procedure does not show the output.

    {create or replace procedure GET_USER
    (username_in IN VARCHAR2, password_in IN VARCHAR2, OUT VARCHAR2 first_name, last_name OUT VARCHAR2)
    is
    Start
    Declare the cursor is c_user (users.username%TYPE, i_password IN users.password%TYPE IN i_username)
    Select first_name, last_name
    users
    where username_in = i_username
    and password_in = i_password;

    i_username users.username%TYPE;
    i_password users.password%TYPE;

    l_first_name users.first_name%TYPE;
    l_last_name users.last_name%TYPE;

    Start
    If c_user % isopen then
    close c_user;
    end if;
    Open c_user (i_username, i_password);
    extract the c_user in l_first_name l_last_name;
    close c_user;

    first name: = l_first_name;
    name: = l_last_name;
    end;
    end GET_USER ;}

    Output showing only:

    Name =
    Last_name =

    Thanks for any help!

    Assuming that your cursor never returns a line with name of user and password (if it is not, which seems quite a big security hole!), then your code could just be rewritten:

    create or replace procedure GET_USER (p_username_in IN VARCHAR2,
                                          p_password_in IN VARCHAR2,
                                          p_first_name OUT VARCHAR2,
                                          p_last_name OUT VARCHAR2)
    is
    begin
      select first_name, last_name
      into   p_first_name, p_last_name
      from   users
      where  username_in = p_username_in
      and    password_in = p_password_in;
    end GET_USER;
    /
    

    I modified your parameter names, as they have matched the same names as the columns in your table, and it's usually a Really Bad Idea (tm)! Keep all your unique identifiers, and you will have less problems!

  • By pressing the home button does not take me to the home screen of iOS 9.3.3

    I have recenly updated upgraded to iOS 9.3.3 and I noticed that pressing the home button does not take me to the home screen. The only way to get there is by using the creature of multitasking. (double pressing the home button) Also, some applications seem to freeze if turn my phone off and then turn it back on, or when I access it via the multitasking function. Can someone please help?

    Try a forced reboot. Hold down the Home and Sleep/Wake buttons at the same time for about 15 seconds, until the Apple logo appears. You won't lose anything.

    If a force restart does not help, try a system restore. First save your device via iTunes. Also import your photos on your computer and copy all the important data. Reconstruction of the support first test and test. If this does not help, you may need to restore as a new and reconfigure from scratch as the backup may be damaged. It is important to have your photos and your saved data separately from the backup. Here are the steps for a restoration:

    https://support.Apple.com/en-us/HT201252

  • Restore not working - the option to restore on my machine does not work. I've highlighted the dates. Does not work in safe mode

    Original title: restoration works not

    The weight restoration on my machine does not work. I've highlighted the dates but I get... impossible to restore messages. I tried switching off my virus checker (Norton) but with the same result.

    Some tools Anti Virus 'protect' your system so that they will not allow a restore of the system work properly.
    For example, if you use Norton/Symantec products, you will see a message like this:
    Restoration incomplete. Your computer cannot be restored...
    It is also a popular Symantec problem (well, I'll be polite and call an "undocumented feature"...), they wrote an article about it:
    According to what you use for malware protection, you may need to disable the product temporarily, do the system restore and then turn the products light up again when the system restore is complete.
    Sometimes you need start your system in Mode safe and so that your protection programs are not running, and then do the system restore.

    Tips from Microsoft in some of their articles that if the system restore does not restore your computer, start in Safe Mode, and then run the system restore.

    It works for some configurations.

  • Problem when executing a stored procedure

    Hello
    im a beginner, using v (10.2.0.1.0) of Oracle 10 g on a linux machine.
    Cannot run after the procedure through query iSQLPLUS im interface.

    create or replace procedure (pd_hr)
    PNO varchar2,
    PDT date default sysdate,
    PHR number,
    perr_msg out varchar2
    ) as
    Start
    PHR: = 2;
    end pd_hr;

    Number of phr VARIABLES;

    Perr_msg VARIABLE VARCHAR2 (250);

    run pd_hr('pno',,phr,perr_msg).

    It flashes the following error when I try to execute the stored procedure:
    ERROR on line 1:
    ORA-06550: line 1, column 44:
    PLS-00201: identifier "PHR" must be declared.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    I ran the following query through DBA connection before performing the procedure:
    GRANT EXECUTE ANY PROCEDURE 'SCOTT ';

    Any form of assistance will be invaluable!

    Peter

    Hi, Peter,.

    Put a colon (': ') before binding variable names except when declaring:

    -- No colons here:
    VARIABLE phr number;
    VARIABLE perr_msg VARCHAR2(250);
    
    -- Colons needed here
    execute pd_hr ('pno', NULL, :phr, :perr_msg);
    

Maybe you are looking for

  • CAN NOT ENTER IN THE WOODS

    I can't get into the bios, I tried upgrading it too see if that was the problem, but it does not how can I get bios is anyway I can do I try and I need to put a second more robust any ideas on how to enter

  • QMap in QSettings record and back to the rear

    Hi again. I'm a bit of a desperate situation. I have a card flightList which is QMap< QString, QMap > flightListMap; Now, I need to store this card, then pull it out back when the application opens. I learned that QSettings serves for this purpose. W

  • DatabaseException: attempt to write a readonly database

    I am trying to insert data into my database, but I get this exception. I did not put my database is a readonly one, but I get this DatabaseException. where can I do it in writing?

  • BlackBerry smartphones set curve 9320

    Just got a new bb cannot set up Guard email saying not connected to the internet! Loaded the bbm R59 MTN prepaid guest on hold awaiting authorization. Help, please!

  • New HP Envy with NVIDIA GT730 / 2GB. PS don't detect GPU.

    New HP envy with NVIDIA GT730 / 2GB. PSCC detects no GPU. NVIDIA is correctly configured and installed. Native Intel graphics card does not appear even more. NVIDIA is set for PS and Snort to use only the GT730. PS frequently display the error messag