Focal Point
[CLOSED] ON NOMATCH INCLUDE (error)

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3417059606

July 15, 2011, 11:33 AM
ABT
[CLOSED] ON NOMATCH INCLUDE (error)
-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?
- ABT

This message has been edited. Last edited by: ABT,


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
July 15, 2011, 12:37 PM
Severus.snape
Hi,

Instead of refering to all the columns in the HOLD file try providing the column list explicitly without the identity column.
quote:
FIXFORM FROM BT_CHGCFG_1

FIXFORM SETTINGUSER/10 SETTINGNAME/10 SETTINGVALUE/10
  



thanks
Sashanka


WF 7.7.03/Windows/HTML,PDF,EXL
POC/local Dev Studio 7.7.03 & 7.6.11
July 15, 2011, 01:11 PM
ABT
FIXFORM SETTINGUSER/10 SETTINGNAME/10 SETTINGVALUE/10


Shashanka,
No effect -- same error, same SQL.

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).

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
July 15, 2011, 02:36 PM
ABT
Ahh but the master files were not the same. Adding FIELDTYPE=R to SETTINGID seems to have done the trick.

I swear I searched, but did not find a thread.

http://forums.informationbuild...71057331/m/212106693

Thanks anyway Shashanka!

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
July 15, 2011, 05:11 PM
Waz
quote:
ON NOMATCH INCLUDE SETTINGUSER SETTINGNAME SETTINGVALUE


FYI

You dont need the fields specified in the INCLUDE.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

July 15, 2011, 05:44 PM
ABT
I was grabbing at straws at this point.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro