Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORACLE 8i & DELPHI 5
>when we write that :
> DataSet.FieldByName('END_DATE').asstring :=
>DataSet.fieldbyname('MY_YEAR').AsInteger;
Object Pascal is a strongly typed language. You can not assign an integer to a string.
ASSUMING the assignment you are trying to make is logically what you
want use
DataSet.FieldByName('END_DATE').asString :=
DataSet.fieldbyname('MY_YEAR').AsString;
If a field could be null then test for isNull.
I do not know if you are using the BDE or some third party connection like "Direct Oracle Access" (Which I strongly recommend). I do not remember which links or where; but some allow you to specify how Nulls will be treated. i.e. returned as Null or default to Zero or empty string as requested.
Personally, I would stick to testing up front with Field.isNull.
Clive Received on Sat Dec 09 2000 - 12:24:15 CST