Page 1 of 1

UniLoader - Oracle Boolean Fields

Posted: Wed 24 Feb 2010 14:40
by eduardomendes
In the conversion of boolean fields using the Component UniLoader appears the error message: "Cannot convert data for column."

I am using the method LoadFromDataSet.

Could you help me?

Posted: Fri 26 Feb 2010 14:39
by Falcon
Could you please specify the following:
- source and target Oracle field type;
- what check constraint for it is specified;
- what conversion you use.

Posted: Fri 26 Feb 2010 19:41
by eduardomendes
I need to import a table to oracle using uniloader. When I try to import a Boolean value from the source table is the error "Can not convert data for
column..

The same error occurs when I try to use a TBooleanField with an Oracle Database. With sql server and postgre it works fine, but fail with Oracle.

How can I handle Boolean fields?

Posted: Tue 02 Mar 2010 09:58
by Falcon
Use the code like the following:

Code: Select all

UniQuery1.SQL.Text := 'select * from test';
UniQuery1.Open;
UniLoader1.LoadFromDataSet(UniQuery1);
You should pay attention to the following.
UniQuery1 is mapped to the DB server supports boolean types (for example, MS SQL BIT), and at design-time you can add persistent fields, and corresponding one will be of the TBooleanField type. In the UniLoader1 you can add columns in the design time too, and the Oracle column corresponds to the TBooleanField will be of the TStringField type. At the same time, this column have be of the type CHAR(1) in the Oracle database, and passed values will be implicitly converted by the Oracle core.