View previous topic :: View next topic
|
Author |
Message |
babu_hi
New User
Joined: 11 Apr 2006 Posts: 93
|
|
|
|
In the source programs(COBOL-DB2 Batch progrmas) we have different types database enquiries.Each type enquiry is declared in cursor and get the reight data from the database.All enquiries use only one table but in where cluse we are mention different fields in all enquiries.
Insted of doing enquiries in source programs,we are going to design a subroutine for all types of enquiries placed in this routine and return the right date in to commom output area in this subroutine.Then the source progrms use this common output area and do rest of logic in existing program.
For this we have use dynemic sql in the subroutine.
How do proceed for this kind of requirement.Please let me know the approach on this? |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
You mean to say that your cursor is going to be different of different inputs to the subprogram ...
If so for a particular input, construct the required cursor in your subprogram ... prepare, open and fetch the particular cursor only and return the result set ... |
|
Back to top |
|
|
|