If you are running the SQR on the MVS machine, you have to replace the [$TBL] with \$TBL\, MVS doesn't like the square brackets.
......Rob
----------------------------------------------------------------------------
Robert Goshko | Axis Developments | System Consulting Services
robert.goshko@axis-dev.com | Sherwood Park, AB | http://www.axis-dev.com
-----Original Message-----
From: Les Hancock [SMTP:les_hanc@YAHOO.COM]
Sent: Monday, July 20, 1998 10:23 AM
To: Multiple recipients of list SQR-USERS
Subject: Dynamic Tables in MVS/DB2
In trying (1) or (2)in MVS DB2:
!--------------------------------
! (1)
!--------------------------------
let $TBL = 'pshrprod.ps_dept_tbl'
begin-select
'X'
let $found_sw = 'Yes'
from [$TBL]
where deptid = $deptid
end-select
!--------------------------------
! (2)
!--------------------------------
let $TBL = 'pshrprod.ps_dept_tbl'
begin-select
'X'
let $found_sw = 'Yes'
from [pshrprod.ps_dept_tbl : $TBL]
where deptid = $deptid
end-select
I get
(SQR 5528) DB2 SQL PREPARE/DECLARE error -104 in cursor 1:
DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL "?". SOME SYMBOLS
THAT MIGHT BE LEGAL ARE: ( <IDENTIFIER>
If anyone has any ideas, please let me know.
Thanks
Les_Hanc@yahoo.com
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com
Unrecognized Data: application/ms-tnef