What is the use of local variables in pl-sql @@Identity
why use Local variables like @@Identity, @@Error,....
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Feb 11, 2013, 9:01 PM EST
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