Interval Day to Second

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Interval Day to Second

Post by jdorlon » Wed 19 Dec 2012 20:45

Hello,

If I call TSmartQuery.Prepare, and there is a field that is INTERVAL DAY(x) TO SECOND(Y), I know that I can discover the X-value with FieldDesc.Length. How can I discover the Y value? I know I can discover it if I execute the query, but is there a way to find it having only prepared the query?

thank you,

John Dorlon

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

Re: Interval Day to Second

Post by AlexP » Thu 20 Dec 2012 14:33

Hello,

Unfortunately, at the moment, it is impossible to retrieve this value. We will consider the possibility to add such functionality in the next versions.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Interval Day to Second

Post by jdorlon » Thu 20 Dec 2012 16:00

Thank you. I was also unable to determine the scale on FLOAT columns. So, FLOAT(10) looked the same as FLOAT(20) which looked the same as FLOAT. If you could also take a look at that one, I would appreciate it.

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

Re: Interval Day to Second

Post by AlexP » Fri 21 Dec 2012 11:41

Hello,

There is a code below returning fields Precision and Scale NUMBER

Code: Select all

CREATE TABLE TEST_NUMBER
(
  F_ID NUMBER NOT NULL,
  F_10 NUMBER(10),
  F_20 NUMBER(20),
  F_NUMBER NUMBER,
  F_3_5 NUMBER(3,5),
  F_7_4 NUMBER(7,4)
)

Code: Select all

var
  i: integer;
begin
  OraQuery1.SQL.Text := 'SELECT * FROM TEST_NUMBER' ;
  OraQuery1.Prepare;
  for i := 1 to OraQuery1.FieldCount do
    ShowMessage(Format('Field: %s(%d,%d)',[OraQuery1.GetFieldDesc(i).Name,
                                          OraQuery1.GetFieldDesc(i).Length,
                                          OraQuery1.GetFieldDesc(i).Scale]));
end;

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Interval Day to Second

Post by jdorlon » Fri 21 Dec 2012 14:39

For NUMBER columns, what you say is true. FLOAT is not just a synonym for NUMBER. Try it with FLOAT and you'll see what I mean.

Code: Select all

CREATE TABLE TEST_NUMBER
(
  F_ID        NUMBER                            NOT NULL,
  F_10        NUMBER(10),
  F_20        NUMBER(20),
  F_NUMBER    NUMBER,
  F_3_5       NUMBER(3,5),
  F_7_4       NUMBER(7,4),
  F_FLOAT     FLOAT,
  F_FLOAT_10  FLOAT(10),
  F_FLOAT_20  FLOAT(20)
);

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

Re: Interval Day to Second

Post by AlexP » Mon 24 Dec 2012 11:52

Hello,

Thank you for the information. We have reproduced the problem with defining of the FLOAT fields precision, and will try to fix it in the nearest version of the product.

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

Re: Interval Day to Second

Post by AlexP » Tue 12 Feb 2013 12:29

Hello,

We have fixed the behaviour when using INTERVAL types, now, you can retrieve both X and Y values in the INTERVAL DAY(x) TO SECOND(Y) type.
When using FLOAT values, binary precision is used (decimal precision - in NUMBER), and since we don't use metadata to retrieve precision, we set values returned by server. If you want to use values set when creating the table, you can use the TOraMetaData component for this.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Interval Day to Second

Post by jdorlon » Tue 12 Feb 2013 14:10

Thank you Alex.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Interval Day to Second

Post by jdorlon » Wed 27 Feb 2013 17:01

Hi Alex,

I see the comment in the latest version about this, but I don't see the information in TFieldDesc. Stepping into TSmartQuery.Prepare, I can find it in TCRFieldDesc, but I don't know how to find that from TFieldDesc. Am I missing something?

thanks,

John

Post Reply