Solved

Problem with fixed-length column query from Oracle

Posted on 2006-07-06
4
795 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 143

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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

617 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