Subject Re: [firebird-support] IF and only IF
Author Lucas Franzen
Alberto,

Alberto Pesce schrieb:
> I need to make this:
>
> execute get_number('P', 2006)
>
> Insert into table ( ) values( )
>
> if and only if Inserted values in table {
>
> execute set_number('P', 2006)
>
> }
> else
> exception ....


Inside PSQL you can use ROW_COUNT which will return the number of rows
affected of the last DML_Operation.

IF ( ROW_COUNT ) = 0 then nothing happened
ELSE something happened.

So if the insert is done by another procedure just make this procedure
return the ROW_COUNT as output parameter.

Luc.