Q about Trigger/ PL SQL 
Author Message
 Q about Trigger/ PL SQL

Hello, I have a problem with a insert trigger. I belive this is a piece of
cake for someone with knowledge of PL SQL since that isn't me I'm asking
for help. What I want to do is to generate an unique ID for each new
insert. So far my trigger looks like this

SELECT SEN_ID
    INTO OLDID
FROM TDEF
WHERE TABLE = TABLENAME;
NEWID := OLDID+1;
UPDATE TDEF
SET SEN_ID = NEWID
WHERE TABLE = TABLENAME
AND SEN_ID = OLDID

The problem is, that sometimes this trigger generates an ID that already is
taken. So what we want to do is to ask the question Did the insert work or
not? If it didn't work we want to repeat this piece of code until the
answer is yes.

I hope someone could help me with this.




Tue, 26 Oct 1999 03:00:00 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. OH-Fairlawn-101453--PowerBuilder-PL/SQL-Stored Procedures-Triggers-ORACLE-SQL*Pl

2. OH-Fairlawn-101453--PowerBuilder-PL/SQL-Stored Procedures-Triggers-ORACLE-SQL*Pl

3. OH-Fairlawn-101453--PowerBuilder-PL/SQL-Stored Procedures-Triggers-ORACLE-SQL*Pl

4. what is the different of application trigger and database trigger in PL/SQL

5. VA-Northern VA-89513--ORACLE-PL/SQL-SQL *Loader-Triggers-Stored Procedures-Oracle Developer:

6. VA-Northern VA-89513--ORACLE-PL/SQL-SQL *Loader-Triggers-Stored Procedures-Oracle Developer:

7. VA-Northern VA-89513--ORACLE-PL/SQL-SQL *Loader-Triggers-Stored Procedures-Oracle Developer:

8. VA-Northern VA-89513--ORACLE-PL/SQL-SQL *Loader-Triggers-Stored Procedures-Oracle Developer:

9. Using SQL to change trigger PL/SQL text ?

10. VA-Northern VA-89513--ORACLE-PL/SQL-SQL *Loader-Triggers-Stored Procedures-Oracle Developer:

11. VA-Northern VA-89513--ORACLE-PL/SQL-SQL *Loader-Triggers-Stored Procedures-Oracle Developer:

12. SQL-92, Migrate PL/SQL at ORACLE into PL/SQL at SQL Server 7.0


 
Powered by phpBB® Forum Software