Possible to identify a raw field when using RawAsString?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Possible to identify a raw field when using RawAsString?

Post by MarkF » Fri 20 Apr 2007 18:19

Hi Folks!

If I'm using the RawAsString option, is it possible to tell that a field's original datatype was raw? It's not a big deal, but I was wondering if I was just missing a way to do it.

Thanks!

-Mark Ford

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 23 Apr 2007 09:13

ODAC does not support getting original data type for the RAW fields when the RawAsString option is True.

sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Re: Possible to identify a raw field when using RawAsString?

Post by sinys » Thu 28 Jul 2016 15:38

Hello!

I really need to know original data type too.
Could you please add new feature to keep original data type for field?

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

Re: Possible to identify a raw field when using RawAsString?

Post by AlexP » Mon 01 Aug 2016 08:40

Hello,

You can't get the original field type in the dataset, since Delphi types are used in DataSet. I.e., if the RawAsString option is enabled, then the field type will be TStringField, if disabled - TVarBytes. If you want to learn the Oracle field type, then you can use the TOraMetaData component: https://www.devart.com/odac/docs/?devar ... tadata.htm

sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Re: Possible to identify a raw field when using RawAsString?

Post by sinys » Tue 02 Aug 2016 12:25

#if the RawAsString option is enabled, then the field type will be TStringField, if disabled - TVarBytes.
I have source licence and I saw this code.
OraClasses.pas

Code: Select all

procedure TOCICommand.DetectDataType(DBType: Word; ...
begin
  case DBType of
...
oraRaw:
      if FFieldsAsString or FRawAsString then
        if FConnection.FUseUnicode then
          DataType := dtWideString
        else
          DataType := dtString
      else
        DataType := dtVarBytes;
Just I want to have access to DBType parameter for can get oraRaw (original data type). May be you don't keep it now, I don't know. I wish you save DBType that I have access to this metadata without additional query (from TOraMetaData).

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

Re: Possible to identify a raw field when using RawAsString?

Post by AlexP » Mon 12 Sep 2016 08:47

The TField standard class has only the DataType property, and no additional properties describing internal types. Therefore, at the user level, you should use TOraMetaData to get required data.

Post Reply