View previous topic :: View next topic
|
Author |
Message |
praveena avaluru
New User
Joined: 29 Sep 2010 Posts: 9 Location: bangalore
|
|
|
|
Hi
I have a requirement to select some tables and get the count of the row for a certain timeline dynamically in a cobol program
Ex :
Select count(*) from :WS-TABLE-NME
where date < current_date
My workshop does not allow me to use dynamic sql. Please suggest me any other way possible.
Regards
Praveena Avaluru |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Put static queries for all the tables in one cobol program... or you can put in different cobol programs too... |
|
Back to top |
|
|
praveena avaluru
New User
Joined: 29 Sep 2010 Posts: 9 Location: bangalore
|
|
|
|
There are more than 100 tables to be queried and the count can increase over a period of time. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
So, how did those incompetent morons you work for come to give you a requirement and simultaneously forbid you to use the means of fulfilling it? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
What do you do after you counts?
It wouldn't be bad idea to run all querys in batch for all the tables to get counts in one file.
Read this file in Cobol and do whatever you want. |
|
Back to top |
|
|
praveena avaluru
New User
Joined: 29 Sep 2010 Posts: 9 Location: bangalore
|
|
|
|
Well thats is the reason i had to reach out to this fourm i guess to find if any alternative is possible |
|
Back to top |
|
|
praveena avaluru
New User
Joined: 29 Sep 2010 Posts: 9 Location: bangalore
|
|
|
|
The request is to get the count of changes from a particular date
The date is part of input.
In anycase writing 100 queries is inevitable |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
The request is to get the count of changes from a particular date |
that makes little or no sense.
since the only difference in the sql is the table name,
a quick and dirty REXX could build this for batch input, in a second.
although it would take longer than a second to write the rexx script - about 10 to 15 minutes. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
By the way, all the 100 tables have the same column name for the date ? |
|
Back to top |
|
|
|