Openrowset to Oracle doesnt work after upgrading to SQL Server 2005<p>Hi,</p> <p> </p> <p>I just upgraded to SQL server 2005 and some of my Openrowset to Oracle doesnt work. I found out that the issue occur with field with structure Numeric.</p> <p>The issue is not solve even when I try to cast the field to varchar. sometimes it succeeded and sometimes I get error 7320 &amp; 7321.</p> <p>I'm using Oracle connector from SQL to Oracle.</p> <p>I've 64 bit SQL Server.</p> <p>Attach the code, the Numeric field is SCORE.</p> <p> </p><font color="#0000ff" size=2> <p>select</font><font size=2> </font><font color="#808080" size=2>*</font><font size=2> </p></font><font color="#0000ff" size=2> <p>FROM</font><font size=2> </p></font><font color="#0000ff" size=2> <p>OPENROWSET</font><font color="#808080" size=2>(</font><font color="#ff0000" size=2>'ORAOLEDB.ORACLE'</font><font color="#808080" size=2>,</font><font color="#ff0000" size=2>aaaa</font><font color="#808080" size=2>;</font><font color="#ff0000" size=2>bbbb</font><font color="#808080" size=2>;</font><font color="#ff0000" size=2>cccc</font><font color="#808080" size=2>,</p></font><font color="#ff0000" size=2> <p>'SELECT AUDIT_OPRID, AUDIT_STAMP, AUDIT_ACTN,EMPLID, ACCOMPLISHMENT, MAJOR_CODE, </p> <p>CAST(SCORE AS Varchar(250))</p> <p>FROM SYSADM.PS_RTA_ACCOMPLISHM WHERE 1=2'</font><font color="#808080" size=2>)</p></font> <p> </p> <p>Anyone can advice on resolution?</p> <p> </p> <p>Thanks,</p> <p>Assaf</p>© 2009 Microsoft Corporation. All rights reserved.Fri, 12 Dec 2008 04:43:27 Z0f7623f5-468b-4584-b724-ec7c9f1acb7chttp://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#0f7623f5-468b-4584-b724-ec7c9f1acb7chttp://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#0f7623f5-468b-4584-b724-ec7c9f1acb7cAraki66http://social.msdn.microsoft.com/Profile/en-US/?user=Araki66Openrowset to Oracle doesnt work after upgrading to SQL Server 2005<p>Hi,</p> <p> </p> <p>I just upgraded to SQL server 2005 and some of my Openrowset to Oracle doesnt work. I found out that the issue occur with field with structure Numeric.</p> <p>The issue is not solve even when I try to cast the field to varchar. sometimes it succeeded and sometimes I get error 7320 &amp; 7321.</p> <p>I'm using Oracle connector from SQL to Oracle.</p> <p>I've 64 bit SQL Server.</p> <p>Attach the code, the Numeric field is SCORE.</p> <p> </p><font color="#0000ff" size=2> <p>select</font><font size=2> </font><font color="#808080" size=2>*</font><font size=2> </p></font><font color="#0000ff" size=2> <p>FROM</font><font size=2> </p></font><font color="#0000ff" size=2> <p>OPENROWSET</font><font color="#808080" size=2>(</font><font color="#ff0000" size=2>'ORAOLEDB.ORACLE'</font><font color="#808080" size=2>,</font><font color="#ff0000" size=2>aaaa</font><font color="#808080" size=2>;</font><font color="#ff0000" size=2>bbbb</font><font color="#808080" size=2>;</font><font color="#ff0000" size=2>cccc</font><font color="#808080" size=2>,</p></font><font color="#ff0000" size=2> <p>'SELECT AUDIT_OPRID, AUDIT_STAMP, AUDIT_ACTN,EMPLID, ACCOMPLISHMENT, MAJOR_CODE, </p> <p>CAST(SCORE AS Varchar(250))</p> <p>FROM SYSADM.PS_RTA_ACCOMPLISHM WHERE 1=2'</font><font color="#808080" size=2>)</p></font> <p> </p> <p>Anyone can advice on resolution?</p> <p> </p> <p>Thanks,</p> <p>Assaf</p>Thu, 28 Jun 2007 11:33:16 Z2007-06-28T11:33:16Zhttp://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#acfde255-647d-4dc2-b514-7eefc9bf24aehttp://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#acfde255-647d-4dc2-b514-7eefc9bf24aeAnton Klimov - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Anton%20Klimov%20-%20MSFTOpenrowset to Oracle doesnt work after upgrading to SQL Server 2005Do I understand you correctly that you used to have SQL Server 2000 and the same query worked?<br><br>It also might be useful if you could provide the full text of the messages you are getting.<br>Fri, 29 Jun 2007 06:55:10 Z2007-06-29T06:55:10Zhttp://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#5c15f0a2-6080-4b5a-80de-647ab6a9cb37http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#5c15f0a2-6080-4b5a-80de-647ab6a9cb37Jens K. Suessmeyer -http://social.msdn.microsoft.com/Profile/en-US/?user=Jens%20K.%20Suessmeyer%20-Openrowset to Oracle doesnt work after upgrading to SQL Server 2005<p><br>Sql Server 2005 is locked down by default.<br></p> <p>Go to Program &gt; Microsoft SQL Server 2005 &gt; Configuration Tools &gt; Surface Area Configuration &gt; Surface Area Configuration  for features &gt; AdHoc Remote Queries &gt; Enable OPENROWSET AND OPENDATASOURCE support.<br><br>Jens K. Suessmeyer.<br><br>---<br><a title="http://www.sqlserver2005.de" href="http://www.sqlserver2005.de">http://www.sqlserver2005.de</a><br>---<br><br><br></p>Fri, 29 Jun 2007 16:05:11 Z2007-06-29T16:05:11Zhttp://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#aec877e4-30d4-4b16-bc26-b8060b880125http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#aec877e4-30d4-4b16-bc26-b8060b880125Araki66http://social.msdn.microsoft.com/Profile/en-US/?user=Araki66Openrowset to Oracle doesnt work after upgrading to SQL Server 2005<p>Hi Guys,</p> <p> </p> <p>The openrowset is enabled. It was working in 2000 and not working in 2005</p> <p>Its working for other tables without fields with Numeric.</p> <p> </p> <p>here some errors i get</p> <p> </p><font size=1> <p>OLE DB provider &quot;ORAOLEDB.ORACLE&quot; for linked server &quot;(null)&quot; returned message &quot;ORA-00910: specified length too long for its datatype&quot;.</p> <p>Msg 7321, Level 16, State 2, Line 1</p> <p>An error occurred while preparing the query &quot;SELECT AUDIT_OPRID, AUDIT_STAMP, AUDIT_ACTN,EMPLID, ACCOMPLISHMENT, DT_ISSUED, MAJOR_CODE, </p> <p>CAST(SCORE AS VARCHAR(8000))</p> <p>FROM SYSADM.PS_RTA_ACCOMPLISHM WHERE 1=2&quot; for execution against OLE DB provider &quot;ORAOLEDB.ORACLE&quot; for linked server &quot;(null)&quot;. </p></font><font face=Arial size=2> <p> </p></font><font size=1> <p>Msg 7320, Level 16, State 2, Line 2</p> <p>Cannot execute the query &quot;SELECT AUDIT_OPRID, AUDIT_STAMP, AUDIT_ACTN,EMPLID, ACCOMPLISHMENT, MAJOR_CODE, </p> <p>CAST(SCORE AS numeric(38,2))</p> <p>FROM SYSADM.PS_RTA_ACCOMPLISHM WHERE 1=2&quot; against OLE DB provider &quot;ORAOLEDB.ORACLE&quot; for linked server &quot;(null)&quot;. </p></font> <p> </p> <p>Thanks,</p> <p>Assaf</p>Sat, 30 Jun 2007 17:49:31 Z2007-06-30T17:49:31Zhttp://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#3fbfe1e1-4485-443b-85ce-f7678408d8b7http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#3fbfe1e1-4485-443b-85ce-f7678408d8b7Jens K. Suessmeyer -http://social.msdn.microsoft.com/Profile/en-US/?user=Jens%20K.%20Suessmeyer%20-Openrowset to Oracle doesnt work after upgrading to SQL Server 2005WHats the range of the data ? Is there any data which has a precision of 38 ?<br><br>Jens K. Suessmeyer.<br><br>---<br><a title="http://www.sqlserver2005.de" href="http://www.sqlserver2005.de">http://www.sqlserver2005.de</a><br>---<br>Tue, 03 Jul 2007 21:20:52 Z2007-07-03T21:20:52Zhttp://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#8629d8b8-2bee-4499-99d9-90f5bd56eca0http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/0f7623f5-468b-4584-b724-ec7c9f1acb7c#8629d8b8-2bee-4499-99d9-90f5bd56eca0Araki66http://social.msdn.microsoft.com/Profile/en-US/?user=Araki66Openrowset to Oracle doesnt work after upgrading to SQL Server 2005<p>Yes,</p> <p> </p> <p>There are Numeric(38,0)</p> <p>There are Numeric (7,2)</p> <p> </p> <p>What the relation between one data type to the import of other fields in the table?</p> <p>Do I need to do cast and to what type?</p> <p> </p> <p>Assaf</p>Thu, 05 Jul 2007 20:14:42 Z2007-07-05T20:14:42Z