Posted By: walter.egger unicode problem with long strings - 08/12/04 08:05 PM
Hello,

i am using Doa 4.0.5, Delphi 7 and Oracale 9i. Our database is configured for unicode support(Session.BytesPerCharacter is set to bcAutoDetect - the function returns 4 Bytes per Character).

When i am using Bind Variables in a TOracleQuery i can not insert strings longer than 1000 characters into a varchar2(4000) field.

Strings longer than 1000 result in an ORA-01480: Nachgestellte Null fehlt bei STR-Bindewert
error.

As i am using only single byte characters in my delphi app (AnsiString) it should be possible to insert more than 1000 characters. (its no problem of the database, as i can insert longer strings with db tools such as Toad)

regards,

walter
Posted By: Marco Kalter Re: unicode problem with long strings - 08/13/04 08:16 PM
We'll look into this.
Posted By: walter.egger Re: unicode problem with long strings - 08/23/04 02:25 PM
Hello Marco,

any news regarding this problem? Do you need any help to reproduce it?

regards,

walter
Posted By: Marco Kalter Re: unicode problem with long strings - 08/24/04 06:12 PM
No news yet, but we'll get to this shortly.
Posted By: matthias Re: unicode problem with long strings - 09/29/04 06:58 PM
Hi Marco,

any news yet?

thanks,

Matthias
Posted By: Marco Kalter Re: unicode problem with long strings - 09/30/04 06:23 PM
Sorry frown . I have placed this at the top of our list.
Posted By: walter.egger Re: unicode problem with long strings - 11/22/04 11:54 AM
Hello Marco,

>>Sorry . I have placed this at the top of our >>list.

3 months is a long time for beeing on the top of the list. frown

maybe you could really look into this. i have written a short test programm. it creates a table with an varchar2(4000 char) field.

1) it inserts a record containing 1000 chars with bind variables -> sucess

2) it updates this field (now containing 2000 chars) -> success

3) it inserts another record containing 2000 chars without bind variables -> sucess

4) it tries to insert another record containing 2000 chars with bind variables -> error ora-01480


i really hope to get an answer / solution soon

Walter


We are using Oracle 9i Enterprise Server Version 9.2.0.4, Client 9.2.0.6.

DB Character Set: AL32UTF8
Client Setting:
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0]
"ID"="0"
"ORACLE_GROUP_NAME"="Oracle - OraHome92"
"ORACLE_HOME_NAME"="OraHome92"
"ORACLE_HOME"="C:\\Programme\\OraHome92"
"NLS_LANG"="GERMAN_AUSTRIA.WE8MSWIN1252"
"NLS_NUMERIC_CHARACTERS"=".,"
"NLS_DATE_FORMAT"="YYYY-MM-DD HH24:MI:SS"
"NLS_TIME_FORMAT"="HH24:MI:SSXFF"
"NLS_TIMESTAMP_FORMAT"="YYYY-MM-DD HH24:MI:SSXFF"
"ORACLE_BUNDLE_NAME"="Enterprise"
"ORAMTS_CP_TRACE_LEVEL"="0"
"ORAMTS_CP_TRACE_DIR"="C:\\Programme\\OraHome92\\oramts\\Trace"
"ORAMTS_CONN_POOL_TIMEOUT"="120"
"ORAMTS_SESS_TXNTIMETOLIVE"="120"
"ORAMTS_NET_CACHE_MAXFREE"="5"
"ORAMTS_NET_CACHE_TIMEOUT"="120000"
"ORAMTS_OSCREDS_MATCH_LEVEL"="OS_AUTH_LOGIN"


procedure TestInsert(Sender: TObject);
var
Qry : TOracleQuery;
Db : TOracleSession;
begin
Db := TOracleSession.Create(nil);
Db.LogonUsername:='YOUR_USER';
Db.LogonPassword:='YOUR_PASSWORD';
Db.LogonDatabase:='YOUR_DATABASE';
Db.BytesPerCharacter := bcAutoDetect;
try
Db.LogOn;

Qry := TOracleQuery.Create(nil);
Qry.Session := Db;

Qry.SQL.Text := 'CREATE TABLE DOABUG(NR INTEGER NOT NULL,UNI4000 VARCHAR2(4000 CHAR) NULL)';
Qry.Execute;
try
// insert a 1000 varchar2 into uni4000 with bind variable
Qry.SQL.Text := 'INSERT INTO DOABUG (NR, UNI4000) VALUES(:NR, :UNI4000) ';
Qry.DeclareAndSet('NR',otInteger,1);
Qry.DeclareAndSet('UNI4000',otString,DupeString('A',1000));
Qry.Execute; //success
Qry.DeleteVariables;

// Update uni4000 field (now contains 2000 varchar2)
Qry.SQL.Text := 'UPDATE DOABUG SET UNI4000=UNI4000||UNI4000 WHERE NR=1';
Qry.Execute; //success

// insert a 2000 varchar2 into uni4000 without bind variable
Qry.SQL.Text := 'INSERT INTO DOABUG (NR, UNI4000) '+
' VALUES(:NR, '''+DupeString('A',2000)+ ''') ';
Qry.DeclareAndSet('NR',otInteger,2);
Qry.Execute; //success

// try to insert 2000 varchar2 into uni4000 with bind variable
Qry.SQL.Text := 'INSERT INTO DOABUG (NR, UNI4000) VALUES(:NR, :UNI4000) ';
Qry.DeclareAndSet('NR',otInteger,3);
Qry.DeclareAndSet('UNI4000',otString,DupeString('A',2000));
Qry.Execute; // fail -> error ora-01480
finally
Qry.DeleteVariables;
Qry.SQL.Text :='DROP TABLE DOABUG';
Qry.Execute;
end;
finally
Qry.Free;
Db.LogOff;
end;
end;
Posted By: Marco Kalter Re: unicode problem with long strings - 11/22/04 10:52 PM
Thanks, we'll check it out.
Posted By: walter.egger Re: unicode problem with long strings - 11/29/04 02:10 PM
Hello Marco,

do you have any timeframe for checking that out?

Thanks

Walter
Posted By: Marco Kalter Re: unicode problem with long strings - 11/29/04 10:57 PM
Hopefully later this week.
Posted By: walter.egger Re: unicode problem with long strings - 12/06/04 02:14 PM
any news?

Walter
Posted By: Marco Kalter Re: unicode problem with long strings - 12/06/04 10:31 PM
Sorry, not yet, it has been a busy week. This week should be doable though.
Posted By: Marco Kalter Re: unicode problem with long strings - 12/10/04 08:51 PM
Update: we have been able to reproduce the problem, and are looking for a solution now.
Posted By: walter.egger Re: unicode problem with long strings - 01/03/05 08:01 PM
any news?
walter

mad mad mad mad mad
Posted By: walter.egger Re: unicode problem with long strings - 03/10/05 08:48 PM
Hello Marco,

>>Update: we have been able to reproduce the >>problem, and are looking for a solution now.

can i expect, that this issue will be solved in the upcomping release?

Walter
Posted By: Marco Kalter Re: unicode problem with long strings - 03/11/05 08:48 PM
No, this issue is unfortunately not resolved.
Posted By: Marco Kalter Re: unicode problem with long strings - 03/14/05 09:06 PM
Maybe we have come up with a workaround though. I will e-mail you.
Posted By: Antoine Gabus Re: unicode problem with long strings - 09/15/05 05:52 PM
[quote]Originally posted by Marco Kalter:
Maybe we have come up with a workaround though. I will e-mail you. [/quote]If you have a solution about the problem with the long string and unicode, I'll glad to know it.

Thank you
Antoine
Posted By: Marco Kalter Re: unicode problem with long strings - 09/15/05 06:58 PM
The workaround I mentioned applies to TOracleDataSet components only. If this will help you, let me know.
© Allround Automations forums