RE: Oracle Computed column datatype
- From: "SPaquin" <spaquin@xxxxxxxxxxxxxxxx>
- Date: Mon, 15 Aug 2005 12:08:04 -0700
Hi, Kevin
Just came back from holidays.
In my last message, I described my situation. The column weight is defined
as number(5). There is a behavior difference between MS OLE DB Oracle driver
and the SQL linked server layers in treating a computed column since it is
returned as a number in the fairt case and as a character in the other case.
My issue is the following:
If I use the local MS OLE DB Oracle driver, computed columns are returned
as adNumeric. If I use a linked server connection, computed columns are
returned as adVarWChar. Why is there a difference ?
Case 1) Using local MS Oracle OLE DB driver and SQL*Net
COra.ConnectionString = "Provider=msdaora;" & _
"Data Source=ORACLE;" & _
"User Id=OracleUser;Password=OraclePassword;"
Sql = "select weight, weight/2000 tons from abc"
In the recordset returned by this query, column weight is adNumeric and
tons is adNumeric. This is what is expected and all is perfect.
Case 2) Using linked server on SQL Server DB. ORA linked server is defined
on the SQL Server.
COra.ConnectionString = "Provider=sqloledb;" & _
"Data Source=MySQLServer;" & _
"Integrated Security=SSPI"
Sql = "select * from OPENQUERY(ORA,'select weight, weight/2000 tons from
abc')"
In the recordset returned by this query, column weight is adNumeric and
tons is adVarWChar. This datatype difference is my problem.
I do not understand why the tons column is returned as character and this is
causing my apps to fail when converting the value on computers where the
decimal separator is a comma. I want to know what is the logic behind this
conversion of numeric to char. Is there anything I can do to correct this
behavior ?
TIA
SP
"Kevin Yu [MSFT]" wrote:
> Hi SP,
>
> Yes, I tried directly connecting to Oracle server which works fine. Would
> you please try to specify both precision and scale?
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>
.
- Follow-Ups:
- RE: Oracle Computed column datatype
- From: Kevin Yu [MSFT]
- RE: Oracle Computed column datatype
- Prev by Date: Rowset position cannot be restarted error
- Next by Date: Re: Rowset position cannot be restarted error
- Previous by thread: Rowset position cannot be restarted error
- Next by thread: RE: Oracle Computed column datatype
- Index(es):
Relevant Pages
|
|