Consultor Eletrônico



Kbase P110518: COPY-LOB from MEMPTR to LONGCHAR throws error 12008 or 12012
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/22/2010
Status: Verified

SYMPTOM(s):

COPY-LOB from MEMPTR to LONGCHAR fails

MEMPTR contains embedded null characters (hex '00')

One of the following errors occurs:

Invalid character code found in data for codepage (12008)

Invalid character data found in MEMPTR for codepage (12012)

FACT(s) (Environment):

OpenEdge 10.x
All Supported Operating Systems

CAUSE:

This is expected behavior.

During the COPY-LOB, all the bytes in the MEMPTR are validated as valid chars in the LONGCHAR's codepage.
Since embedded nulls are not valid chars in a string, the validation fails and the errors are raised.

FIX:

To prevent the error messages, make sure there are no null bytes in the source MEMPTR.

Typically the null bytes are present because the MEMPTR is sized larger than the actual data.