TClientDataSet + TOraProvider. Unknown data type

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
m.ghilardi
Posts: 41
Joined: Thu 13 Mar 2014 11:14

TClientDataSet + TOraProvider. Unknown data type

Post by m.ghilardi » Tue 13 Oct 2015 13:32

I have some issues working with Datasnap + ODAC

Define the following table and types in Oracle DB. I work with an Oracle 11g Standard

Code: Select all

create or replace type id_set_t as table of number(18);
/
create or replace type subtipo as object
(
  a_id number(18),
  a_class_name varchar2(30)
);
/
create or replace type tipo1 as object
(
  a_id number( 18 ),               
  a_create_time timestamp with time zone,  
  a_id_set id_set_t,
  a_sub subtipo
);
/ 
 
create table tipo1_table of tipo1
  nested table a_id_set
    store as tipo1_ids;
    
insert into tipo1_table values(1000, systimestamp, NULL, subtipo(1000,'aaaaa'))
New project, put a TOraSession with data mapping as follows

Code: Select all

object Session: TOraSession
  DataTypeMap = <
    item
      DBType = 111
      FieldType = ftTimeStamp
    end>
  Left = 640
  Top = 352
end
TOraQuery linked with TOraProvider linked with TClientDataSet

Code: Select all

object Qry: TOraQuery
  Session = Session
  Left = 600
  Top = 256
end
object OraProvider: TOraProvider
  DataSet = Qry
  Left = 521
  Top = 257
end
object DataSet: TClientDataSet
  Aggregates = <>
  PacketRecords = 10
  Params = <>
  ProviderName = 'OraProvider'
  Left = 448
  Top = 256
end
add a TDBGrid, a TMemo and finally a TButton
OnClick

Code: Select all

Qry->SQL->Text = MemoQuery->Text;
		if (DataSet->Active)
		{
			DataSet->Close();
		}
		DataSet->Open();
Now run the project and try the following queries

Code: Select all

select * from tipo1_table
The Grid shows 4 columns instead of 5 (a_sub is correctly split in two). a_id_set is missing!

Code: Select all

select value(x) from tipo1_table x
An error is raised
Field 'VALUE(X).A_CREATE_TIME' is of an unknown type.
So the data type mapping in TOraSession doesn't work when the type is stored inside an Oracle Object.

Code: Select all

select a_id_set from tipo1_table
Debugger Exception Notification
Project AppClientDS.exe raised exception class EDSWriter with message ''.

At run time
Catastrophic Failure

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TClientDataSet + TOraProvider. Unknown data type

Post by AlexP » Thu 15 Oct 2015 08:57

DataTypeMapping has no support for mapping from object data types

m.ghilardi
Posts: 41
Joined: Thu 13 Mar 2014 11:14

Re: TClientDataSet + TOraProvider. Unknown data type

Post by m.ghilardi » Thu 15 Oct 2015 09:51

AlexP wrote:DataTypeMapping has no support for mapping from object data types
I see. Any plans to improve Oracle Objects support? This is not the only issue I had with objects.
Object support is more or less the reason we prefer Devart ODAC over other libraries.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TClientDataSet + TOraProvider. Unknown data type

Post by AlexP » Thu 15 Oct 2015 12:18

We don't plan to implement support for objects in DataTypeMapping yet. The challenge for such support is that object structure may be random, including inheritance, etc. You can select a field from an object and map it to the needed type in the query.

Post Reply