Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

New to MySQL and getting an error on OpenSource SQL query from SQL 2000

Posted on 2008-06-20
7
Medium Priority
?
639 Views
Last Modified: 2012-08-13
Experts:

This SQL Server 2005 script:

select * from openquery (MYREMOTEMYSQLSERVER,
'select clientid, client_status_dt from client')


Gives me this error:

OLE DB error trace [Non-interface error:  Column 'client_status_dt' (compile-time ordinal 2) of object 'select clientid, client_status_dt from client' was reported to have a DBCOLUMNFLAGS_ISNULLABLE of 0 at compile time and 32 at run time].
Msg 7356, Level 16, State 1, Line 1
OLE DB provider 'OleMySql.MySqlSource.1' supplied inconsistent metadata for a column. Metadata information was changed at execution time.

When I select certain columns such as CLIENTID which is NEVER NULL...then I get the column of data, however if I request data from a column that contains NULLS...I get the above error.

What can I do to prevent the error and get my data?

I'm using MS SQL Server 2005 on SQL 2000 DBs accessing....MySQL on a UNUNTU LINUX box. I do have access to the LINUX server using MySQL SQL Browser,...however I was just trying to see if I can get data returned from my MS SQL SERVER Management Studio program.

thanks
M
0
Comment
Question by:MIKE
  • 4
  • 3
7 Comments
 
LVL 4

Expert Comment

by:zx10r
ID: 21832560
check this thread out http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_20856262.html

Also, make sure you are using the latest OLE DB driver for MySQL
0
 
LVL 17

Author Comment

by:MIKE
ID: 21832655
How...where...can I get the latest OLE DB driver for MySQL..?
0
 
LVL 4

Expert Comment

by:zx10r
ID: 21832763
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
LVL 17

Author Comment

by:MIKE
ID: 21832860
Isn't there a way to tell the query to place a blank or a ZERO or something in the field...IF...the field is NULL..??

In SQL Server it is this:

isnull({fieldname},0)

What is this in MySQL...?
0
 
LVL 4

Accepted Solution

by:
zx10r earned 2000 total points
ID: 21832954
use COALSCE

COALESCE(test, 'test is null')
0
 
LVL 17

Author Closing Comment

by:MIKE
ID: 31469211
amazing...Coalesce works totally different in SQL Server...but this worked fine in MySQL...
0
 
LVL 4

Expert Comment

by:zx10r
ID: 21833169
I know, funny how that works.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month11 days, 6 hours left to enroll

886 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