PDA

View Full Version : Run SQL Scripts using ODBC Driver



vincentsillifant
04-26-2011, 07:03 AM
Hello,

I've searched the forum and couldn't find what I was looking for, hopefully someone can help.

From time to time, while I use setupbuilder to execute SQL scripts on Microsoft SQL Databases, using sqlcmd.

Some of my sites are using IBM informix, on a linux / sles machine, as a database though, and thus I cannot use sqlcmd to run scripts against the database while I am upgrading the sites application files.

I was thinking that, seeing as Setupbuilder can create ODBC connections, can it not run SQL scripts against the ODBC connection that its created? That will allow me to run the scripts on the database, from a windows machine, thus removing the need for me to run the scripts manually.

Does anyone know how to do this, or some other solution that I could try?

Any help or feedback will be greatly appreciated.

Thanks!

Regards,
Vincent Sillifant.

linder
04-26-2011, 09:19 AM
Vincent,

SetupBuilder does not "create" ODBC connections. It can install and configure ODBC drivers and data sources.

How would you do this without SetupBuilder? If you know how then perhaps you can write a simple DLL and call this from the SetupBuilder installer application (Call DLL... function).

Friedrich

vincentsillifant
04-27-2011, 12:32 AM
Hi Friedrich,

Thanks for the reply. Used the wrong terminology in my post. By create ODBC connections I actually meant Installing and Configuring a Connection under data sources.

Usually I call sqlcmd for my SQL sites, and then run the scripts I want to. For the informix sites however, I need to logon to the Linux server using Putty, then open dbaccess, (informix equivalent of Microsoft SQL Management Studio), and then write and execute the scripts. I cannot automate the process as I do with my SQL sites.

As far as writing my own DLL to do all this for my informix site, I'm afraid I'm not that advanced, yet :)

I'll keep searching the web for a solution to this. There must be something I can use.

Thanks again for your reply.

Regards,
Vincent.

linder
04-28-2011, 01:53 AM
If possible, please keep us posted.

Friedrich