on 2011 Mar 12 6:54 PM
This is a follow-up to this dbisqlc question:
Using the redirection operator &> in a batch
dbisqlc command ">&" output.txt
seems to work only with a command and not with a command file. At least some tests with SA 10.0.1.4181 seem to imply that:
Is this a known limitation with dbisqlc?
When dbisqlc has just one command line argument, it assumes it is a filename. When there are multiple, it assumes it is a SQL statement. To get the behaviour you are looking for, change it into a SQL statement by using a dbisql 'READ' statement explicitly:
dbisqlc read command_file ">&" output.txt
-john.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, John - that seems to work generally.
However, when the command file itself has another READ statement (as in my case), that does not work: After the inner READ statement is executed, I get a "wrong file number" error. - In contrast, when omitting output redirection, then the inner file and the rest of the outer file are executed successfully - both when specifying the outer command file on the command line directly or as a READ statement.
Is output redirection limited to only one level of READ statements?
John, I'm aware of the dbisqlc limitation (though we both know that there have been a few improvements lately:)). And I agree that this is a different question but it came up in the same context - I used a nested script and with that, output redirection (which I hadn't used so far) failed...
No need to fix this, I'm gonna either avoid a nested script or avoid the output redirection... Using DBISQL is no option as we don't want to deploy the Java tool to clients. - FWIW: The initial idea was to optionally set the OEM connection string in a reload.sql via a nested script (which would be empty for non-OEM setups).
Yes, some fixes to dbisqlc do get made -- generally by me. I like the tool so I don't mind making some fixes to it. I really wish it had draggable column widths... and Unicode support, and... and... Sigh, well, maybe someday.
I've already made a tentative fix for the output redirection but it requires some testing yet.
-john.
Obviously fixed as CR 666434 in 12.0.1.3329, 12.0.0.2670 and 11.0.1.2591. - I don't know whether this is going to be fixed in 10.0.1, either.
Thanks again, John!
Man, I wasn't aware I had such detailed influence on what gets fixed:)
But as I actually had stated, I can cope with 10.0.1 not having this fix: I finally realized that the particular setting of the OEM connection string as part of the reload (which was used as a nested script) is not necessary at all - as dbisqlc is self-authenticating. Another lesson learnt:)
User | Count |
---|---|
68 | |
8 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.