I think I got confused here.

IJ need not report the status on exit if there are any sql errors from the input sql file. The IJ session exit status will always be zero.

Sorry for the noise!
Mayuresh

Mayuresh Nirhali wrote:
Rick,

Honestly, I assumed that this should be the behavior. I did not look for any description in the docs. I looked through the code after writing to the group and figured the same thing as you mention. The errors observed when the script is run do not imply a different exit status.

Basically, I am working with some shell scripts that invoke IJ with sql schema scripts and the shell scripts got me confused when I saw that the return status is not a non-zero number on error. any workaround here ?

Mayuresh

Rick Hillegas wrote:
Mayuresh Nirhali wrote:
Hello,

I tried following simple command with ij and it seems IJ always returns 0.

% java -cp $CLASSPATH -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij test_create.sql ij version 10.5 ij> -- *********************************************************************

CREATE TABLE my_schema (
   version VARCHAR(32)
);
IJ ERROR: Unable to establish connection
ij> % echo $?
0
%

Isnt this a bug ?
Or I must be missing something really basic here ? :-p

Mayuresh
Hi Mayuresh,

The Tools Guide doesn't say what ij's behavior here should be. At least, I can't find any description. The description of the "exit" command doesn't mention this issue. Neither does the "Running ij scripts" section. The "exit" command itself doesn't take a status code argument. Have you found some text in the Tools Guide which indicates that this behavior is defined?

Thanks,
-Rick


Reply via email to