Subject RE: [ib-support] Not in query
Author David Keith
Thanks Helen. I was afraid that it couldn't be done in one
statement in pure SQL, but wasn't certain. This is a good example
of how to get it done though.

Thanks again.

David Keith

Not in one statement - it can be done with a simple stored
procedure, though.

create procedure conditional_insert(var1 integer, var2
whatever,...)
as
begin
if (not(exists(select pk_table2 from table2 where pk_table2=
:var1))) then
insert into table2(col1, col2, ...)
values(:var1, :var2,.....);
end

Cheers,
Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________

To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.



[Non-text portions of this message have been removed]