Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLCODE returned with UNION

Status
Not open for further replies.

Robert Singer

Programmer
May 5, 2020
1
US
If you have multiple SELECT statements that are joined by the UNION keyword (UNION, UNION ALL, etc.), which SELECT statement determines what the value of SQLCODE will be after execution? Is it the result of the first SELECT, the last SELECT, the highest (absolute value) SQLCODE, or something else? (Also, in which manual can you find this information?) Thank you for your assistance.
 
if there is a UNION then it is a single SQL statement so the value of SQLCODE applies to that single SQL.

You may have more than one error and only the first one that the parser detects is shown - order "errors" are processed could be, but can't guarantee, the order they are.


Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top