20 Aug 2009
Hi,
Lordbwithme2.
For your problem, we can have execute , execute immediate. Please let me know the exact syntax once you implemented it.
Thanks and regards,
Raja
21 Aug 2009
Hi,
I m sorry I dont have a script.Maybe some onlookers have it .
Best of luck
Raja
26 Aug 2009
Did this procedure work for you? what type privileges you had to get for the id that used to execute it?
You must sign in to leave a comment.

Hi all,
I have a requirement of passing tables names dynamically to a stored procedure. I have my table names, date fields stored in another table say XYZ.
table XYZ
---------------------------------------------
From_date | To_date | table_nm3
--------------------------------------------
Date1 | date2 | A1
Date3 | date4 | A2
Now i need to store the count of records in table (say A1) that fall between the Date1 and Date2.
insert into temp select count(*) from A1 where A1.dt_column between Date1 and Date2;
OR
To put it in simple terms, i need to count the records for all the table names present in XYZ table with their corresponding from_date and to_date and applied.
Insert into TEMP select count(*) from TABLE_NM3 Where TABLE_NM3.DT_COLUMN Between From_date and To_date;
I tried to use cursors for this. But I am facing a problem when i try to pass the date values from the cursor to the dynamic SQL.
Could someone help me on this.??