Subject RE: [ib-support] Re: Can SLCODE 100 be trapped in an SP?
Author Alan McDonald
ALexander, can you enlighten me?
select exists?
Alan
-----Original Message-----
From: Alexander V.Nevsky [mailto:ded@...]
Sent: Friday, 18 October 2002 18:55
To: ib-support@yahoogroups.com
Subject: [ib-support] Re: Can SLCODE 100 be trapped in an SP?


--- In ib-support@y..., Bill Katelis <bill@s...> wrote:
> Alexander,
> Yes - I can work around it using a 'select count(*)' or checking
that
> the host variable is not null.

Bill, I recommend "exists" instead "count", it is significantly
faster if you are interested just in existance at least one record.
Notice "singular" too if you are interested in existance only one
record.

> Now I am intrigued - why would it be set to 100 given that that is
the
> 'not found' condition ?

I understand it that way: any SQL statement is in general case
operation on cursor, i.e. internally it is loop, you an me can be
shure there will be only one record affected, but server can't until
he don't perform it. So, he report "I searched records, performed what
you asked and did'nt find next record using your condition to update".
BTW, there is feature request in FB traker to provide ROWSAFFECTED
system global variable for SP/triggers which can be checked after
execution of statement.

Best regards, Alexander V.Nevsky.


Yahoo! Groups Sponsor
ADVERTISEMENT




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]