Print Thread
Integer-fieldtype instead of float (Oracle 12.1.0.1 -> 12.2.0.1)
#57669 03/12/18 09:51 AM
Joined: Jun 2000
Posts: 9
switzerland
R
Member
OP Offline
Member
R
Joined: Jun 2000
Posts: 9
switzerland
Hi

I use Delphi Tokio 10.2 and DOA 4.1.3.5.

In our app we use persistend fields which were "imported" from a Oracle-DB (12.1.0.1) as a floatfield.
Last week we migrate to Oracle Version 12.2.0.1 and now the open of the dataset crashes, because when i now import the same db-field its coming in as a integer fieldtype.

CREATE TABLE myTable
(lfnr NUMBER(10,0) NOT NULL,
id NUMBER(2,0) NOT NULL,
pz NUMBER(1,0) DEFAULT 0 NOT NULL)

The problem is the db-field "pz" with number(1,0).

Any idea what's happend here? Is there a TOraSession-property which can handle this behavior or is that a Oracle bug?

Thanks for your support and best regards,
Robert

Re: Integer-fieldtype instead of float (Oracle 12.1.0.1 -> 12.2.0.1)
rdeutsch #57671 03/12/18 04:25 PM
Joined: Jun 2000
Posts: 9
switzerland
R
Member
OP Offline
Member
R
Joined: Jun 2000
Posts: 9
switzerland
Hello

Meanwhile we found out that the problem depends on the sql-statement:

Try this sql:

select min(k.pz) min_pz
from myTable k
group by k.lfnr

Running against Oracle 12.1.0.1 results in a persistents fieldtype = float.

Running against Oracle 12.2.0.1 results in a persistents fieldtype = integer.


Any idea what's happend here? Is there a TOraSession-property which can handle this behavior or is that a Oracle bug?

Thanks for your support and best regards,
Robert

Re: Integer-fieldtype instead of float (Oracle 12.1.0.1 -> 12.2.0.1)
rdeutsch #57672 03/13/18 09:27 AM
Joined: Aug 1999
Posts: 22,219
Member
Offline
Member
Joined: Aug 1999
Posts: 22,219
I haven't tested it yet, but this indicates that Oracle 12.1 reports the scale or precision of the min_pz field differently than 12.2. You can probably force it to a float field by adding a dummy calculation. For example:

select min(k.pz) + 0.0 as min_pz
from myTable k
group by k.lfnr


Marco Kalter
Allround Automations
Re: Integer-fieldtype instead of float (Oracle 12.1.0.1 -> 12.2.0.1)
Marco Kalter #57673 03/13/18 10:13 AM
Joined: Jun 2000
Posts: 9
switzerland
R
Member
OP Offline
Member
R
Joined: Jun 2000
Posts: 9
switzerland
Hi Marco

[quote]You can probably force it to a float field by adding a dummy calculation.[/quote]

For example, when adding the nvl-command i get with both Oracleversions the same "persisten field"-result -> then its always a float.

select min(nvl(k.pz,0)) min_pz
from myTable k
group by k.lfnr

But i hope that will not be the final solution. There are a lot of sql-statements which i would have to test and control and perhaps to modify also. A lot of works paired with some risk...

br, Robert


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.032s Queries: 13 (0.008s) Memory: 2.5099 MB (Peak: 3.0421 MB) Data Comp: Off Server Time: 2024-05-15 20:44:04 UTC
Valid HTML 5 and Valid CSS