Consultor Eletrônico



Kbase P84679: Database trigger is suppressed by the error 6182 with DataServer for Microsoft SQL Server
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   17/09/2008
Status: Verified

SYMPTOM(s):

Database trigger is suppressed by the error 6182 with DataServer for Microsoft SQL Server

"You tried to compare or to update a character field with a value longer than the maximum length. (6182)

FACT(s) (Environment):

Using Write trigger on Schema Holder to truncate the data to the correct length
The DataServer switch "-Dsrv skip_schema_check" is used in the connection parameter
The database trigger works with Oracle DataServer without the above error
MS SQL DataServer
Progress 9.1x
OpenEdge 10.x
Windows NT 32 Intel/Windows 2000

CAUSE:

Enhancement request# OE00106079

CAUSE:

The architecture of the MS SQL Server DataServer is slightly different than that of the Oracle DataServer with respect to schema information. Oracle minimizes the schema information it stores with records on the OpenEdge client whereas the SQL Server DataServer maximizes it. As a result, the SQL Server DataServer is able to utilize that schema information in advance of a bad write to the database to prevent the write from ever happening.  It just so happens that the validation checking takes place in the SQL Server DataServer in advance of triggers firing. So in the case of SQL Server, you cannot rely on an OpenEdge trigger to correct a bad value before the server write executes. The Oracle DataServer which does no such error checking before the write does allow a trigger to correct the value before the write occurs because OpenEdge triggers fire from the schema layer which is evaluated BEFORE the server write takes place.

FIX:

Option #1
Do not insert more data than the field length defined in the SQL Server database. Option #2
Change the field length in the SQL Server database and perform Update/Add table definition DataServer tools to reflect the change.