` Printed Icetips Article

Icetips Article



SQL Related Articles: Creating an exception in FireBird that sends information to Clarion
2004-03-29 -- Arno Rog
 
Newsgroups: comp.lang.clarion

(with Gemin ODBC, could you please confirm Firebird ODBC?)

Create an exception with the name 'costs_to_much', e.g. 'I'm sorry, there

is not enough money to buy this product'

Create a stored procedure, e.g. SP_CHECK_PRICE to calculate if there is
enough money to buy a certain product, kind of:

IF savings < price_of_product
   EXCEPTION costs_to_much;


In your clarion app do the following:
Filename{PROP:SQL} = 'execute SP_CHECK_PRICE'
! And now what it is all about!!!
IF FILEERRORCODE()
   MESSAGE(FILEERROR())
END

Above example pops the message 'exception 1. I'm sorry, there is not
enough money to buy this product' on my screen!

Mind you, make sure you read page 165 and further in the DataDef Manual.
In Firebird, when a procedure encounters an exception, it terminates that
particular procedure and undoes any actions performed (directly or
indirectly) by that procedure.

Hope this helps.

Arno Rog
Amsterdam



Printed November 23, 2024, 3:33 am
This article has been viewed/printed 35221 times.
Google search has resulted in 197 hits on this article since January 25, 2004.