Subject Re: [firebird-support] conditions on results
Author Alberto Pesce
Well
I use Firebirds 1.5 and ROW_COUNT work on Insert, Update and Delete and I
thought exist something for Select.
Ok I use INTO

Another question: suspend after exception is not necessary?

Alberto
Thank's for help



----- Original Message -----
From: "Martijn Tonies" <m.tonies@...>
To: <firebird-support@yahoogroups.com>
Sent: Tuesday, February 07, 2006 4:07 PM
Subject: Re: [firebird-support] conditions on results


> Hi,
>
>
> > What condition can I use for this (look example) in a store procedure?
> Note than in this table there aren't a not null rows
> >
>
> > SELECT code
> > FROM table
> > WHERE code = :myInput
>
> This misses an INTO clause.
>
> Initialize your variables used in the INTO clause with, for example,
> NULL. If no values can be found, the value will stay unchanged
> and you can check for this value in your code.
>
>
> > IF ( /* no result */) then
> > begin
> > exception myException;
> > suspend;
>
> SUSPEND has no effect here and should only be used
> in procedures that you want to make select-able.
>
> In Firebird 2, you can use the ROW_COUNT function.
>
> > end
> > ELSE
> > ....
> > ....
>
> Martijn Tonies
> Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
> Server
> Upscene Productions
> http://www.upscene.com
> Database development questions? Check the forum!
> http://www.databasedevelopmentforum.com
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>