What I want to do currently, is to use DBExec to run a script from another file.
I did use the ReadFile command to do it, since that's one way in extracting data. The problem is, as I have encountered, when comments are added into the mix. Essentially, based on my observation, comments are not skipped.
What is the best way around this problem?
Running an SQL Script
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Running an SQL Script
I'm not really sure I understand the question. DBExec is for executing SQL statements like INSERT and UPDATE statements, not for running other script files. Maybe you can explain what you are wanting to do.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Running an SQL Script
What I am attempting to do is that basically, I have an SQL file that I want to run in Macro Scheduler, but when I convert the file's contents into a Macro Scheduler script to run this file, there were some problems that prevented it from being run fully. Essentially what I want to do is:
1) Have an SQL file (.sql) with script ready. Specifically, I am putting new things into an empty database.
2) Copy the SQL File's contents into a string.
3) Use said string in Macro Scheduler's DBExec function
The problem is that, certain types of keywords might not be compatible with DBExec, such as GO.
1) Have an SQL file (.sql) with script ready. Specifically, I am putting new things into an empty database.
2) Copy the SQL File's contents into a string.
3) Use said string in Macro Scheduler's DBExec function
The problem is that, certain types of keywords might not be compatible with DBExec, such as GO.
PPQ
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Running an SQL Script
This is going to be down to the database type and their ODBC/ADO driver that you are using. You would need to consult their documentation. DBExec in Macro Scheduler is dumb. Macro Scheduler does zero processing. DBExec is simply a conduit through to the database driver you are using. The SQL string you enter is simply passed on to the driver which passes it to the database server. We have no control over the content of that. The syntax is decided by the database vendor. It is possible I guess that their driver supports less than what can be achieved within the database software itself, but I have no idea.
If you tell us which database flavour this is and which driver you are using I *might* be able to help you look up some documentation.
Sorry to sound like I'm passing the buck, but really, that is precisely what DBExec does - it passes the buck on to the driver.
If you tell us which database flavour this is and which driver you are using I *might* be able to help you look up some documentation.
Sorry to sound like I'm passing the buck, but really, that is precisely what DBExec does - it passes the buck on to the driver.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?