ORA-00904 ERROR

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
praveenks
Posts: 3
Joined: Thu 14 Jan 2010 21:21

ORA-00904 ERROR

Post by praveenks » Thu 14 Jan 2010 21:34

We are upgrading our application from Delphi 2005 to Delphi 2010. We are using ODAC version 5.55.1.22 on Delphi 2005 , we purchased latest version of ODAC professional(odac 6.9) for Delphi 2010.

On latest version of ODAC we are getting ORA-00904 error on OraTable.Insert on parent table of parent- child relationship tables( 9 tables in hirerachy). It begins with OraSession.StartTransaction, then ParentTable.Insert, that puts all children tables in Insertmode. Parent Child relation is established by MasterSource, Master fields on OraTables. It works fine with old ODAC version under Delphi 2005. On dbmonitor it shows error on following SQL after parent table is in insert mode.
SELECT N, Y, R, N, N FROM Dual

We are not using Dual in our application other than to get nextval of sequence and that also not used in the above insert statement.

Oracle database: Oracle 10g 10.2.0.1.0

Any help to resolve the issue ASAP will be highly appreciated.

Thanks,Praveen.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 18 Jan 2010 09:02

This is the problem with DefaultExpression of fields. In the latest ODAC version you should use values with quotes for DefaultExpression. For example: 'N'.

You can enable the old behaviour of DefaultExpression by setting the DefaultExpressionOldBehavior global variable from the MemDS unit to True.

praveenks
Posts: 3
Joined: Thu 14 Jan 2010 21:21

Post by praveenks » Mon 18 Jan 2010 22:51

Thanks for the reply. I set MemDS.DefaultExpressionOldBehavior=true on oncreate event of datamodule and error above disappeared. Now i am getting error on field on OraTable where default expression is 0.00, on Post event it gives Credit field need value. Is there different format for default expression for numeric/decimal values

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 21 Jan 2010 12:48

You are using correct format. Please check that the default expression is set for the right field. Check the field value just after calling Insert.

praveenks
Posts: 3
Joined: Thu 14 Jan 2010 21:21

Post by praveenks » Thu 21 Jan 2010 16:41

I checked all the fields for defaultexpression and they are correct. I had to manually add OraTable.FieldByName('Test').AsFloat := 0.00 after OraTable.Insert to fix this issue.We have more than 50 tables and most of them have around 50 fields, it is time consuming to manually set values.

Thanks,Praveen.

Post Reply