[Delphi2007][Oracle] Pb to update/insert/delete

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
humantool
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 10.02.2009, 17:16

[Delphi2007][Oracle] Pb to update/insert/delete

Post by humantool »

Hi,
I want to migrate my mulit-tier application with Paradox/BDE to Oracle/Zeos. So to test the components I created a table "test" :

Code: Select all

CREATE TABLE TestTW (
  NumTest NUMBER(8,0) NOT NULL,
  NomTest VARCHAR2(45) default NULL,
  DateTimeTest TIMESTAMP default NULL,
  DateTest DATE default NULL,
  TimeTest TIMESTAMP default NULL,
  SmallIntTest SMALLINT default NULL,
  MemoTest CLOB default NULL,
  BlobTest BLOB default NULL,
  DecimalTest DECIMAL default NULL,
  NumericTest NUMERIC default NULL
)
Then I created a test application with :
- 1 TZConnection
- 1 TZTable
- 1 TDataSetProvider
- 1 TClientDataSet
- 1 TDataSource
- 1 TDBGrid
- 1 TDBNavigator

I "imported" all fields in my TClientDataSet :

Code: Select all

CdtTestZeosNUMTEST: TIntegerField;
CdtTestZeosNOMTEST: TStringField;
CdtTestZeosDATETIMETEST: TDateTimeField;
CdtTestZeosDATETEST: TDateField;
CdtTestZeosTIMETEST: TDateTimeField;
CdtTestZeosSMALLINTTEST: TLargeintField;
CdtTestZeosMEMOTEST: TMemoField;
CdtTestZeosBLOBTEST: TBlobField;
CdtTestZeosDECIMALTEST: TLargeintField;
CdtTestZeosNUMERICTEST: TLargeintField;
I Open my clientdataset :

Code: Select all

CdtTestZeos.Open
And my DBGrid display my empty table as well.
But when I tried to insert (when I post with the navigator) it throw a reconcilerror : ORA-00923
I puted a TZSQLMonitor and it display this :

Code: Select all

2009-02-10 17:12:56 cat: Connect, proto: oracle-9i, msg: CONNECT TO "XE" AS USER "test"
2009-02-10 17:12:56 cat: Execute, proto: oracle-9i, msg: SET TRANSACTION ISOLATION LEVEL DEFAULT
2009-02-10 17:12:56 cat: Execute, proto: oracle-9i, msg: END TRANSACTION
2009-02-10 17:12:56 cat: Execute, proto: oracle-9i, msg: SET TRANSACTION ISOLATION LEVEL DEFAULT
2009-02-10 17:12:57 cat: Execute, proto: oracle-9i, msg: SELECT * FROM TEST.TESTTW

2009-02-10 17:12:57 cat: Execute, proto: oracle-9i, msg: SELECT * FROM TEST.TESTTW

2009-02-10 17:12:57 cat: Execute, proto: oracle-9i, msg: SELECT NULL, OWNER, TABLE_NAME, COLUMN_NAME, NULL, DATA_TYPE, DATA_LENGTH, NULL, DATA_PRECISION, DATA_SCALE, NULLABLE, NULL, DATA_DEFAULT, NULL, NULL, NULL, COLUMN_ID, NULLABLE FROM SYS.ALL_TAB_COLUMNS WHERE OWNER LIKE 'TEST' AND TABLE_NAME LIKE 'TESTTW' AND COLUMN_NAME LIKE '%'
2009-02-10 17:13:05 cat: Execute, proto: oracle-9i, msg: SELECT * FROM TEST.TESTTW

2009-02-10 17:13:05 cat: Execute, proto: oracle-9i, msg: SELECT * FROM TEST.TESTTW

2009-02-10 17:13:05 cat: Execute, proto: oracle-9i, msg: SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
, errcode: 923, error: ORA-00923: mot-clé FROM absent à l'emplacement prévu

2009-02-10 17:13:09 cat: Disconnect, proto: oracle-9i, msg: DISCONNECT FROM "XE"
I never edited all columns of my table just NumTest and NomTest.....
It seems that the query generated is incomplete but I dont know why....
Did I configure components in the right way ?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi,

The select is made because of the default values. (In case of default NULL this seems a little silly, I know, but there are other possible defaults where it makes more sense)

This was a bug that has been fixed by now. The patch is in http://fisheye2.atlassian.com/changelog/zeos/?cs=516 .

Mark
Image
humantool
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 10.02.2009, 17:16

Post by humantool »

I'm using the 6.6.4 so I need to patch, that's it ?
And to patch, I need to get the ZDbcOracle.pas file on the svn, right ?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Or do the changes by hand. It's not that big work. Just depends on if you want to use SVN.
If you do, make sure you use the 6.6-patches branch. Trunk is 7.X already.

It will be in the next maintenance release anyway, but that can take some time to come out.
Image
humantool
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 10.02.2009, 17:16

Post by humantool »

ok thanks a lot !

By the way the 7.x will not continue to support Oracle connection, is it sure ?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

By the way the 7.x will not continue to support Oracle connection, is it sure ?
Wrong conclusion. The announcement just mentioned the versions we can really support in terms of maintenance. The coding will not be removed yet. We hope somebody shows up to take some oracle coding responsibility.

Mark
Image
Post Reply