|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Executing scripts via batch processing
Hi,
i have to migrate data from one database model to another. To test the whole process i have to drop and create the database frequently and run various scripts for that. To do this more comfortable i would like to do this in a batch processing manner. In detail i would like to call only one file and this executes all steps of the process. There are ddl and dml statements in various sql scripts. I'm using Firebird 2.0 on Windows XP SP2. So i want to create a batch file which maybe creates the database itself and calls the ddl and dml statements by executing the sql script files. How does this works? How can i create an connection from an dos batch file and execute sql scripts in other files? thanks a lot, hennig |
|
#2
|
||||
|
||||
|
You can, call the command line client (isql)
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
But how do i call ddl or dml statemtents in external script files?
for expample i write the following lines in a file 'test.bat': ---------------------------------------- @echo off isql servername:dbname -user 'test' -password '12345' -------------------------------------- The connetion is established correctly, but how could i say that isql now executes the statements in file 'xyz.sql'? |
|
#4
|
||||
|
||||
|
Check my signature for a tutorial I once wrote, ("Getting started with Firebird" pdf) it shows you how to do this, basically it's
Quote:
|
|
#5
|
|||
|
|||
|
You can use INPUT to include other files.
Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle & MS SQL Server Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.com |
|
#6
|
|||
|
|||
|
Thank you!
but better as to put the connect string in every sql script, you can connect and give isql the file isql databasename -user 'User' -password 12345 -i script_name.sql this line you could generate for every script to execute. this works fine! |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Executing scripts via batch processing |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|