what is the use of local variables in pl-sql @@Identity
why use Local variables like @@Identity, @@Error,....
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Santhosh Kumar JayaramanPosted Feb 12, 2013, 2:01 AM
After an INSERT, SELECT INTO, or bulk copy statement is completed, @@IDENTITY contains the last identity value that is generated by the statement. If the statement did not affect any tables with identity columns, @@IDENTITY returns NULL. If multiple rows are inserted, generating multiple identity values, @@IDENTITY returns the last identity value generated.
http://msdn.microsoft.com/en-us/library/ms187342.aspx
@@Error -Returns the error number for the last Transact-SQL statement executed.
Returns 0 if the previous Transact-SQL statement encountered no errors.
Returns an error number if the previous statement encountered an error.
http://msdn.microsoft.com/en-us/library/ms188790.aspx