PL/SQL :: - NO_DATA_FOUND But Triggers Doesn't Continue Job

Sep 9, 2012

i've a problem regarding my code at line: 76. URL....

If i put a RAISE_APPLICATION_ERROR just before:
SELECT ID_GIOCATORE INTO CONTR_GIOCATORE2
FROM COMP_CONTR_GIOCATORE_PARTITA GC JOIN CONTRATTO C ON GC.ID_CONTRATTO = C.ID_CONTRATTO
WHERE GC.ID_PARTITA = :NEW.ID_PARTITA AND (C.ID_CASELLA = 28 OR C.ID_CASELLA = 12) AND C.ID_CASELLA <> :NEW.ID_CASELLA AND
[code]....

But if i put the RAISE_APPLICATION_ERROR just after this statement and before IF(CONTR_GIOCATORE2 IS NOT NULL AND CONTR_GIOCATORE2 = CONTR_GIOCATORE) THEN, nothing happens after the insert(that goes well) and the trigger doesn't do his job(insert,update etc). if i do that select, i got the no data found, so i put the exception to set the variable CONTR_GIOCATORE2 to NULL.

View 1 Replies


ADVERTISEMENT

SQL & PL/SQL :: Capture NO_DATA_FOUND From Ref Cursor?

Feb 11, 2013

I am returning a refcursor as OUT parameter in my stored procedure. I would like to capture a no data found for the refcursor. Is there a way I can raise the exception without compromising the performance?

I have tried the below options that are not working.

1. If I run a SELECT query to check for records and then OPEN the refcursor for that SELECT, then it takes a performance hit as I am reading the table twice.

2. I can FETCH a refcursor into a table type and check the count in the table to raise exception.But once I fetch from a refcuror, the data is gone. So, this option does not work either.

View 2 Replies View Related

SQL & PL/SQL :: SELECT Will Raise NO_DATA_FOUND Exception

Feb 10, 2011

I was going through the link: URL....Here within the box under the title 'Exception Handling -- Quick Facts and Tips', it states, Once you have handled an exception, normal program execution continues. You are no longer in an "exception" situation.

I wanted to verify this and used the below:The DDL and DMLs:

CREATE TABLE emp(empno NUMBER(4), ename VARCHAR2(10));
INSERT INTO emp VALUES(7369,'SMITH');

The program:

DECLARE
x VARCHAR2(10);
BEGIN
SELECT ename INTO x FROM emp WHERE empno=4567;
SELECT ename INTO x FROM emp WHERE empno=7369;
DBMS_OUTPUT.PUT_LINE(x);
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('ERROR OCCURED');
END;

The first SELECT will raise NO_DATA_FOUND exception. Even though I have handled it, the second SELECT is not executing.But the link says, that normal program execution will continue. So, Iam expecting the second SELECT statement to work.

View 4 Replies View Related

PL/SQL :: How To Insert Data While NO_DATA_FOUND Exception Raise

Aug 19, 2013

create or replace procedure set_update(p_name in varchar2,p_email in varchar2)is  l_data user_details%rowtype;                          beginselect * into l_data             from user_details ud             where ud.name = p_name             and ud.email = p_email;  if l_data.name = p_name and l_data.email = p_email then    update user_details    set last_login_date = sysdate , date_updated = sysdate     where name = p_name and email=p_email;  end if; exception when no_data_found then    insert into user_details(user_id,name,last_login_date,date_updated,date_created,email)    values (l_data.user_id,p_name,l_data.last_login_date,l_data.date_updated,sysdate,p_email);end set_update; 

This is my procedure will pass two parameters if it is available in table it will update other wise insert that data in table. My problem is while data is not available that data is inserted into table but that not inserted into table. 

View 7 Replies View Related

PL/SQL :: What Kind Of Exception Can Raise A Select Statement Excluding NO_DATA_FOUND

Oct 23, 2013

what kind of exception can raise a select statement excluding NO_DATA_FOUND; For example i try to run the following: select * from departments where departments_id=11; In a situation like that what kind of error oracle can raise?I'm asking this because i have some procedure that just do a select statment and i want to know if there is a valid reason to put the exception others at the end of the procedure.

View 25 Replies View Related

Database Idle But SCN Is Changing Continue

Jul 22, 2013

Current database scn is changing faster even though no application,no transaction is running. Database is idle but scn is changing continue, why?

17:25:00 SQL> select current_scn from v$database;

CURRENT_SCN
-----------
2477896
1 row selected.
[code]....

View 2 Replies View Related

SQL & PL/SQL :: Code To Use Instead Of CONTINUE But Have Same Logic Incorporated?

Oct 21, 2010

I have a BEGIN Block of the code where a loop is running .I also have a CONTINUE statement in the EXCEPTION Block of the code where I return the control to the BEGIN Block in case of any exception.Now as per ORACLE Company, CONTINUE has a old issue which is already registered by Oracle Company Bug 7306422.

The issue is where CONTINUE statement does not run properly when your code Optimization level is 2. However it will work properly if we have the Optimization Level as 0 and 1.are facing the same issue here and have a workaround.

Is there any code which I can permanently use instead of CONTINUE but have the same logic incorporated.i.e returning to the next iteration whenever I say to pass the control.

View 10 Replies View Related

SQL & PL/SQL :: How To Handle Exception And Continue Process

Aug 24, 2012

I am trying to execute the below package. While executing i face a problem where when NO DATA FOUND the excpetion is handled and coming out of the loop.but i want to to continue the loop after handling the exception.

Is there anyway i can modify the code

CREATE OR replace PACKAGE BODY pkg_purge_archive_check
AS
PROCEDURE Purge_archive_tables_check (purgerows IN NUMBER)
IS
v_num_1 NUMBER(10);
v_num_2 NUMBER(10);
v_multiplier NUMBER(10);

[code].....

View 15 Replies View Related

SQL & PL/SQL :: Won't Continue To Other Stuff Like Select / If / Then Statements?

Oct 9, 2013

if i have a function

function test_1
begin
if....then ...end
SELECT...
BULK COLLECT INTO..
FROM ....
[code]...

obviously this is not the whole code, but lets say the first if...then..end is true , does this mean it will exit the block? like it won't continue to the other stuff like select, if ...then statements?

View 15 Replies View Related

SQL & PL/SQL :: Continue To Get Compile Errors Attempting While Loop

Mar 19, 2010

I continue to get compile errors attempting a While Loop. Should I being using a For Loop?

DECLARE
v_item VARCHAR2(20) := &v_item;
v_cost vm_inventory.cost%TYPE;
v_expense CHAR(1) := '$';
loop_count Binary_Integer := 1000;
BEGIN
SELECT item, cost
[code]....

View 5 Replies View Related

Windows :: Unable To Continue Oracle 11g Release 2 Installation

Jul 24, 2013

I was prompted by an error in the middle of Oracle 11g Release 2 installation and unable to continue further.

The error was file not found e:product11.2.0.dbhome_3oc4jj2eeoc4j_applicationsapplications em.ear.

View 2 Replies View Related

Client Tools :: Toad Error / Can't Continue Running Procedure

Jun 4, 2012

I run procedure on toad 10.5, it gave me this error

Buffer overflow, limit of 20000 bytes

then it can not continue running the procedure.

View 8 Replies View Related

Installation :: Oracle 10g Installation Cannot Continue

Jul 10, 2012

When i am trying to install oracle database 10g, it is giving following error.Error in writing to directory :

c:Users:

ensure that this directory is writable and has atleast 55MB of disk space ,installation cannot continue.

View 4 Replies View Related

SQL & PL/SQL :: Instead Of Triggers?

Dec 26, 2011

What is the purpose and use of 'Instead of Triggers'

View 20 Replies View Related

SQL & PL/SQL :: Two Triggers On Same Table

Dec 4, 2010

I have to write two triggers on same table for auditing different columns of different users(may be different modules).

I will have an audit table in which i will insert data such as (user_id,module_id,column_name,old_col_val,new_col_val,timestamp)

Now different users from different modules will update the data on same table may be same columns from different front end forms!

If we write directly, we will not be able to know which column is updated by which user.

My question is in this case how can we control the triggers to raise differently?

View 3 Replies View Related

Triggers In Oracle

Jul 1, 2010

Im going to create a trigger(insert or update) for a table A, when it fires inserted or updated columns are should be insert or update into another table say table B, one column(Processed_time) in table B where its value will be by subtracting two columns in table A(response_time,Submission_time) all are timestamp type.

How to update(Processed_time) in table B by subtracting above two columns in table A.

View 2 Replies View Related

Compound Triggers Not Firing

Nov 1, 2011

I have rather large compound triggers that I discovered were not firing this morning, so I created a simpler compound trigger to test:

CODECREATE OR REPLACE TRIGGER "test"
FOR INSERT OR DELETE OR UPDATE OF KI_NM ON CHEMAXON.CB1ASSAYS
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
ENABLE
[code]...

It's just not firing. The tables are all in the owner's schema (who has DBA rights). My Google-fu is failing me, and I'm not sure how to start troubleshooting general trigger failure.

View 2 Replies View Related

Trc Files Generated From Triggers?

Dec 3, 2010

The trace directory is full of trc files with the text below:

--------Dumping Sorted Master Trigger List --------
Trigger Owner : INPUT
Trigger Name : CUS_TST
--------Dumping Trigger Sublists --------

There is like a file generated every minute, and i cant stop it from happening.I have tried setting the trace_enabled parameter to FALSE but no success.

View 2 Replies View Related

Dynamic Old Column Name In Triggers?

Jul 26, 2004

I have column names stored in a table(say t1).

Inside a trigger I have to dynamically get the : old. values for only these columns.

This I need because during update trigger on a table (say t2) I am supposed pickup the coumn names stored in t1 and get the : old values of only these columns to insert into a new table .

View 5 Replies View Related

SQL & PL/SQL :: Procedure Functionality As Triggers

Oct 26, 2010

I am creating triggers for audit operation when any insert/update/delete happens on a table automatically.Now i need the same functionality in procedure.

My requirement is to create procedure for all those triggers.

View 2 Replies View Related

PL/SQL :: DML Triggers Not Working Properly?

Jul 18, 2013

There are two servers A and B ,and i am maintaining one table suppose table1 and another table suppose table2 , DML triggers are made for both of these tables.The action of DML trigger is that the movement we are inserting values , suppose a table1 on server A so automatically the same set of value in table2 on server Bso my problem is that the movement i inserted value on table1 on server A ,

the same set of values were inserted into table2 of server B and as the values were inserted intotable2 , the same set of values were inserted into the tabld1 because of the trigger.  How to stop the non ending loop which occurs due to the simultaneous firing of triggers and insertion of same records into both the table endlessly...

version :---Personal Oracle Database 10g Release 10.2.0.3.0 TNS for 32-bit Windows: Version 10.2.0.3.0

View 0 Replies View Related

SQL & PL/SQL :: Why Doesn't Number Add Up When Do SUM On Column

Mar 21, 2011

I think I am having a rounding issue, but not sure. If I add all 4 rows below I get 1530.06. But when I use SUM, I get 1529.87

select PAY_EVENTS_AMOUNT
from PAYROLL_PAY_EVENTS_T1 PPET1
where ppet1.regnum = 130402134
and ppet1.pay_period = 2

PAY_EVENTS_AMOUNT
=================
-1499.19
2998.38
-30.68
61.36
=======
1530.06 TOTAL

========================================================

select sum(PAY_EVENTS_AMOUNT ) PAY_EVENTS_AMOUNT
from PAYROLL_PAY_EVENTS_T1 PPET1
where ppet1.regnum = 130402134
and ppet1.pay_period = 2

PAY_EVENTS_AMOUNT
=================
1529.87 TOTAL

View 12 Replies View Related

Triggers / Referencing Non-updated Fields?

Jan 11, 2011

I'm having a bit of a problem getting the syntax of a trigger right. Unfortunately, I have no DBAs locally, I use some third party software, and for reasons beyond my understanding, I have been told to use triggers, and not stored procedures, so I'm running with it.

The set up:

STRUCTURES table: contains several columns, one of which is the unique ID column.
ASSAY table: contains several rows, also with the same ID column, but can have more than one row per ID (several assays per compound). One column is XC_ASSAYS.

The idea of the trigger is basically: When a row in the ASSAYS table is updated, pull out the ID of the row, then calculate the average of the XC_ASSAYS columns for those rows, and report it to the STRUCTURES.XC_ASSAY column for that row ID.

My best attempt thus far results in compilation errors.

CREATE TRIGGER INHIB_W_ALA_TR
AFTER INSERT OR UPDATE ON ASSAYS
FOR EACH ROW
BEGIN
UPDATE STRUCTURES SET XC_ASSAY = (SELECT AVG(XC_ASSAY) FROM ASSAYS WHERE ASSAYS.ID = :NEW.ID) WHERE STRUCTURES.ID = :NEW.ID
END;
/

The resulting errors are:
LINE/COL ERROR
-------- -----------------------------------------------------------------
2/1 PL/SQL: SQL Statement ignored
2/190 PL/SQL: ORA-00933: SQL command not properly ended
12/0 PLS-00103: Encountered the symbol "end-of-file" when expecting

[code]...

I don't understand some of the errors, such as why line 2 SQL is ignored (it seems correct?), or I'm supposed to properly terminate the trigger (I've read ; and /, but I'm getting the end-of-file errors when I do so). Tried shuffling syntax and ' or " around - and I can't get it.The body SQL works when I replace :NEW.ID with an actual variable (such as 'NMP12'), but I'm not sure how to pass the ID variable from the updated row into the body. The ID is not updated, but other columns are.

View 3 Replies View Related

GoldenGate Sequence Replication And Triggers

Apr 29, 2013

I have a question about GG Sequence Replication and Triggers. My main database, which I would like to replicate on another server, is highly dependent on sequences for assigning surrogate keys to every row in every table in the application. I know that I need to add Sequence support to my source database (plus supplemental logging, etc), but I'm curious about the target database.

I do not anticipate allowing Read/Write access to this database - we are migrating from 10.2.0.4 (source) to 11.2.0.3 (target) on a new platform, and I want to keep the 11g database up-to-date with our production data until it is time to begin the actual conversion of our application. My thinking is that if I use the SUPPRESSTRIGGERS dboption in my Replicat session, this should take care of the use of the Sequences for assigning the surrogate key values, and the data should add to the tables normally without any intervention by the sequences/trigger combination. I know I will have to manually "correct" the sequences on my 11.2.0.3 database whenever I want to open this database up for use, but I have a script for this ready to go.

Also, in my source database, I am using Oracle Context indexes for generic name searching - this feature creates a number of DR$ named tables in the main application schema that I am replicating (approximately 50 of them). I am assuming that I should EXCLUDE these tables from the replication, as the context indexing should automatically update them as changes to the underlying data are applied via the replication of the indexed tables.

View 1 Replies View Related

Forms :: Mouse Triggers Not Working?

Sep 5, 2010

why when-mouse move,up,enter,leave are not working in oracle forms 10g except when-mouse-click and when-mouse-doubleclick on any items.

what i need to do to execute this triggers..

View 3 Replies View Related

SQL & PL/SQL :: Mutating Tables And Row Level Triggers?

Feb 24, 2010

I am unable to understand why row level triggers cant be used in mutating tables.

If you need to update a mutating table, you could bypass these restrictions by using a temporary table, a PL/SQL table, or a package variable. For example, in place of a single AFTER row trigger that updates the original table, resulting in a mutating table error, you might use two triggers--an AFTER row trigger that updates a temporary table, and an AFTER statement trigger that updates the original table with the values from the temporary table.

View 1 Replies View Related

Forms :: Can Change The Order Of Triggers In 6i

Dec 12, 2012

can change the order of triggers in forms 6i . that means firing in form level?

View 4 Replies View Related

SQL & PL/SQL :: Catch The Triggering Statement In DMl Triggers

Dec 23, 2011

How to catch or store the sql statement that caused the trigger to fire in DMl Triggers.

View 11 Replies View Related

Forms :: Triggers Regarding Find Query?

Oct 24, 2013

I am working on a form, whose one block is query_find, so on clicking find button it will open another block.the find block contain 4 column and second block contain around 10 column.but the column present in find block are associated to standard tables and the column present in block-2 are from custom tables.there is a query which link those column.

I am not sure where to use that query, so that it will take input from the find block and then populate the result into the block-2.

View 13 Replies View Related

Forms :: Triggers - Key Next And When Validate Item?

Jan 18, 2006

Suppose if I have defined two triggers Key-next and When-validate-item on the same item.

If my key-next is going to fire first and When-validate-item laterhow can the validation happen if I write a code like go_item('XXXX') in my Key-next.Does it mean that if u write a code in key-next to jump to some other item, no validation takes pLace?

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved