Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

subquery in IF statement in trigger, without using foreign keys

968875Nov 14 2012 — edited Nov 14 2012
Hello,

I'm investigating ways of writing a subquery in an IF statement, which is placed inside a trigger.
I wanna write smth like IF (:new.jazz not in (select goldies from T where ... )) etc. I don't know whether the fact that the IF is in a trigger adds some additional restrictions. (Does it?)

So far I found the solution described here: 1082641 which I find a bit tacky, I could have the 'cooleststarinthegalaxy' instead of 1 and seems you need to do extra light, but still extra lifting.

I also read about the possibility of using MERGE, which I'm currently researching.

Is there any other way?

Thanks

Edited by: BluShadow on 14-Nov-2012 13:37
fixed link

Edite by me: the question is how (if possible) to do this without a foreign key.

Edited by: questioningq12 on Nov 14, 2012 6:11 AM

Edited by: questioningq12 on Nov 14, 2012 6:13 AM
This post has been answered by BluShadow on Nov 14 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 12 2012
Added on Nov 14 2012
12 comments
2,234 views