hello,
I want to ask that where do we use the keyword called " signal " in SQL ? and what is the importance of this keyword ? I am sure many of you would be very well aware of this......can anybody help me with this ?
thnx
hello,
I want to ask that where do we use the keyword called " signal " in SQL ? and what is the importance of this keyword ? I am sure many of you would be very well aware of this......can anybody help me with this ?
thnx
SIGNAL -
With the SIGNAL statement, you can use it to raise an SQLSTATE exception. This statement can only be used within a trigger_body or within the body of an SQL routine, whose language type is SQL.
This statement will cause an SQLSTATE exception to be thrown and propagated back to your program.
You provide the text of the message.
NOTE: The SIGNAL statement rolls back the specific event that activated its trigger and all the changes caused by the trigger, as well as the original SQL statement of the user, which includes all the triggers and cascading actions that it invoked.
Syntax -
signal - The SIGNAL keyword is required as the first word in a SIGNAL statement.
sqlstate_message - The sqlstate_message is an SQL string literal value. You can specify any text they would like. The actual SQLSTATE code will be ZG014 and the SQL error code is 25014.
The signal keyword is specified under the trigger body. Whenever user triggers the condition ( BEFORE or AFTER ), the action is performed and this action is performed using the signal keyword.....rightly to signal the action when the specific condition triggers.
Bookmarks