CLOB problems

Karo

Member
I have a problem with saving text to an Oracle CLOB field using Direct Oracle Access components (DOA). When I post update to a database some of international characters (win-1250) get lost. But this doesn't happen in our production or test environment. It only happens -- of course -- at client's side. I have eliminated all transformations of text in code and I get down to the line that loads a stream into a blob field. But even this looks ok -- until I refresh data. Server then returns "?" character instead of some
international characters.

The weirdest thing is that this works on same client's computer with prior version of same application (maybe also an older version of DOA?)! If we connect to client's database from our computers, everything works fine with
new version also.

Code looks something like this:

procedure Save;
var Q: TOracleDataset;
AStream: TStringStream;
begin
...
Q.Edit;
TBlobField(Q.FieldByName('CONTENT')).LoadFromStream(AStream);
Q.Post;
// here everything looks ok
Q.Close;
...
Q.Open;
// blob has ? characters
...
end;

Any ideas?

Thanks,
Robert
 
I don't think this is caused by your application code, but by the character set of the Oracle Server (specified during database creation) or the Oracle Client (NLS_LANG). Oracle Net will convert between the server and client character set, and if they are not compatible, you can get the problems you describe.
 
Client and I have both EE8MSWIN1250 charset set in NLS_LANG. Database has EE8ISO8859P2. I can read and write to DB trough internet, but the user can only read the data properly. When writing one of the two problematic international characters conversion to ? occurs.

It looks like the problem is conversion on client machine. Is there any CLOB character conversion in your component that can be affected by some other Windows regional settings?
 
Character conversion is only affected by the character set that the database is created with, and the character set of the NLS_LANG key of the Primary Oracle Home. Oracle Net will convert between the client and server character set.
 
What major changes have you made from version 3 to 4? I have same app with same code and different DOA, and only new app has problems with CLOB character conversions (olny CLOB, VARCHAR2 not). It looks like new app bypasses character conversion and writes raw data. It's possible that your current version works correctly, and you solved some bug that made my app work correctly!?
 
I can't think of any changes that would affect CLOB character conversions. The TLOBLocator class is virtually unchanged.
 
Back
Top