Solved

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

Posted on 2008-06-20
7
624 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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 500 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

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

11 Experts available now in Live!

Get 1:1 Help Now