Print Thread
Page 1 of 2 1 2
unicode problem with long strings
#6629 08/12/04 08:05 PM
Joined: Aug 2004
Posts: 10
W
Member
OP Offline
Member
W
Joined: Aug 2004
Posts: 10
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

Re: unicode problem with long strings
#6630 08/13/04 08:16 PM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
We'll look into this.


Marco Kalter
Allround Automations
Re: unicode problem with long strings
#6631 08/23/04 02:25 PM
Joined: Aug 2004
Posts: 10
W
Member
OP Offline
Member
W
Joined: Aug 2004
Posts: 10
Hello Marco,

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

regards,

walter

Re: unicode problem with long strings
#6632 08/24/04 06:12 PM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
No news yet, but we'll get to this shortly.


Marco Kalter
Allround Automations
Re: unicode problem with long strings
#6633 09/29/04 06:58 PM
Joined: Apr 2003
Posts: 12
M
Member
Offline
Member
M
Joined: Apr 2003
Posts: 12
Hi Marco,

any news yet?

thanks,

Matthias

Re: unicode problem with long strings
#6634 09/30/04 06:23 PM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
Sorry frown . I have placed this at the top of our list.


Marco Kalter
Allround Automations
Re: unicode problem with long strings
#6635 11/22/04 11:54 AM
Joined: Aug 2004
Posts: 10
W
Member
OP Offline
Member
W
Joined: Aug 2004
Posts: 10
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;

Re: unicode problem with long strings
#6636 11/22/04 10:52 PM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
Thanks, we'll check it out.


Marco Kalter
Allround Automations
Re: unicode problem with long strings
#6637 11/29/04 02:10 PM
Joined: Aug 2004
Posts: 10
W
Member
OP Offline
Member
W
Joined: Aug 2004
Posts: 10
Hello Marco,

do you have any timeframe for checking that out?

Thanks

Walter

Re: unicode problem with long strings
#6638 11/29/04 10:57 PM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
Hopefully later this week.


Marco Kalter
Allround Automations
Page 1 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.034s Queries: 14 (0.009s) Memory: 2.5659 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-05-09 12:22:43 UTC
Valid HTML 5 and Valid CSS