Using isql to execute scripts

You can create scripts of RCL commands and execute them using isql. This procedure is useful when you need to execute the same set of commands in Replication Servers at multiple sites.

To create and execute a script for isql:

  1. As necessary, start the Replication Server, as described in “Starting Replication Server”.

  2. Create a text file for your script, and enter into it the RCL commands you want to execute. As with the interactive method, separate each command with the word “go” on a line by itself.

  3. Execute the script using the following isql syntax:

    isql -Uuser_name -Ppassword -Sserver_name
    			-iscript_name
    

    The isql utility displays the results from the script’s commands on your screen (standard output). Or, you can redirect the output to a file:

    isql -Uuser_name -Ppassword -Sserver_name
    			-iscript_name > output_file