Problem in data logging from wincc tag

hi i m using factory sql 4.1.0 in some tags i have no problem to logging a data but in some tags i m facing problem i have created some groups when i have run groups some grops are running fine but some are not in some group i m getting this error

error executing update query.ERROR[07002][microsoft][odbc sql server driver] count field incorrect or syntex error

please suggest me how to resolve a this problem

Hello-

It sounds like you must have an item with a name that is invalid for the database, or a reserved keyword.

On the group that is erroring out, look closely at each of the item names. Are there any with spaces, or “-” or similar characters that wouldn’t be allowed? Are there any that may be special query keywords, like “count”, “sum”, “select”, etc?

If nothing becomes apparent, please post a list of the item names, or export the group to CSV and post it here.

Regards,

hi
today i m facing same problem please suggest me how to resolve

these groups are not working

OPC Item Path OPC Property Field Name Type
A2S3T01LT/BR_AI.V_IN 0 RMST3 VT_R4
B2S2T01LT/BR_AI.V_IN 0 PMST2 VT_R4
B2S1T01LT/BR_AI.V_IN 0 PMST1 VT_R4
B4S3T01/TANK.OCCUPIED 0 CST3STATUS VT_BOOL
B2S1T01/TANK.OCCUPIED 0 PMST1STATUS VT_BOOL
B7S1T01/TANK.OCCUPIED 0 RNSMLKSTSTATUS VT_BOOL
A2S3T01/TANK.OCCUPIED 0 RMST3STATUS VT_BOOL
B4S3T01TE/BR_AI.V_IN 0 CST3 VT_R4
B4S2T01LT/BR_AI.V_IN 0 CST2 VT_R4
B2S2T01/TANK.OCCUPIED 0 PMST2STATUS VT_BOOL
A2S1T01LT/BR_AI.V_IN 0 RMST1 VT_R4
B4S1T01/TANK.OCCUPIED 0 CST1STATUS VT_BOOL
B5S3T03LT/BR_AI.V_IN 0 BTRMLKST VT_R4
A2S2T01LT/BR_AI.V_IN 0 RMST2 VT_R4
A2S2T01/TANK.OCCUPIED 0 RMST2STATUS VT_BOOL
B7S1T02LT/BR_AI.V_IN 0 RNSMLKS VT_R4
B4S2T01/TANK.OCCUPIED 0 CST2STATUS VT_BOOL
A2S1T01/TANK.OCCUPIED 0 RMST1STTATUS VT_BOOL
B2S3T01LT/BR_AI.V_IN 0 PMST3 VT_R4
B2S3T01/TANK.OCCUPIED 0 PMST3STATUS VT_BOOL
B5S3T01/TANK.OCCUPIED 0 BTRMLKSTSTATUS VT_BOOL
B4S1T01TE/BR_AI.V_IN 0 CST1 VT_R4
Execution Mode Command Triggered Writeback Address

Path Update Rate Update Rate Units Mode
\ 5 1 0
OPC Item Path OPC Property Field Name Type
B2S2T01LT/BR_AI.V_IN 0 PMST2 VT_R4
B4S1T01TE/BR_AI.V_IN 0 CST1 VT_R4
B2S1T01LT/BR_AI.V_IN 0 PMST1 VT_R4
B4S3T01TE/BR_AI.V_IN 0 CST3 VT_R4
A2S2T01LT/BR_AI.V_IN 0 RMST2 VT_R4
B4S2T01LT/BR_AI.V_IN 0 CST2 VT_R4
A2S1T01LT/BR_AI.V_IN 0 RMST1 VT_R4
B2S3T01LT/BR_AI.V_IN 0 PMST3 VT_R4
Execution Mode Command Triggered Writeback Address

when i select single tag any of above two groups its working fine
this group is working fine

Name Path Update Rate Update Rate Units Mode Connection
MainLab \ 50 0 1 New Connection|47af3c42-aaef-4a5e-bad5-230d1b5ce18f
OPC Server OPC Item Path OPC Property Field Name Type Deadband
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_PAST_RMST_3 0 AS1/DB_ALARM_READY_FOR_PAST_RMST_3 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_SMP_PMST_2 0 AS1/DB_ALARM_READY_FOR_SMP_PMST_2 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_UNLOAD2 0 AS1/DB_ALARM_READY_FOR_UNLOAD2 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.SEND_TO_RMST 0 AS1/DB_ALARM_SEND_TO_RMST VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_SMP_PMST_3 0 AS1/DB_ALARM_READY_FOR_SMP_PMST_3 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_SMP_PMST_1 0 AS1/DB_ALARM_READY_FOR_SMP_PMST_1 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_PAST_RMST_2 0 AS1/DB_ALARM_READY_FOR_PAST_RMST_2 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_BUTTER_CST3 0 AS1/DB_ALARM_READY_FOR_BUTTER_CST3 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_BUTTER_CST2 0 AS1/DB_ALARM_READY_FOR_BUTTER_CST2 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_UNLOAD1 0 AS1/DB_ALARM_READY_FOR_UNLOAD1 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_BUTTER_CST1 0 AS1/DB_ALARM_READY_FOR_BUTTER_CST1 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_PAST_RMST_1 0 AS1/DB_ALARM_READY_FOR_PAST_RMST_1 VT_BOOL 0
Name Execution Mode Command Triggered Writeback Address Data Type
READY_FOR_UNLOAD1 0 select READY_FOR_UNLOAD1 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_UNLOAD1} Unspecified
READY_FOR_UNLOAD2 0 select READY_FOR_UNLOAD2 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_UNLOAD2} Unspecified
READY_FOR_PAST_RMST_1 0 select READY_FOR_PAST_RMST_1 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_PAST_RMST_1} Unspecified
READY_FOR_PAST_RMST_2 0 select READY_FOR_PAST_RMST_2 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_PAST_RMST_2} Unspecified
READY_FOR_PAST_RMST_3 0 select READY_FOR_PAST_RMST_3 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_PAST_RMST_3} Unspecified
READY_FOR_SMP_PMST_1 0 select READY_FOR_SMP_PMST_1 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_SMP_PMST_1} Unspecified
READY_FOR_SMP_PMST_2 0 select READY_FOR_SMP_PMST_2 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_SMP_PMST_2} Unspecified
READY_FOR_SMP_PMST_3 0 select READY_FOR_SMP_PMST_3 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_SMP_PMST_3} Unspecified
READY_FOR_BUTTER_CST1 0 select READY_FOR_BUTTER_CST1 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_BUTTER_CST1} Unspecified
READY_FOR_BUTTER_CST2 0 select READY_FOR_BUTTER_CST2 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_BUTTER_CST2} Unspecified
READY_FOR_BUTTER_CST3 0 select READY_FOR_BUTTER_CST3 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_BUTTER_CST3} Unspecified
SEND_TO_RMST 0 select SEND_TO_RMST from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_SEND_TO_RMST} Unspecified

hi
today i m facing same problem please suggest me how to resolve

these groups are not working

OPC Item Path OPC Property Field Name Type
A2S3T01LT/BR_AI.V_IN 0 RMST3 VT_R4
B2S2T01LT/BR_AI.V_IN 0 PMST2 VT_R4
B2S1T01LT/BR_AI.V_IN 0 PMST1 VT_R4
B4S3T01/TANK.OCCUPIED 0 CST3STATUS VT_BOOL
B2S1T01/TANK.OCCUPIED 0 PMST1STATUS VT_BOOL
B7S1T01/TANK.OCCUPIED 0 RNSMLKSTSTATUS VT_BOOL
A2S3T01/TANK.OCCUPIED 0 RMST3STATUS VT_BOOL
B4S3T01TE/BR_AI.V_IN 0 CST3 VT_R4
B4S2T01LT/BR_AI.V_IN 0 CST2 VT_R4
B2S2T01/TANK.OCCUPIED 0 PMST2STATUS VT_BOOL
A2S1T01LT/BR_AI.V_IN 0 RMST1 VT_R4
B4S1T01/TANK.OCCUPIED 0 CST1STATUS VT_BOOL
B5S3T03LT/BR_AI.V_IN 0 BTRMLKST VT_R4
A2S2T01LT/BR_AI.V_IN 0 RMST2 VT_R4
A2S2T01/TANK.OCCUPIED 0 RMST2STATUS VT_BOOL
B7S1T02LT/BR_AI.V_IN 0 RNSMLKS VT_R4
B4S2T01/TANK.OCCUPIED 0 CST2STATUS VT_BOOL
A2S1T01/TANK.OCCUPIED 0 RMST1STTATUS VT_BOOL
B2S3T01LT/BR_AI.V_IN 0 PMST3 VT_R4
B2S3T01/TANK.OCCUPIED 0 PMST3STATUS VT_BOOL
B5S3T01/TANK.OCCUPIED 0 BTRMLKSTSTATUS VT_BOOL
B4S1T01TE/BR_AI.V_IN 0 CST1 VT_R4
Execution Mode Command Triggered Writeback Address

Path Update Rate Update Rate Units Mode
\ 5 1 0
OPC Item Path OPC Property Field Name Type
B2S2T01LT/BR_AI.V_IN 0 PMST2 VT_R4
B4S1T01TE/BR_AI.V_IN 0 CST1 VT_R4
B2S1T01LT/BR_AI.V_IN 0 PMST1 VT_R4
B4S3T01TE/BR_AI.V_IN 0 CST3 VT_R4
A2S2T01LT/BR_AI.V_IN 0 RMST2 VT_R4
B4S2T01LT/BR_AI.V_IN 0 CST2 VT_R4
A2S1T01LT/BR_AI.V_IN 0 RMST1 VT_R4
B2S3T01LT/BR_AI.V_IN 0 PMST3 VT_R4
Execution Mode Command Triggered Writeback Address

when i select single tag any of above two groups its working fine
this group is working fine

Name Path Update Rate Update Rate Units Mode Connection
MainLab \ 50 0 1 New Connection|47af3c42-aaef-4a5e-bad5-230d1b5ce18f
OPC Server OPC Item Path OPC Property Field Name Type Deadband
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_PAST_RMST_3 0 AS1/DB_ALARM_READY_FOR_PAST_RMST_3 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_SMP_PMST_2 0 AS1/DB_ALARM_READY_FOR_SMP_PMST_2 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_UNLOAD2 0 AS1/DB_ALARM_READY_FOR_UNLOAD2 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.SEND_TO_RMST 0 AS1/DB_ALARM_SEND_TO_RMST VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_SMP_PMST_3 0 AS1/DB_ALARM_READY_FOR_SMP_PMST_3 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_SMP_PMST_1 0 AS1/DB_ALARM_READY_FOR_SMP_PMST_1 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_PAST_RMST_2 0 AS1/DB_ALARM_READY_FOR_PAST_RMST_2 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_BUTTER_CST3 0 AS1/DB_ALARM_READY_FOR_BUTTER_CST3 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_BUTTER_CST2 0 AS1/DB_ALARM_READY_FOR_BUTTER_CST2 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_UNLOAD1 0 AS1/DB_ALARM_READY_FOR_UNLOAD1 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_BUTTER_CST1 0 AS1/DB_ALARM_READY_FOR_BUTTER_CST1 VT_BOOL 0
localhost:OPCServer.WinCC AS1/DB_ALARM.READY_FOR_PAST_RMST_1 0 AS1/DB_ALARM_READY_FOR_PAST_RMST_1 VT_BOOL 0
Name Execution Mode Command Triggered Writeback Address Data Type
READY_FOR_UNLOAD1 0 select READY_FOR_UNLOAD1 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_UNLOAD1} Unspecified
READY_FOR_UNLOAD2 0 select READY_FOR_UNLOAD2 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_UNLOAD2} Unspecified
READY_FOR_PAST_RMST_1 0 select READY_FOR_PAST_RMST_1 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_PAST_RMST_1} Unspecified
READY_FOR_PAST_RMST_2 0 select READY_FOR_PAST_RMST_2 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_PAST_RMST_2} Unspecified
READY_FOR_PAST_RMST_3 0 select READY_FOR_PAST_RMST_3 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_PAST_RMST_3} Unspecified
READY_FOR_SMP_PMST_1 0 select READY_FOR_SMP_PMST_1 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_SMP_PMST_1} Unspecified
READY_FOR_SMP_PMST_2 0 select READY_FOR_SMP_PMST_2 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_SMP_PMST_2} Unspecified
READY_FOR_SMP_PMST_3 0 select READY_FOR_SMP_PMST_3 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_SMP_PMST_3} Unspecified
READY_FOR_BUTTER_CST1 0 select READY_FOR_BUTTER_CST1 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_BUTTER_CST1} Unspecified
READY_FOR_BUTTER_CST2 0 select READY_FOR_BUTTER_CST2 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_BUTTER_CST2} Unspecified
READY_FOR_BUTTER_CST3 0 select READY_FOR_BUTTER_CST3 from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_READY_FOR_BUTTER_CST3} Unspecified
SEND_TO_RMST 0 select SEND_TO_RMST from MainLabFSQLGROUP FALSE {AS1/DB_ALARM_SEND_TO_RMST} Unspecified

Previous Ref:
yesturday i have post this problem
hi i m using factory sql 4.2.1 in some tags i have no problem to logging a data but in some tags i m facing problem i have created some groups when i have run groups some grops are running fine but some are not in some group i m getting this error

error executing update query.ERROR[07002][microsoft][odbc sql server driver] count field incorrect or syntex error

please suggest me how to resolve a this problem
milkTRANSFER.xls (24.5 KB)
PROCESSWISEDETAIL.xls (21 KB)
MAINLAB.xls (25 KB)

Hello,

It looks like all of the item names are fine, so it must be something else. Could you post some more information about the errors that are occurring? If you go to “Help->Log Viewer”, are there other errors that occur, or more information provided?

But first, I believe you mentioned that you are using version 4.2.1. I would recommend updating to the latest version, as I see you’re using booleans in those groups, and there was a problem fixed in 4.2.3 concerning booleans with the odbc driver (although the change log specifically mentions postgres as the database). If upgrading doesn’t help, we can go from there.

Regards,

hi
previously we disscussed with same problem right now i m using the lower version
4.1.6 in this version all groups are workin fine but the main problem is it is not working in some string values or working in some values error is given below

Error executing update query: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark after the character string ‘C2F2’. ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ‘C2F2’. at FactorySQL.LocalDBOperationProvider.ExecuteParameterNonQuery(DBConnectionID ConnectionID, String Query, IDbDataParameter[] Parameters, Int32 Timeout) at FactorySQL.FSQLDBCollection.WriteData() at FactorySQL.FSQLGroup.CentralHeartbeat(ExecutionToken Token) ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark after the character string ‘C2F2’. ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ‘C2F2’. at FactorySQL.LocalDBOperationProvider.ExecuteParameterNonQuery(DBConnectionID ConnectionID, String Query, IDbDataParameter[] Parameters, Int32 Timeout) at FactorySQL.FSQLDBCollection.WriteData() at FactorySQL.FSQLGroup.CentralHeartbeat(ExecutionToken Token)

plese help me how to resolve this issue

Hello,

I think it would really be best if you start by upgrading to the latest version of FactorySQL, 4.2.8. Going back to old versions may help one aspect, but obviously it can create others. If you start with the latest version and have problems, it will be easier for us to replicate and fix.

On other note: I see that you’re using the ODBC driver. This should work fine, but if possible you may try creating a “native” connection in FactorySQL. Native connections are almost always more efficient, and usually have fewer problems. However, like I said, we should be able to get the odbc connection to work.

Regards,