PDA

View Full Version : Call VBP steps from within script?


helena
02-10-2004, 10:39 AM
Is there anyway to call a VBP step from within a Script block?

The problem that I'm trying to solve is that I have a folder filled with .sql files. Each file name starts with a number, such as 100, 200, 1100, and the sql files need to be run in numeric order (rather than alphabetical).

I created a jscript step that would go through all the files in the directory and stick the paths into an array so that they're in the correct order.

After all the files are ordered correctly, I would like to run the all the sql files in the appropriate order. This is where I run into the problem. How do I run all these file in the correct order?

Ideally, I'd like to loop through all the items and call the Run Sql step with the information or run the %DOSCMD% with the correct command from within the script code. I haven't been able to figure out how to call any VBP steps from within the script, or how to pass the list of file paths out to another step to run all of them in order.

Any ideas?

Thanks!

kevina
02-10-2004, 12:24 PM
There isn't a way to call a step from script.

Instead of populating an array in JScript, use vbld_AddDelimValue() to populate a tab delimited macro.

Then iterate over the macro values with vbld_NextDelimValue() calling the Run Sql action for each value (see the Misc.bld sample for details).

Also see this thread: http://www.kinook.com/Forum/showthread.php?threadid=231

Kevin

VBPbetaTest
03-01-2004, 04:41 AM
Using vbld_AddDelimValue() and then calling the Run Sql action could be a good idea. The only problem could be the performance :o(

Another way could be to create directly by script the project (with the VBPro object model) which will lauch step by step each stored procedure and then to launch it after. But each step has to connect to the database, so you will lose always the same amount of time.

But every day, I have to install 3500 stored procedures and this way takes me 15 minutes if I use this method.

To reduce that time at 5 minutes, we had to create a visual basic code (attached with this message). The idea is to use ADO directly keeping the connexion to the database always opened.

I haven't fund the time to translate it in VBScript but I'm sure you
could easily. But I will do it... one day ;o)

"Le petit frenchy"
NB: Sorry for my english ;o)