Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Filling integer fields in an Oracle database from Delphi by the use of Midas and dbExpress.
Hi,
Can anybody tell me how a can fill an integer field in an Orcale database from Delphi by the use of Midas and dbExpress ?
I have a TClientDataSet connected to a TDataSetProvider in a remote datamodule and that provider is connected to a TSqlDataSet. The remote datamodule uses a TSqlConnection to connect to the Oracle database through an Oracle-TNS. The client application is connected to the remote datamodule by another TSqlConnection.
The integer field is defined by a script and because of Oracle is translated into NUMERIC ( *, 0 ). In a Delphi application this is translated to the type TFMTBCDField. In "Delphi 5 Developer's Guide: Working with field components", chapter 19 I read that one can address the type TBCDField by the use of AsVariant, AsString and AsInteger. I use TFMTBCDField.AsInteger and get an EDatabaseError with message 'ORA-01722: invalid number'. The Oracle documentation tells that this is usually caused by a wrong string format. I'm not using a string format. Because it is not desired that the BDE is used I haven't got a BDE-alias and because of this I see no way to tell the dbExpress-connection "ENABLE INTEGERS = True". I can define the field in the script as NUMERIC ( 10, 0 ). Then I get a field of type TBCDField with the same problem.
Can anybody tell me what is going wrong and how I can solve the problem ?
Ed. Received on Wed Dec 12 2001 - 12:20:13 CST