Firebird Question:
Download Questions PDF

Is there a way to automate SQL execution from the command-line, batch job or shell script?

Answer:

Yes. You can use isql for this. It is located in the 'bin' directory of your Firebird installation. If you wish to try it interactively, run isql and then type:

isql localhost:my_database -user sysdba -pass ******
SQL> input my_script.sql;
SQL> commit;
SQL>

To run it from a batch (.bat) file or a shell script, use -i switch:

isql -i my_script.sql localhost:my_database -user sysdba -pass ******

If you have some DML statements in your script, make sure you put the COMMIT command at the end of the file. Also, make sure the file ends with a newline, as isql executes the commands on the line only after it gets the newline character.

Download Firebird Interview Questions And Answers PDF

Previous QuestionNext Question
Is it possible to determine clients IP address?Is there a way to detect whether fbclient.dll or fbembed.dll is loaded?