View previous topic :: View next topic
|
Author |
Message |
sunil_chappy
New User
Joined: 19 Mar 2006 Posts: 9 Location: Bangalore, INDIA
|
|
|
|
HI,
In COBOL-DB2 program my SQL taking too much time.......please tell me how i know whts the reason for that and how i solve that problem.
2. How i see the SQLCA contents after excution of program. |
|
Back to top |
|
|
Jag
New User
Joined: 07 Dec 2005 Posts: 30 Location: India
|
|
|
|
Hi...
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..
I hope i cleared your doubvt |
|
Back to top |
|
|
r2k1984
New User
Joined: 21 Jun 2005 Posts: 69 Location: chennai
|
|
|
|
ur query is not a optimised query.when u are using a big database try to use sub queries or groupb and having cammands. |
|
Back to top |
|
|
mann_naaz
New User
Joined: 13 Dec 2006 Posts: 4 Location: Pune
|
|
|
|
I M GETTING SQLCODE AND SQLSTATE IN SPOOL BUT IN HEXADECIMAL FORMAT
HOW TO GET IN DECIMAL FORMAT |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
HI Mann_naaz tyhe PIC of sqlcode is comp-4 so if u print the same it would be in hex format try this one
01 ws-sqlerr pic -9(3).
Move sqlcode to ws-sqlerr.
Display ws-sqlerr
and reg SQLSTATE it is X95) in picture clause so u can display it directly
Cheer's,
Thamilzan. |
|
Back to top |
|
|
mann_naaz
New User
Joined: 13 Dec 2006 Posts: 4 Location: Pune
|
|
|
|
THANKZ THAMILZN
I HAVE APPLIED IT AND IT IS WORKING. |
|
Back to top |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
Hi,
mann_naaz wrote: |
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
This make spool be displayed in hexadecimal to decimal and you can know the Equivalent |
|
Back to top |
|
|
|