Subject Re: [firebird-support] exists(EXECUTE STATEMENT ...
Author Bjoern Reimer
Hi Helen,

>> (Firebird 1.5.1 CS on Linux)
>> in PSQL the following statement doesn't work:
>> [...]
>> "SQL" = 'SELECT "Id" FROM "SomeTable" WHERE "Fieldname" ='||
>> "ParameterOfSP";
>> [...]
>> Did I make a syntax error

HB> :-)

>>or is this a missing feature of firebird?

HB> EXECUTE STATEMENT is a PSQL statement syntax in its own right. You can't
HB> use it as some sort of extended "variable" to substitute into syntax of a
HB> DSQL statement (or any other statement at all).

HB> On the other side of the coin, an EXISTS() predicate can not take any kind
HB> of argument except a subquery.

But would be a nice enchantment, wouldn't it?
As EXISTS only Checks, whether there is a result or not it should be
possible I think.


HB> Back to the drawing board? You'll find the description and examples in the
HB> v.1.5 Release Notes.

I've read them but there was nothing about Exists :-)

I 've changed the query to a select count("Id")... INTO :"Counter"
which perfectly works.

HB> By the way, did you know that these infernal double quotes are not required?

Yes, but I normally I use mixed case variables. They are better
readable I think! But I know that many people are to lazy to enter
this two chars....

Thank you


SOFTbaer --- reimer@... ---