Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append Query for AS400

Status
Not open for further replies.

cainemart

Programmer
Nov 28, 2001
70
US
I use SQL to make this table on our AS400

CREATE TABLE POLICIES
(SMCONR CHAR (2),
SMPRFX CHAR (4),
SMPLNR numeric (9),
REFN# numeric (11,0),
PSAGL3 CHAR (3),
PSAGL2 CHAR (6),
PSAGL1 CHAR (9),
TERM_YY numeric (2,0),
TERM_MM numeric (2,0),
TERM_DD numeric (2,0),
TRX_YY numeric (2,0),
TRX_MM numeric (2,0),
TRX_DD numeric (2,0),
PSSTUS CHAR (1),
PSCNRS CHAR (2),
PSCNTP CHAR (2),
CLIENT CHAR (14),
STATUS CHAR (1),
TERM CHAR (10),
ORIG CHAR (10),
CXL CHAR (10))

Which makes the table just like it should. But when I try to append to this table it won't allow me. Here is the append code

INSERT INTO userfin.POLICIES
(SMCONR, SMPRFX, SMPLNR, REFN#, PSAGL3, PSAGL2, PSAGL1, TERM_YY, TERM_MM, TERM_DD, TRX_YY, TRX_MM, TRX_DD, PSSTUS, PSCNRS, PSCNTP, CLIENT, STATUS, TERM, ORIG, CXL)

SELECT A.COMP#, A.PMPRFX, A.PMPLNR, B.SMREFN, C.PSAGL3, C.PSAGL2, C.PSAGL1, C.PSTEYY, C.PSTEMM, C.PSTEDD, C.PSEFYY, C.PSEFMM, C.PSEFDD, C.PSSTUS, C.PSCNRS, C.PSCNTP, D.PMCLID, D.PMSTAT, D.PMTEFFDTE, D.PMOEFFDTE, D.PMACCNDTE

FROM (((userfin.BLANK_UNPD A LEFT OUTER JOIN SISDTA250.ALSTMF B ON A.COMP#=B.SMCONR AND A.PMPRFX=B.SMPRFX AND A.PMPLNR=B.SMPLNR) LEFT OUTER JOIN SISDTA250.ALPUPS C ON A.COMP#=C.PSCONR AND A.PMPRFX=C.PSPRFX AND A.PMPLNR=C.PSPLNR AND B.SMOREF=C.PSREFN) LEFT OUTER JOIN SISDTA250.CIPOMF D ON A.COMP#=D.COMP# AND A.PMPRFX=D.PMPRFX AND A.PMPLNR=D.PMPLNR)

WHERE B.SMTRCD<'19'

We recently switched to the iSeries version of the AS400 and now I am having the problems. If we go back and get the tape before the switch to the iSeries everything works great. Any ideas on why we can't append to a table we make now through SQL? Using A97.

Thanks

cainebean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top