The db2 command handles $ characters just fine -- it's QShell that causes interference. In a Unix shell, $ has a special meaning (it means "insert variable value here"). If you can get the $ past QShell and into the db2 command, it'll be handled just fine.

FWIW, I have written an "improved" version of the db2 command. My command allows both SQL and SYS syntax, as well as better error handling, and extra options for formatting the output. If you're interested, you'll find it here:

On 4/28/2011 6:01 PM, Jeffrey Carey wrote:
You can also invoke QShell in a CL to run a SQL statement. Note you
need to use SQL style syntax (e.g. library.file not library/file) and it
has some issues (such as handling $ characters well I hear):

QSH CMD(DB2 "sql statement") and those are double quotes ( shift + ' )
not single quotes.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].