The COMPILE statement below throws this error: Insufficient access privilege for table MyTable. (234). I checked the data security for AS400 db using Data Admin and each table throwing the error has complete access. The calling program resides on a WIN2k machine and is initially connected to the native database. MyProcedure uses tables from both the WIN2k and the AS400 (which as you may guess resides on an IBM AS400).
IF NOT CONNECTED("AS400") THEN
DO:
CONNECT AS400schema -H schemaserve -S schemaservice NO-ERROR.
CONNECT AS400 -Dsrv COMPRESS=1 -dt AS400 -H server -S service -U user -P password NO-ERROR.
END.
IF CONNECTED("AS400") AND NOT ERROR-STATUS:ERROR THEN
COMPILE VALUE("MyProcedure.p").
The compilation error occurs on the first line of the following
FOR EACH AS400.MyTable FIELDS(Field1 Field2) WHERE
NOT CAN-FIND(WIN2k.MyTable WHERE
WIN2k.MyTable.Field1 = AS400.MyTable.Field1 AND
WIN2k.MyTable.Field1 = AS400.MyTable.Field1)
SHARE-LOCK:
DELETE AS400.MyTable NO-ERROR.
END.
Strangely enough, just a few lines above this in the procedure, presumabely where a compilation error would first occur, I find the code below, but I don't receive a compilation error.
FOR EACH WIN2k.MyTable WHERE SomeField = Something NO-LOCK:
FOR EACH AS400.MyTable WHERE
WIN2k.MyTable.Field1 = AS400.MyTable.Field1 AND
WIN2k.MyTable.Field1 = AS400.MyTable.Field1
SHARE-LOCK:
.
.
END.
END.
Can anyone point to the problem or suggest a place to look?
IF NOT CONNECTED("AS400") THEN
DO:
CONNECT AS400schema -H schemaserve -S schemaservice NO-ERROR.
CONNECT AS400 -Dsrv COMPRESS=1 -dt AS400 -H server -S service -U user -P password NO-ERROR.
END.
IF CONNECTED("AS400") AND NOT ERROR-STATUS:ERROR THEN
COMPILE VALUE("MyProcedure.p").
The compilation error occurs on the first line of the following
FOR EACH AS400.MyTable FIELDS(Field1 Field2) WHERE
NOT CAN-FIND(WIN2k.MyTable WHERE
WIN2k.MyTable.Field1 = AS400.MyTable.Field1 AND
WIN2k.MyTable.Field1 = AS400.MyTable.Field1)
SHARE-LOCK:
DELETE AS400.MyTable NO-ERROR.
END.
Strangely enough, just a few lines above this in the procedure, presumabely where a compilation error would first occur, I find the code below, but I don't receive a compilation error.
FOR EACH WIN2k.MyTable WHERE SomeField = Something NO-LOCK:
FOR EACH AS400.MyTable WHERE
WIN2k.MyTable.Field1 = AS400.MyTable.Field1 AND
WIN2k.MyTable.Field1 = AS400.MyTable.Field1
SHARE-LOCK:
.
.
END.
END.
Can anyone point to the problem or suggest a place to look?