IntegerPrecision isn´t working with Oracle functions
Posted: Fri 23 Dec 2011 00:47
Hi,
I´m having a trouble with the IntegerPrecision parameter. I set it to 10, if I have a SELECT command in a NUMBER(10) field in a table, it´s ok, works perfectly, but, if I have a SELECT command in a NUMBER(10) field in a function, it´s not working. Instead of brings to the dataset a TIntegerField, the driver brings a TFloatField.
In almost all dataset that we have in our software, they are filled with the fields in design-time, so that, it´s important the driver brings us the correct field to mantain compatibility with SQL Server.
For example:
The select command is: select * from table(sp_teste('44'))
I made a sample Delphi project to ilustrate this problem, please let me know if you need it.
I´m using Delphi 2006, Oracle 11g XE R2 and 5.0.1 devArt driver for Oracle.
I created a function in Oracle called sp_teste, the code of this function is quite simple and it is underneath:
create or replace
TYPE "DT_SWT_SP_TESTE" AS OBJECT(i_number NUMBER(10,0));
create or replace
TYPE "SWT_SP_TESTE" AS TABLE OF DT_SWT_SP_TESTE;
create or replace
FUNCTION "SP_TESTE" (P_TESTE IN VARCHAR)
RETURN SWT_SP_TESTE PIPELINED
as
i_number NUMBER(10,0);
begin
i_number := 10;
PIPE ROW(DT_SWT_SP_TESTE(I_NUMBER));
RETURN;
end;
So, that´s it.
Thanks in advance
I´m having a trouble with the IntegerPrecision parameter. I set it to 10, if I have a SELECT command in a NUMBER(10) field in a table, it´s ok, works perfectly, but, if I have a SELECT command in a NUMBER(10) field in a function, it´s not working. Instead of brings to the dataset a TIntegerField, the driver brings a TFloatField.
In almost all dataset that we have in our software, they are filled with the fields in design-time, so that, it´s important the driver brings us the correct field to mantain compatibility with SQL Server.
For example:
The select command is: select * from table(sp_teste('44'))
I made a sample Delphi project to ilustrate this problem, please let me know if you need it.
I´m using Delphi 2006, Oracle 11g XE R2 and 5.0.1 devArt driver for Oracle.
I created a function in Oracle called sp_teste, the code of this function is quite simple and it is underneath:
create or replace
TYPE "DT_SWT_SP_TESTE" AS OBJECT(i_number NUMBER(10,0));
create or replace
TYPE "SWT_SP_TESTE" AS TABLE OF DT_SWT_SP_TESTE;
create or replace
FUNCTION "SP_TESTE" (P_TESTE IN VARCHAR)
RETURN SWT_SP_TESTE PIPELINED
as
i_number NUMBER(10,0);
begin
i_number := 10;
PIPE ROW(DT_SWT_SP_TESTE(I_NUMBER));
RETURN;
end;
So, that´s it.
Thanks in advance