Issue 11746 - numeric(n) data from jdbc/oracle rendered as currency and not as number
Summary: numeric(n) data from jdbc/oracle rendered as currency and not as number
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.0.1
Hardware: PC Linux, all
: P3 Trivial with 1 vote (vote)
Target Milestone: OOo 2.4
Assignee: christoph.lukasiak
QA Contact: issues@dba
URL:
Keywords:
: 53396 54295 83469 (view as issue list)
Depends on:
Blocks:
 
Reported: 2003-02-22 15:21 UTC by jlueters
Modified: 2008-05-21 10:49 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Testcase jdbc/oracle metadata (1.91 KB, text/plain)
2003-02-24 14:41 UTC, jlueters
no flags Details
start script to JdbcCheckup.java (234 bytes, text/plain)
2003-02-24 14:42 UTC, jlueters
no flags Details
logfile for start_java.sh (1.68 KB, text/plain)
2003-02-24 14:43 UTC, jlueters
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description jlueters 2003-02-22 15:21:25 UTC
When retieving table data from a oracle database using the oracle jdbc driver
and blackdown java j2se1.3 the oracle data type number(4)|number(2) is formatted
as currency instead of number. Changing the column formatting and saving the
request does not persist (the changed column formatting is not saved).
Comment 1 ocke.janssen 2003-02-24 08:13:16 UTC
Hi Jürgen,

I'm sorry to say that this is a bug in the JDBC from Oracle. They
always return that a column is a currency field.

Best regards,

Ocke
Comment 2 jlueters 2003-02-24 14:41:24 UTC
Created attachment 4872 [details]
Testcase jdbc/oracle metadata
Comment 3 jlueters 2003-02-24 14:42:21 UTC
Created attachment 4873 [details]
start script to JdbcCheckup.java
Comment 4 jlueters 2003-02-24 14:43:55 UTC
Created attachment 4874 [details]
logfile for start_java.sh
Comment 5 jlueters 2003-02-24 14:45:16 UTC
Unfortunatley i can come up with a working example, which i provide as
attachments. It consists of threfiles "JdbcCheckup.java" (taken from
oracle demos and slightly modified), and a shellscript "start_java.sh"
starting the beast and a log file documenting the results gotten here.

What did i use? :

Oracle database 920 on debian woody on separate database server 
User scott, password tiger (oracle provided examples)

Oracle client 920 on debian unstable
Oracle jdbc12 from Oracle920 distribution

 
Comment 6 ocke.janssen 2003-02-24 14:48:53 UTC
what does the ResultMetaData return for isCurrency?
Comment 7 marc.neumann 2003-03-10 10:21:43 UTC
So , I guess that you accept that this is not a OOo issue.

Bye Marc
Comment 8 marc.neumann 2003-03-10 10:22:14 UTC
.
Comment 9 jlueters 2003-03-10 19:01:43 UTC
I do agree that the error is on oracle's side. I will file a bug
against their jdbc implementation using metalink. Anyway the current
situation renders the usage of oracle in Openoffice.org almost unusable.
After digging in the oracle documentation it seems clear that oracle
does not support a currency datatype at all. The database is providing
the datatype "number" with a varying degree of precision.
As a oracle client it is the clients responsibility to display the
number dates as currency. So it is indeed a stupid decision to set
"isCurrency" to true on fields that returns numbers.

So my question/pledge/suggestion is twofold:

1. might it be possible to ignore the "isCurrency" switch in case you
are using a oracle database ?

2. It would help tremendoulsy if it might be possible to save at least
querys. Now you can change the displaydataype to number, but that gets
lost after closing the dialog. Getting keys displayed as currency is 
 really confusing.   

  
Comment 10 Frank Schönheit 2003-03-11 08:02:11 UTC
> might it be possible to ignore the "isCurrency" switch in case you
> are using a oracle database ?

It might, with some kind of additional switch. It's hard to
(reliably!) determine that we're using Oracle, and even if it would be
easy, such generic magics like "if type XYZ, do ABC" is bad, because
not future-proof. But we could probably try to add a pref (per data
source), which cares for this. For 1.1, there may even be the
possibility for a hidden pref, but at the moment I am targeting this
to 2.0.
Additionally, I change the type to ENHANCEMENT, because I do not
really consider this a bug on OOo side, but a valid request for
enhancement.

> It would help tremendoulsy if it might be possible to save at least
> querys. Now you can change the displaydataype to number, but that
> gets lost after closing the dialog. Getting keys displayed as
> currency is really confusing.

Sorry, I am not really what you mean here - if you change the column
formatting in the data source browser (not only in the data view of
the query design, this is only temporary view), then this change
should persist. And it does, to my best knowledge :) - everything else
is indeed a bug.
For the formatting not persisting in the temporary view in the query
design - well, this could probably be changed, too, but I would
consider this as another (valid :) RFE - if you really mean this, do
you mind filing one?
Comment 11 jlueters 2003-03-19 14:15:42 UTC
This case can be closed.
I can confirm that the display preferences can be saved, my fault sorry.
By the way, do you know how make a form, connecting to oracle via jdbc
writable? I get it readonly only.  
Comment 12 Frank Schönheit 2003-03-19 15:25:04 UTC
Jürgen, thanks for confirming this. I'll close the issue

> By the way, do you know how make a form, connecting to oracle via jdbc
> writable

There was an explanation about this recently in either users@dba or
dev@dba - I don't remember exactly where it was. The summary is: There
is a bug in the Oracle JDBC driver (each version has it's own bug :),
which prevents this. Sorry.
Comment 13 jlueters 2003-04-11 15:20:20 UTC
I have just filed a bug at oracle metalink concerning the jdbc
isCurrency issue.

If you give me more detailed information about the jdbc failure
concering read only access issue (test case would be good ) i will
file a additional bug against oacle jdbc (if you do not have done so).

Regards

Juergen 
Comment 14 jlueters 2003-04-20 14:05:53 UTC
Lastest news concerning the oracle-jdbc number format bug.

After some messages have been exchanged in a tar at metalink (oracle
bug tracking system) here are the results.

Oracle denies that this behaviour is a bug. They claim it is a feature
and that number und float datatypes may potentially hold currencies.
Changing that behavour may break (!) applications. Oracle tries to
prevent that.
The maintainer promised to open a enhancement request which shall
eventually lead to a reversed "isCurrency" value.

I will keep you informed about that issue.


Jürgen 
Comment 15 Frank Schönheit 2003-04-22 07:37:06 UTC
Jürgen, thanks for the update.
Sorry that I missed this one here:

> If you give me more detailed information about the jdbc failure
> concering read only access issue (test case would be good )

OOo relies on meta information about privileges returned by the
driver, and the Oracle driver does not return proper privileges for
tables owned by the user who is connected. Thus, OOo claims that such
tables are not updateable/insertable. AFAIK, this is already raised at
Oracle.
OOo will feature a (still hidden, unfortunately) possiblity to switch
off the asking for privileges - it will assume full privileges then.
Comment 16 hans_werner67 2004-02-02 12:14:30 UTC
change subcomponent to 'none'
Comment 17 marc.neumann 2004-04-28 12:47:56 UTC
Hi,

according to http://development.openoffice.org/releases/Target_Milestone.html
retarget to OOo_Later

Bye Marc
Comment 18 justinclift 2005-02-17 09:05:27 UTC
Hi guys,

Whatever happened with this?

Regards and best wishes,

Justin Clift
Comment 19 Frank Schönheit 2005-09-26 12:13:05 UTC
*** Issue 53396 has been marked as a duplicate of this issue. ***
Comment 20 Frank Schönheit 2005-09-26 12:17:20 UTC
*** Issue 54295 has been marked as a duplicate of this issue. ***
Comment 21 kaluscha 2007-08-07 15:15:05 UTC
I have the same behaviour with OOO 2.2.1 and Oracle 10g using ojdbc14.jar. 
Comment 22 ocke.janssen 2007-11-06 09:09:53 UTC
Fixed in cws dba24d
Comment 23 ocke.janssen 2007-11-12 15:59:39 UTC
Please verify. Thanks.
Comment 24 ocke.janssen 2007-11-14 08:42:31 UTC
*** Issue 83469 has been marked as a duplicate of this issue. ***
Comment 25 christoph.lukasiak 2007-11-14 12:06:42 UTC
clu->oj: like we have spoken: not to test from qa -> dev issue (has to be
veryfied by dev)
Comment 26 ocke.janssen 2007-11-14 15:13:01 UTC
@clu: How to verify
- Create a new db for Oracle JDBC
- When you ope dialog under Edit->Database->Advanced Settings, on the 2nd
tabpage you now see an additional setting "Ignore currency...". 
Comment 27 christoph.lukasiak 2007-11-19 09:25:19 UTC
verified in cws
Comment 28 christoph.lukasiak 2008-05-21 10:49:12 UTC
verified in master