I'm new to Tek-Tips so woukld like to first say hi....hi.
Onto business ;-)
I have an IF statement that to me looks like it should be fine, but for some reason get an error. Here's the statement:
IF (SELECT ArchiveType FROM AIM.ArchiveType WHERE ArchiveID = decArchiveID) = 'O' AND
(SELECT
AIM.CHANNEL.CHANNEL
FROM
AIM.AIMCONNECTION,
AIM.ARCHIVERETRIEVAL,
AIM.AIMRETRIEVAL,
AIM.CHANNELSESSION,
AIM.CHANNEL,
AIM.AIMQUERY
WHERE
AIM.CHANNEL.CHANNELID = AIM.CHANNELSESSION.CHANNELID
AND AIM.CHANNELSESSION.CHANNELSESSIONID = AIM.AIMCONNECTION.CHANNELSESSIONID
AND AIM.AIMCONNECTION.AIMCONNECTIONID = AIM.AIMQUERY.AIMCONNECTIONID
AND AIM.AIMQUERY.AIMQUERYID = AIM.AIMRETRIEVAL.AIMQUERYID
AND AIM.AIMRETRIEVAL.AIMRETRIEVALID = AIM.ARCHIVERETRIEVAL.AIMRETRIEVALID
AND AIM.CHANNELSESSION.CHANNEL) IN ('INTRANET', 'CIB')
THEN
SET dateExpirationDate = (AIM.NEXT_BUS_DATE (DATE(CURRENT TIMESTAMP),5));
Here's the error:
AIM.CreateArchiveRetrieval: 39: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token ")" was found following "ANNELSESSION.CHANNEL". Expected tokens may include: "<comp_op> <quantifier> <subquery>". LINE NUMBER=39. SQLSTATE=42601
AIM.CreateArchiveRetrieval - Build failed.
I'm sure I'm missing something easy. Any help would be really appreciated.
Thanks!
Onto business ;-)
I have an IF statement that to me looks like it should be fine, but for some reason get an error. Here's the statement:
IF (SELECT ArchiveType FROM AIM.ArchiveType WHERE ArchiveID = decArchiveID) = 'O' AND
(SELECT
AIM.CHANNEL.CHANNEL
FROM
AIM.AIMCONNECTION,
AIM.ARCHIVERETRIEVAL,
AIM.AIMRETRIEVAL,
AIM.CHANNELSESSION,
AIM.CHANNEL,
AIM.AIMQUERY
WHERE
AIM.CHANNEL.CHANNELID = AIM.CHANNELSESSION.CHANNELID
AND AIM.CHANNELSESSION.CHANNELSESSIONID = AIM.AIMCONNECTION.CHANNELSESSIONID
AND AIM.AIMCONNECTION.AIMCONNECTIONID = AIM.AIMQUERY.AIMCONNECTIONID
AND AIM.AIMQUERY.AIMQUERYID = AIM.AIMRETRIEVAL.AIMQUERYID
AND AIM.AIMRETRIEVAL.AIMRETRIEVALID = AIM.ARCHIVERETRIEVAL.AIMRETRIEVALID
AND AIM.CHANNELSESSION.CHANNEL) IN ('INTRANET', 'CIB')
THEN
SET dateExpirationDate = (AIM.NEXT_BUS_DATE (DATE(CURRENT TIMESTAMP),5));
Here's the error:
AIM.CreateArchiveRetrieval: 39: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token ")" was found following "ANNELSESSION.CHANNEL". Expected tokens may include: "<comp_op> <quantifier> <subquery>". LINE NUMBER=39. SQLSTATE=42601
AIM.CreateArchiveRetrieval - Build failed.
I'm sure I'm missing something easy. Any help would be really appreciated.
Thanks!