This content has been marked as final. Show 4 replies
DBA112 wrote:I'm not sure I understand. The structure of the AWR tables isn't changing and is known at compile time. The structure of your table is, presumably, unchanging and known at compile time. If you are trying to copy data from one static table to another, you would almost always want to use static SQL. I'm hard-pressed to see any reason to prefer dynamic SQL in this case.
I need to schedule it as part of recurring report that queries AWR tables in the database and dynamically prepares insert stmts to populate data in our custom tables.
I am going to restate what I think you are doing & I want you to say whether I correctly state what occurs.
You are generating AWR reports which takes data out of existing tables & deposits a text file on disk.
Now you are writing PL/SQL to read the text AWR report file so you can INSERT specific values into custom tables.
Are the 2 sentences above correct?
If so, why not use plain SQL to move the data from AWR repository table into your custom tables?