visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: SQL Compatibility issues :: oracle equivalent to not exists


By: kurtsThyme U.S.A.  Date: 04/10/2005 18:34:26  English  Points: 20 Status: Answered
Quality : Excellent
What is the oracle equal to
If not exists (select * from table where tableID=1)
begin
insert into table(tableID,label)
values(1,newLabel)
end
By: VGR Date: 04/10/2005 20:51:00 English  Type : Answer
Hello ;-)

You may try something like this :

DECLARE exists PLS_INTEGER; BEGIN select count(*) into exists from table where tableID=1; if exists = 0 then execute immediate 'insert into table(tableID,label) values(1,newLabel)'; end if; END; /

By: VGR Date: 09/10/2005 09:52:38 English  Type : Comment
fair enough ? Don't forget to post feedback or to close the question (button "A" like Accept or "S" like Split) ;-)
By: OpConsole Date: 13/11/2005 12:19:25 English  Type : Comment
Hello. This is the last reminder before forced closure of the Question. Suggested choice : Accept last VGR answer.

You may Accept or Split the answer by clicking on the relevant button of the relevant comment ;-)

Regards

Do register to be able to answer

EContact
browser fav
page generated in 336.139920 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page