Subject | RE: [firebird-support] Problem with a condition... |
---|---|
Author | Thomas Steinmaurer |
Post date | 2004-03-09T13:02:14Z |
Hi,
begin
if (not exists(select 1 from pilote where pilotename = :s_name)) then
begin
exception data_error;
end else
...
end
HTH,
Thomas Steinmaurer
LogManager Serie - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database and MS SQL Server
Upscene Productions
http://www.upscene.com
> I'm trying to test if a name is known in a table before executingTry:
> some operation or to raise an exception, but it seems i've done
> something wrong, let's have a look :
>
> ...
> begin
> if (:s_name not in (select pilotename from pilote)) then
> begin
> exception data_error;
> end
> else
> begin
> ...
>
>
> I have : "subselect illegal in this context", can you tell me why,
> please ?
begin
if (not exists(select 1 from pilote where pilotename = :s_name)) then
begin
exception data_error;
end else
...
end
HTH,
Thomas Steinmaurer
LogManager Serie - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database and MS SQL Server
Upscene Productions
http://www.upscene.com