Wieland and Tim,

Thanks for your inputs. For now we want to go with ROUND function,
that won't abruptly cut off digits and give back a reasonable value.
But for that i now need to know the datatype of all columns in my query, which
i am ignorant of so far!.


Ravi

Wieland Pusch wrote:

Hello Tim and Ravi,

first of all Tim is right, but you can easily work around with the
format parameter. It seems to me that this is some kind of default
value for the format parameter, that has changed.
Maybe Oracle 8 is so clever to adopt the default format based on the
select column and Oracle 7 was always using the same default format.

SQL> select to_char(1/3) from dual;
TO_CHAR(1/3)
----------------------------------------
.333333333333333333333333333333333333333

SQL> select to_char(1/3, '9d9999999999999999999999999999999999999999') from dual;

TO_CHAR(1/3,'9D9999999999999999999999999999
-------------------------------------------
.3333333333333333333333333333333333333333


Change you code: my $src_test_value = $src_dbh->selectrow_array("select to_char(CONVERSION_RATE, '9d9999999999999999999999999999999999999999') from $src_schema_name.$src_table_name where FROM_CURRENCY_CODE = 'ZAR' and conversion_date = (select max(conversion_date) from $src_schema_name.$src_table_name where FROM_CURRENCY_CODE = 'ZAR')"); print "src conv rate = $src_test_value\n"

That should work.

Check my second thesis with Oracle 9:

SQL> create table t6 (n number(4,4));
SQL> insert into t6 values (1/3);
SQL> select * from t6;

        N
----------
    .3333

Tuesday, September 21, 2004, 10:05:19 PM, you wrote:
TB> On Tue, Sep 21, 2004 at 12:30:17PM -0700, Ravi Kongara wrote:


Again and again i'm getting into the problem of losing precision/scale
of NUMBER values.
DBI script selects/displays 39 digits after the decimal point, eventhough database has stored 40 digits, cutting off
last digit while selecting from source. Strangely, it displays all 40
digits from target, which is a Oracle 8 database.


...

cu
Wieland                            mailto:[EMAIL PROTECTED]






Reply via email to