UniLoader - Oracle Boolean Fields

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
eduardomendes
Posts: 28
Joined: Wed 24 Feb 2010 14:08

UniLoader - Oracle Boolean Fields

Post by eduardomendes » Wed 24 Feb 2010 14:40

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?

Falcon
Devart Team
Posts: 19
Joined: Tue 02 Feb 2010 10:40

Post by Falcon » Fri 26 Feb 2010 14:39

Could you please specify the following:
- source and target Oracle field type;
- what check constraint for it is specified;
- what conversion you use.

eduardomendes
Posts: 28
Joined: Wed 24 Feb 2010 14:08

Post by eduardomendes » Fri 26 Feb 2010 19:41

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?

Falcon
Devart Team
Posts: 19
Joined: Tue 02 Feb 2010 10:40

Post by Falcon » Tue 02 Mar 2010 09:58

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.

Post Reply