Good News Everybody!
The new search engine is LIVE!
Please report any problems to david (at) midrange.com.
|
This is maybe even easier than using QM queries - I need to look at
it more.
On 2/20/2012 9:04 AM, Jim Oberholtzer wrote:
While it is way better to put your SQL into the RPG program you can
do it directly from CL without OPNQRYF. You would put your SQL
statement into a variable and call a utility in QSHELL called DB2.
So it looks like:
ADDENVVAR ENVVAR(QIBM_QSH_CMD_OUTPUT) +
VALUE('FILEAPPEND=/tmp/shell.log')
MONMSG CPFA980 /* Error adding value */
ADDENVVAR ENVVAR(QIBM_QSH_CMD_ESCAPE_MSG) +
REPLACE(*YES) VALUE(Y)
MONMSG CPFA980
CHGVAR &Command VALUE('db2 "'select * from whatever...etc'"')
QSH cmd(&Command)
Works like a charm, and really, it's too easy. The hardest part is
getting the quote ticks to work right.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2026 by midrange.com 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].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.