Subject Re: [firebird-support] conditions on results
Author Martijn Tonies
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