RE: Oracle Computed column datatype
- From: v-kevy@xxxxxxxxxxxxxxxxxxxx (Kevin Yu [MSFT])
- Date: Fri, 22 Jul 2005 08:28:46 GMT
Hi SP,
With my further research, this seems to be a known issue.
According to Oracle documentation, on Oracle, columns defined as NUMBER are
mapped to OLEDB type DBTYPE_VARNUMERIC and not to DBTYPE_NUMERIC as columns
defined as NUMBER(p,s) are. SQL Server converts OLEDB type
DBTYPE_VARNUMERIC to Nvarchar
It occurs on both Microsoft OLEDB Provider for Oracle and Oracle OLEDB
Provider for Oracle.
Here are the workarounds:
1- compute the sum in the remote query and not in the portion of the select
statement that is executed on SQL Server:
2- change the table schema on Oracle and specify a precision and scale:
On Oracle:
create table t_38(col1 number(38,1), col2 (38,1))
insert into t_38 values(10.1, 9.9)
On SQL Server:
select col1 + col2 from oracle..SCOTT.T_38
3- Use the OLEDB provider for ODBC and then an ODBC DSN to access Oracle.
Thus you can compute the sum outside the remote query.
4- convert or cast the columns in SQL Server:
select convert(numeric(38,1), col1) + convert(numeric(38,1), col2) from
oracle..SCOTT.T_NUMBER
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
.
- Follow-Ups:
- RE: Oracle Computed column datatype
- From: SPaquin
- RE: Oracle Computed column datatype
- References:
- Oracle Computed column datatype
- From: SPaquin
- RE: Oracle Computed column datatype
- From: SPaquin
- RE: Oracle Computed column datatype
- From: Kevin Yu [MSFT]
- RE: Oracle Computed column datatype
- From: SPaquin
- Oracle Computed column datatype
- Prev by Date: IDispatch error #3149
- Next by Date: ADO.NET performance with large tables
- Previous by thread: RE: Oracle Computed column datatype
- Next by thread: RE: Oracle Computed column datatype
- Index(es):
Relevant Pages
|
|