Forum Discussion
joffre
13 years agoRegular Contributor
Okay... question then... why are you using your automation code to alter the contents of the SQL query files on the fly? If you have extraneous information in the files, why not create the proper files ahead of time? There's part of this process that I'm missing.
Let me explain what my entire script will do. By doing this I think you'll be able to help me.
First of all: what does "on the fly" means?
My script will rename Folders and Files to remove all blank spaces on it. So, I decided to rename all SQL files to a number, that indicates when it will be executed, as a queue of files.
After renaming my folders/files starts the most complex part.
My SQL files has a lot of commands. I'll need to open each SQL file, and search for the command "CREATE TEABLE xxxxxx" and rename it to
SELECT DECODE(COUNT(*), 0, 'FALSE', 1, 'TRUE') FROM ALL_TABLES WHERE TABLE_NAME='xxxxxx'
;
Note that my table name doesn't have quotes but they will receive quotes to SELECT command work.
The result of this renaming should populate a new SQL file, wich I'll execute to see if all my CREATE TABLES were executed successfully.
I think this is it.
Related Content
Recent Discussions
- 10 hours agod_gfleetwood92
- 11 hours agoFFCB