Print Thread
Big problem with inserting records
#8032 12/13/05 03:43 PM
Joined: Nov 2005
Posts: 5
Warsaw
R
remq Offline OP
Member
OP Offline
Member
R
Joined: Nov 2005
Posts: 5
Warsaw
Hello,
I had been using Delphi application with DOA 3.6. Oracle version was 10.1 with NLS_CHARACTERSET=UTF8.
There had been problem with changing numeric fields. Whenever user tried edit numeric field in client program
"Record is locked by another user" was returned even if there were no locked objects. Problem only
occured with numerical columns in Oracle.
I also made some tests on different server with Oracle 10.1, with NLS_CHARACTERSET=EE8MSWIN1250. Everything
was ok.

Recently, I upgraded DOA to version 4.0 to get ridd of locking problem. Problem disappeared, but
now I have even worse problems which happen only on Oracle with UTF8 characterset. Database containts
Lithuanian characters, maybe this is the reason..

The problem occurs when TOracleDataSet inserts record into the database. When record is inserted
fields are written into the database in wrong order!!!

For example record is to be inserted like this:

insert into my_table(id, field_1, field_2, field_3, ..... field_x)
values(1, value_1, value_2, value_3, ..... value_x)

but finally it is written into the table with fields in quite different order!!!
For example instead of
value_1 the record contains value_3, and instead of value_3 record contains value_7 and so on..
The order of inserted fields is random.


I captured SQL's in Oracle Monitor and sql inserting 1 record looks like this:

insert into my_table
(ID, FIELD_1, FIELD_2, FIELD_3, ... FIELD_X)
values
(:v1, :v2, :v3, :v6, :v7, :v8,..... :v_x)
returning rowid into :doa__rowid


Whereas in DOA 3.4 SQL looked like this:

insert into my_table
(ID, FIELD_1, FIELD_2, FIELD_3, ... FIELD_X)
values
(:ID, :FIELD_1, :FIELD_2, :FIELD_3,..... :FIELD_X)


It seems that in DOA 4.0 variables are named by "v" whereas in older version variables where named by
field names.

To conclude: currently records inserted to Oracle are totally random! I have no idea what is wrong.
Is it a matter of TOracleDataSet properties?
All problems take place on Oracle with UTF8 characterset,and with Lithuanian data in tables. Is it
supposed to be the reason?

Please help me with the problem,

Greetings,
Remek G

Re: Big problem with inserting records
#8033 12/13/05 10:41 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
I have never heard of such a strange problem before. You captured this statement:

insert into my_table
(ID, FIELD_1, FIELD_2, FIELD_3, ... FIELD_X)
values
(:v1, :v2, :v3, :v6, :v7, :v8,..... :v_x)
returning rowid into :doa__rowid

Are the values for :v1 .. :v_x correct in this statement?


Marco Kalter
Allround Automations

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.070s Queries: 13 (0.032s) Memory: 2.5029 MB (Peak: 3.0428 MB) Data Comp: Off Server Time: 2024-05-20 03:41:37 UTC
Valid HTML 5 and Valid CSS