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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Federated Database - Changes SQL

Status
Not open for further replies.

BrianTyler

IS-IT--Management
Jan 29, 2003
232
GB
I have a query which normally runs OK against a v8.1 UDB database, but gives wrong results when I run it against a federated database, though it points to the same physical tables.

The problem is almost certainly due to a CASE statement which contains a sub-query:
select
col_a,
case when exists
(select col_b from tabb where
tabb.col_b = col_a
and tabb.col_x in (1,2)) then 'ABC'
else 'XYZ'
end
from taba

Running against the base database, the correct rows are returned (i.e. XYZ is returned for som instances).

Running against a federated database, where taba and tabb are in the remote database, the actual SQL that is run appears to do an inner join between the tables, thus not returning any rows with XYZ.

Does this ring a bell with anyone?

Thanks

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top