-SET &SETTINGNAME = 'New Made Up Config Setting';
-SET &SETTINGVALUE = 'Broccoli';
-SET &SETTINGUSER = '12345';
DEFINE FILE CAR
SETTINGUSER/A10 = '&SETTINGUSER';
SETTINGNAME/A50 = '&SETTINGNAME';
SETTINGVALUE/A50 = '&SETTINGVALUE';
END
TABLE FILE CAR
SUM
MAX.SETTINGUSER
MAX.SETTINGNAME
MAX.SETTINGVALUE
BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ '1';
ON TABLE HOLD AS BT_CHGCFG_1 FORMAT ALPHA
END
MODIFY FILE MYTABLE
FIXFORM FROM BT_CHGCFG_1
MATCH SETTINGUSER SETTINGNAME
ON MATCH UPDATE SETTINGUSER SETTINGNAME SETTINGVALUE
ON NOMATCH INCLUDE SETTINGUSER SETTINGNAME SETTINGVALUE
DATA ON BT_CHGCFG_1
END
-RUN
Gives an error:
(FOC1400) SQLCODE IS 544 (HEX: 00000220) XOPEN: 42000
: Microsoft OLE DB Provider for SQL Server: [42000] Cannot insert explicit
: value for identity column in table 'MYTABLE' when IDENTITY_INSERT
: is set to OFF.
My SQL Dump displays the following:
0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1
SELECT
T1."SettingID"
,T1."SettingUser"
,T1."SettingName"
,T1."SettingValue"
FROM MyTable T1
WHERE
(T1."SettingUser" = ?) AND
(T1."SettingName" = ?)
ORDER BY
T1."SettingID" ASC;
INSERT INTO MyTable
("SettingID","SettingUser", "SettingName","SettingValue")
VALUES
(?,?,?,?);
(FOC1400) SQLCODE IS 544 (HEX: 00000220) XOPEN: 42000
: Microsoft OLE DB Provider for SQL Server: [42000] Cannot insert explicit
: value for identity column in table 'MyTable' when IDENTITY_INSERT
: is set to OFF.
(FOC1740) EXECUTE ERROR : MYTABLE
0 TRANSACTIONS: TOTAL = 1 ACCEPTED= 1 REJECTED= 0
SEGMENTS: INPUT = 0 UPDATED = 0 DELETED = 0
So, I suppose the issue is that I have SettingID set as an identity column and it will not accept an explicit value in that column. I am not trying to put it there, though. How to override? - ABTThis message has been edited. Last edited by: ABT,
I also tried tweaking the ON NOMATCH INCLUDE line to specify the fields, but it was totally ignored.
I don't understand, we have a very similar process (different program, table, data, etc) that I borrowed some of the code from -- it works, this does not. I created the tables the same, both have the ID as the primary key field (and both set as IDENTITY and incrementing).