如果我ssh进入我的IBMi,并启动qsh,我可以运行db2 -S "SELECT * FROM LIB.SOMEPF"并获得结果。 我不能从默认的PASE屏幕上做到这一点。 我明白了
$ /usr/bin/db2 /usr/bin/db2: cannot execute
是否有可能从PASE运行SQL查询,而不是启动QSH?
我的主目录中有一个db2 shell脚本。 它已经在那里很久了,我不知道它是何时或如何到达那里。 它可能是5799-PTL的一部分。 没有帮助,我知道,但这里是内容:
ls -al db2 -rwxr-xr-x 1 buck 0 646 Jul 02 2013 db2 $ cat db2 #!/QOpenSys/usr/bin/ksh # map base name "qsh_inout" to "qsh" (just run the interpreter) basename=${0##*/} if [[ "$basename" = qsh_inout ]] ; then basename=qsh fi args='' for temp ; do args="$args'" # double embedded quotes halved by CL CALL while [[ "$temp" = *\'* ]] ; do args="$args${temp%%\'*}''" temp="${temp#*\'}" done args="$args$temp' " shift done # Copy environment variables, call utility in this process, # do not process OS/400 messages or spooled output files exec /QOpenSys/usr/bin/system -eiqs "CALL QSYS/QP0ZCALL ('/usr/bin/$basename' $args)"
当我CALL QP2TERM ,然后发出db2命令,比如db2 -S 'select * from datesample'它就会使用这个脚本运行。