Subject stored procedures and sqlcode
Author martene_firebird
Hi All!

I am trying to write a stored procedure which will perform a select
that returns one record. My problem is how to correctly use SQLCODE.
(I have read about error-handling in "Language Reference"
and "Embedded SQL Guide").

This is what I am trying to do(pseudo-code):

begin
select field
from table
where condition
into somevariable

if no_records_found then
begin
select field
from table
where some_other_condition
into somevariable
end
end


I would be very greatful if anyone could provide me with the correct
syntax.


Regards
/MÃ¥rten Ehnberg