The main reason for taking much time for running query may be you have n't used the Indexes in the Where clause of the query.Or you query may really fetching more data...
Coming to next question..Are you using the query in the application program or SPUFI..If yo are using spufi you will get the SQLCODE and SQLSTATE and stuff of the execution irrespective of whether the query has been exexuted Sucessfully or nor..If you are using the query in the Application program then while handing the error you give the display statement for the SQLCA parameters which you can see in the output..
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
I M GETTING SQLCODE AND SQLSTATE IN SPOOL BUT IN HEXADECIMAL FORMAT
HOW TO GET IN DECIMAL FORMAT
SQLCODE is always hexadecimal.
If you want to display as a decimal you can do it by programing as explained by prav_06, But if the client doent require in reporting it is not that requried to program to know it ( As it will take extra code and space)
For this issue this command in the spool
SET HEX ON
This make spool be displayed in hexadecimal to decimal and you can know the Equivalent