View previous topic :: View next topic
|
Author |
Message |
sachinmallya83
New User
Joined: 27 Jan 2008 Posts: 4 Location: mumbai
|
|
|
|
If the user wishes to sort on any one of the five fields of a table in either ascending or descending order then how could this be coded in cobol-DB2 using minimum number of queries. We would get the column name and ascending/descending flag from front end and this functionality needs to be incorporated in a stored procedure.
Example:
Field1 Field2 Field3 Field4 Field5
abc 123 abc aaa 111
bcd 234 zxc bbb 222
.................................
If the user clicks on any field name on the front end screen for the first time the data would be displayed in ascesnding order. When he clicks on the same field name for the second time then the data would be displayed in descending order.
Would dynamic SQL be a solution? Can dynamic SQL be used in cobol? If yes , how can we use it for our application. |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
You need to have 10 cursors for this in static SQL.
Dynamic SQL can do this using 2 cursors But Dynamic SQL is usually costly and not preferred in case of online programs.
STFW to get info about Dynamic SQLs. |
|
Back to top |
|
|
|