hi, i am pretty new to informix and would appreciate an answer to this doubt..I would like to know how can i batch execute multiple .sql files from commandline using dbaccess and then direct the output to a file. Thanks in advance.
[sig][/sig]
Thanks a lot Richman, I have just one more question, is it possible that i can package some scriptfiles and the .sql files together in the same commandfile and execute it, will the scripts get executed as well? [sig][/sig]
If I understand you correctly the answer is yes. The piece of code I supplied can be wrapped with unix shell commands. The stuff in between the !'s are for the database only - the remainder is for the shell. e.g.;
echo "`date` Selecting rows from table ABC . . ."
dbaccess 'DBNAME' -<<!
unload to abc.unl
select
*
from ABC
;
!
echo "`date` Selected rows from table ABC . . ."
I wrote the echo commands (in this case) to tell me what the sql is doing. Try it with your shell script(s). Happy Halloween!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.