Solved

Problem with fixed-length column query from Oracle

Posted on 2006-07-06
4
775 Views
Last Modified: 2012-06-27
Hi,
I am quering Oracle DB from SQL server as below:

SELECT sysdate,a
FROM OPENQUERY([Myserver.xp.COM],'
select sysdate,to_char(''muntasir'') as a from dual')

shows:
Server: Msg 7347, Level 16, State 1, Line 1
OLE DB provider 'MSDAORA' returned an unexpected data length for the fixed-length column '[MSDAORA].A'. The expected data length is 32, while the returned data length is 8.
OLE DB error trace [Non-interface error:  Unexpected data length returned for the column:  ProviderName='MSDAORA', TableName='[MSDAORA]', ColumnName='A', ExpectedLength='32', ReturnedLength='8'].

But ok with

SELECT sysdate,'Muntasir' as a
FROM OPENQUERY(Myserver.xp.COM],'
select sysdate  from dual')

What is the problem? Can any one please explain or help to solve it?
Thanks in  advance


0
Comment
Question by:muntasirrahman
4 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 17204675
what about this:

SELECT sysdate,a
FROM OPENQUERY([Myserver.xp.COM],'
select sysdate, ''muntasir'' as a from dual')

and this:

SELECT sysdate,a
FROM OPENQUERY([Myserver.xp.COM],'
select sysdate, cast(''muntasir'' as varchar2(20)) as a from dual')
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Dynamics crm 2011 8 45
Full Text Search string 5 33
Word Template Mail merge with vb.net 4 40
Stored procedure 23 23
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now