Solved

Problem with fixed-length column query from Oracle

Posted on 2006-07-06
4
791 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

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.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
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 setup several different housekeeping processes for a SQL Server.

734 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