Start a new topic

multi dbviscmd batch export problem

[This topic is migrated from our old forums. The original author name has been removed]

Hi I try do export from a lot of data bases. my export cmd-file has some row like this: "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB1_conn -userid user -password pwd -sqlfile DB1_export.sql "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB2_conn -userid user -password pwd -sqlfile DB2_export.sql "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB3_conn -userid user -password pwd -sqlfile DB3_export.sql ----- *But batch command execute only for one first row. 2-d and 3-d command don't execute. There is no error. If I comment 1-t row - then 2-d row will execute, but 3-d row don't wont execute.* ----- DB{X}_export.sql is script for export data from tables. All scripts has structure like this: @export on; @export set ....... ; @set maxrows 0; SELECT * FROM "table1"; ....... @export off; Edited by: bunak on 16.11.2013 13:32

[This reply is migrated from our old forums.]

Re: multi dbviscmd batch export problem
Hi, Just so that I fully understand. You have a bat script containing the following: "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB1_conn -userid user -password pwd -sqlfile DB1_export.sql "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB2_conn -userid user -password pwd -sqlfile DB2_export.sql "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB3_conn -userid user -password pwd -sqlfile DB3_export.sql And if you run the bat script from the command line only the first dbviscmd.bat row is executed and the other 2 are not? Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: multi dbviscmd batch export problem
Yes. I create cmd-file (or BAT file). It name is export.cmd. This file contains commands: "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB1_conn -userid user -password pwd -sqlfile DB1_export.sql "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB2_conn -userid user -password pwd -sqlfile DB2_export.sql "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB3_conn -userid user -password pwd -sqlfile DB3_export.sql then in command line i execute this file C:\export_db\>export.cmd but only first command (line) in cmd-file is executed. ----- P.S. ----- By the way. The main task that I want to do - is do export from many databases. I try use batch file with dbviscmd.bat, because, there are not possible change database (or connection) in SQL Commander of GUI: http://www.dbvis.com/forum/thread.jspa?messageID=11900⹼ http://www.dbvis.com/forum/thread.jspa?messageID=12024 Edited by: bunak on 16.11.2013 19:53
[This reply is migrated from our old forums.]

Re: multi dbviscmd batch export problem
Hi, The stop effect is due to how the bat files are working. Try insert call in front of each statement: call "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB1_conn -userid user -password pwd -sqlfile DB1_export.sql call "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB2_conn -userid user -password pwd -sqlfile DB2_export.sql call "c:\Program Files\DbVisualizer\dbviscmd.bat" -connection DB3_conn -userid user -password pwd -sqlfile DB3_export.sql Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: multi dbviscmd batch export problem
good very very good it is working thank you