Subject | Re: [firebird-support] ISQL and Loading Script |
---|---|
Author | Helen Borrie |
Post date | 2006-04-22T00:45Z |
At 09:35 PM 21/04/2006, you wrote:
help to find out more:
c:\Program Files\Firebird\Firebird_1_5\bin>run /?
'run' is not recognized as an internal or external command,
operable program or batch file.
That's to say, In the command shell, Windows will run any
program it recognises as an executable program or a batch (.bat) file.
ISQL is an executable program. Because it is, and it has the
standard ".exe" suffix, Windows is happy to let you omit the
suffix. It still recognises "isql" as an operable program.
Operable programs can be written to take parameters, switches, etc.,
and so it is with isql.exe. What a program does with these switches
is the program's business - Windows doesn't know anything about want
isql.exe is going to do with the switches.
When you send the -i[nput] switch with a fully qualified filesystem
path to a script, it reads in the script and executes the SQL
statements it finds in that file. On the whole, it will just blatt
its way through the script and keep executing statements, regardless
of whether or not there are any exceptions.
(A new -b[ail] switch added to Firebird 2.0 was backported to Fb 1.5.3,
but it remains undocumented in ISQL's inline help. It *is* documented in
the Fb 1.5.3 release notes. If the -bail switch is included, isql will
stop executing the input file at the first exception.)
If you include the -database switch with the valid path to the
database as its argument, isql will try to connect to the database
first and will throw an exception if it can't connect for any
reason. Otherwise, you can include the CONNECT statement in the
script and take your chances.
You need to take account of some operating system-specific
gotchas. That's a long, boring story, so just take the tip to
surround file paths with double quotes if there are any elements that
don't conform to the 16-bit DOS 8.3 rules.
And, when writing your input scripts, ALWAYS remember to make a
carriage return the last thing you type in your script file before saving it.
./heLen
>Hi All:First, RUN isn't a Windows shell command. You can query the command
>I want to execute ISQL and have a script loaded upon execution.
>Example:
>RUN ISQL.exe c:\MyScript.txt
>So, ISQL will load and start running the MyScript script without my
>intervention.
>I thought I saw how to do this but can't find that particular reference
>example in the books today.
help to find out more:
c:\Program Files\Firebird\Firebird_1_5\bin>run /?
'run' is not recognized as an internal or external command,
operable program or batch file.
That's to say, In the command shell, Windows will run any
program it recognises as an executable program or a batch (.bat) file.
>The closest example I found ran ISQL with a DataBase specified as theWell, you are definitely onto something here! :-)
>parameter.
ISQL is an executable program. Because it is, and it has the
standard ".exe" suffix, Windows is happy to let you omit the
suffix. It still recognises "isql" as an operable program.
Operable programs can be written to take parameters, switches, etc.,
and so it is with isql.exe. What a program does with these switches
is the program's business - Windows doesn't know anything about want
isql.exe is going to do with the switches.
When you send the -i[nput] switch with a fully qualified filesystem
path to a script, it reads in the script and executes the SQL
statements it finds in that file. On the whole, it will just blatt
its way through the script and keep executing statements, regardless
of whether or not there are any exceptions.
(A new -b[ail] switch added to Firebird 2.0 was backported to Fb 1.5.3,
but it remains undocumented in ISQL's inline help. It *is* documented in
the Fb 1.5.3 release notes. If the -bail switch is included, isql will
stop executing the input file at the first exception.)
If you include the -database switch with the valid path to the
database as its argument, isql will try to connect to the database
first and will throw an exception if it can't connect for any
reason. Otherwise, you can include the CONNECT statement in the
script and take your chances.
You need to take account of some operating system-specific
gotchas. That's a long, boring story, so just take the tip to
surround file paths with double quotes if there are any elements that
don't conform to the 16-bit DOS 8.3 rules.
And, when writing your input scripts, ALWAYS remember to make a
carriage return the last thing you type in your script file before saving it.
./heLen