Problem with Oracle Character Sets
Posted: Thu 15 Apr 2010 12:00
Hi,
to get correct data from blob fields, I have to set the CharSet. Doing this, I have to connect first, then disconnect, set the option and then connect again.
Is there another way to do this?
cu Christian
---
const
CHARSET_SQL = 'select VALUE from NLS_DATABASE_PARAMETERS where parameter = ''NLS_CHARACTERSET''';
function ExecLookupString(): String;
begin
// does a query and returns the result of the first record / column as string
// for this, the connection is already opened once
end;
then I do:
UniConnection.ProviderName := 'Oracle';
UniConnection.Server := 'DBSERVER:1521:MyDB';
UniConnection.SpecificOptions.Values['Direct'] := 'True';
UniConnection.SpecificOptions.Values['Charset'] := ExecLookupString(CHARSET_SQL);
UniConnection.Open;
to get correct data from blob fields, I have to set the CharSet. Doing this, I have to connect first, then disconnect, set the option and then connect again.
Is there another way to do this?
cu Christian
---
const
CHARSET_SQL = 'select VALUE from NLS_DATABASE_PARAMETERS where parameter = ''NLS_CHARACTERSET''';
function ExecLookupString(): String;
begin
// does a query and returns the result of the first record / column as string
// for this, the connection is already opened once
end;
then I do:
UniConnection.ProviderName := 'Oracle';
UniConnection.Server := 'DBSERVER:1521:MyDB';
UniConnection.SpecificOptions.Values['Direct'] := 'True';
UniConnection.SpecificOptions.Values['Charset'] := ExecLookupString(CHARSET_SQL);
UniConnection.Open;