Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Heterogeneous queries 1

Status
Not open for further replies.

dvfilho

Programmer
Feb 26, 2003
1
BR
Hi,

I'm trying to retrieve data from two different database servers using BDE ( see example below ).

Select A.VENDORNO, B.VENDORNO
From ":DBDEMOS:VENDORS" A, ":IBLOCAL:VENDORS" B
where A.VENDORNO = B.VENDORNO

The query above works fine unless the columns named VENDORNO are of different datatypes in tables A and B ( suppose integer in table A and varchar in table B ).

The problem is that you cannot use any specific function of the database servers (like TO_CHAR in Oracle) to match the types in two tables. Then, the error returned in this case is "type mismatch".

Any ideas to solve this problem ?

Thanks.
 
Try this (not sure if it'd work though):
Code:
Select A.VENDORNO, B.VENDORNO
From ":DBDEMOS:VENDORS" A, ":IBLOCAL:VENDORS" B
WHERE (CAST(A.VENDORNO AS VARCHAR) = B.VENDORNO)
HTH

--- markus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top