how to execute a multiple sql statement from a bat file
hi, my apologises for my english and my level . //al final en castellano
first i am having problem executing in terminal with $SYSTEM.SQL.Shell() when i work with the << entering multiline statement mode >>
i ve tried this ...
SAMPLES>DO $SYSTEM.SQL.Shell()
SQL Command Line Shell
----------------------------------------------------
The command prefix is currently set to: <<nothing>>.
Enter q to quit, ? for help.
SAMPLES>> << entering multiline statement mode >> //i press <enter>
1>>UPDATE Cinema.Film SET "Description" = 'D1' WHERE "ID" = 1 GO
2>>UPDATE Cinema.Film SET "Description" = 'D2' WHERE "ID" = 2 GO
3>>UPDATE Cinema.Film SET "Description" = 'D3' WHERE "ID" = 3 GO
4>>q
SAMPLES>>
... but nothing happens. meanwhile in 'single statement' works
SAMPLES>>UPDATE Cinema.Film SET "Description" = 'D1' WHERE "ID" = 1
7. UPDATE Cinema.Film SET "Description" = 'D1' WHERE "ID" = 1
1 Row Affected
statement prepare time(s)/globals/lines/disk: 0.0003s/11/131/0ms
execute time(s)/globals/lines/disk: 0.0003s/18/253/0ms
cached query class: %sqlcq.SAMPLES.cls5
---------------------------------------------------------------------------
SAMPLES>>
... really i dont know how to execute several UPDATEs in the same SQL query. i ve trying this before mounting all the commands to be executed from a batch file. my goal is to launch a .bat file that execute an sql UPDATE for several lines. this several updates are generated from an excel macro and stored in TXT file. i suppose can generate only sql lines in the txt or whole lines to execute in terminal cursor. i dont know what is better.
i know they are 2 troubles in 1 , but first i need to check that sql updates in CTERM they works, and then how to mount the bat file in the local host.
thanks in advance.
lo dicho pues. que por un lado no consigo ejecutar varias instrucciones en una sola sentencia, varios UPDATEs en el modo 'multi-linea que deja elegir el shell() y por otro que no se si seria posible lanzar un bat para que ejecute un sql con el terminal, o bien con todas las lineas o dirigiendose a un fichero .txt que incluya el sql a ejecytar.
gracias.