Subject | Re: [ib-support] Another Question on SP |
---|---|
Author | R. Tulloch |
Post date | 2002-06-10T03:42:51Z |
Hi:
If I comment out line at <----- all Ok.
Un-commented get unknown token at <---- ; after CASSADD.
Good grief!!
Best regards
SET TERM ## ;
CREATE PROCEDURE GENERATECASSCERTIFICATIONDATA
AS
BEGIN
DELETE FROM CASSADD;
INSERT INTO CASSADD (ID, STATUS_MEM, POBOX, NUMBER,
STREET, CITY, STATE, ZIP, DPBC_2, DPBC_CHK)
SELECT M.ID, M.STATUS_MEM, M.POBOX, M.NUMBER, M.STREET,
M.CITY, M.STATE, M.ZIP, M.DPBC_2, M.DPBC_CHK
FROM MEMBERS M
WHERE M.STATUS_REC <> 'ARCHIVE' AND ((M.POBOX IS NOT NULL AND
M.POBOX <> 0) OR
(M.NUMBER IS NOT NULL AND
M.NUMBER <> 0));
INSERT INTO CASSADD (ID, STATUS_MEM, POBOX, NUMBER,
STREET, CITY, STATE, ZIP, DPBC_2, DPBC_CHK)
SELECT I.ID, I.STATUS_MEM, I.POBOX, I.NUMBER, I.STREET,
I.CITY, I.STATE, I.ZIP, I.DPBC_2, I.DPBC_CHK
FROM INFOLIST I
WHERE I.STATUS_REC <> 'ARCHIVE' AND ((I.POBOX IS NOT NULL AND
I.POBOX <> 0) OR
(I.NUMBER IS NOT NULL AND
I.NUMBER <> 0));
INSERT INTO CASSADD (ID, STATUS_MEM, POBOX, NUMBER,
STREET, CITY, STATE, ZIP, DPBC_2, DPBC_CHK)
SELECT A.ID, A.STATUS_MEM, A.POBOX, A.NUMBER, A.STREET,
A.CITY, A.STATE, A.ZIP, A.DPBC_2, A.DPBC_CHK
FROM ADVERS A
WHERE A.STATUS_REC <> 'CANCELLED' AND ((A.POBOX IS NOT NULL AND
A.POBOX <> 0) OR
(A.NUMBER IS NOT NULL AND
A.NUMBER <> 0));
INSERT INTO CASSADD (ID, STATUS_MEM, POBOX, NUMBER,
STREET, CITY, STATE, ZIP, DPBC_2, DPBC_CHK)
SELECT AC.ID, AC.STATUS_MEM, AC.POBOX, AC.NUMBER, AC.STREET,
AC.CITY, AC.STATE, AC.ZIP, AC.DPBC_2, AC.DPBC_CHK
FROM ASSOC_C AC
WHERE AC.STATUS_MEM <> 'CANCELLED' AND ((AC.POBOX IS NOT NULL AND
AC.POBOX <> 0) OR
(AC.NUMBER IS NOT NULL AND
AC.NUMBER <> 0));
UPDATE CASSADD
SET ADDRESS = 'P O BOX ' || CAST(CAST(POBOX AS INTEGER) AS CHAR(7))
WHERE (POBOX IS NOT NULL AND POBOX <> 0);
UPDATE CASSADD
SET ADDRESS = RTRIM(CAST(CAST(NUMBER AS INTEGER) AS CHAR(7))) || ' '
|| STREET
WHERE (NUMBER IS NOT NULL AND NUMBER <> 0);
SELECT COUNT (*) AS TOTCOUNT FROM CASSADD; <--------------
END ##
SET TERM ; ##
If I comment out line at <----- all Ok.
Un-commented get unknown token at <---- ; after CASSADD.
Good grief!!
Best regards
SET TERM ## ;
CREATE PROCEDURE GENERATECASSCERTIFICATIONDATA
AS
BEGIN
DELETE FROM CASSADD;
INSERT INTO CASSADD (ID, STATUS_MEM, POBOX, NUMBER,
STREET, CITY, STATE, ZIP, DPBC_2, DPBC_CHK)
SELECT M.ID, M.STATUS_MEM, M.POBOX, M.NUMBER, M.STREET,
M.CITY, M.STATE, M.ZIP, M.DPBC_2, M.DPBC_CHK
FROM MEMBERS M
WHERE M.STATUS_REC <> 'ARCHIVE' AND ((M.POBOX IS NOT NULL AND
M.POBOX <> 0) OR
(M.NUMBER IS NOT NULL AND
M.NUMBER <> 0));
INSERT INTO CASSADD (ID, STATUS_MEM, POBOX, NUMBER,
STREET, CITY, STATE, ZIP, DPBC_2, DPBC_CHK)
SELECT I.ID, I.STATUS_MEM, I.POBOX, I.NUMBER, I.STREET,
I.CITY, I.STATE, I.ZIP, I.DPBC_2, I.DPBC_CHK
FROM INFOLIST I
WHERE I.STATUS_REC <> 'ARCHIVE' AND ((I.POBOX IS NOT NULL AND
I.POBOX <> 0) OR
(I.NUMBER IS NOT NULL AND
I.NUMBER <> 0));
INSERT INTO CASSADD (ID, STATUS_MEM, POBOX, NUMBER,
STREET, CITY, STATE, ZIP, DPBC_2, DPBC_CHK)
SELECT A.ID, A.STATUS_MEM, A.POBOX, A.NUMBER, A.STREET,
A.CITY, A.STATE, A.ZIP, A.DPBC_2, A.DPBC_CHK
FROM ADVERS A
WHERE A.STATUS_REC <> 'CANCELLED' AND ((A.POBOX IS NOT NULL AND
A.POBOX <> 0) OR
(A.NUMBER IS NOT NULL AND
A.NUMBER <> 0));
INSERT INTO CASSADD (ID, STATUS_MEM, POBOX, NUMBER,
STREET, CITY, STATE, ZIP, DPBC_2, DPBC_CHK)
SELECT AC.ID, AC.STATUS_MEM, AC.POBOX, AC.NUMBER, AC.STREET,
AC.CITY, AC.STATE, AC.ZIP, AC.DPBC_2, AC.DPBC_CHK
FROM ASSOC_C AC
WHERE AC.STATUS_MEM <> 'CANCELLED' AND ((AC.POBOX IS NOT NULL AND
AC.POBOX <> 0) OR
(AC.NUMBER IS NOT NULL AND
AC.NUMBER <> 0));
UPDATE CASSADD
SET ADDRESS = 'P O BOX ' || CAST(CAST(POBOX AS INTEGER) AS CHAR(7))
WHERE (POBOX IS NOT NULL AND POBOX <> 0);
UPDATE CASSADD
SET ADDRESS = RTRIM(CAST(CAST(NUMBER AS INTEGER) AS CHAR(7))) || ' '
|| STREET
WHERE (NUMBER IS NOT NULL AND NUMBER <> 0);
SELECT COUNT (*) AS TOTCOUNT FROM CASSADD; <--------------
END ##
SET TERM ; ##