473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Converting Informix OUTER statement to SQL Server

1
I'm a newb to Informix and trying to convert the following statement to SQL Server (2005). The problem is the join. From what I've been able to find, it appears that Informix outer joins are left outer joins by default, so I'm pretty sure a "LEFT OUTER JOIN" needs to be there somewhere. The problem is the rest of the join syntax. Can anyone help?

Informix query:
Expand|Select|Wrap|Line Numbers
  1. SELECT it.lnum, it.vid, it.cc 
  2. FROM it, vt, vr, OUTER hi, ac
  3. WHERE it.vid = vr.vid
  4. AND it.cc = vt.cc 
  5. AND it.lnum = hi.lnum 
  6. AND it.lnum = ac.lnum   
  7.  
table name: field names are:
it: lnum, vid, cc
vt: vid, cc
vr: vid, cc
hi: lnum
ac: lnum

Everything is straightforward except for the FROM statement.

Thanks
Jan 2 '08 #1
1 7031
ck9663
2,878 Expert 2GB
I'm a newb to Informix and trying to convert the following statement to SQL Server (2005). The problem is the join. From what I've been able to find, it appears that Informix outer joins are left outer joins by default, so I'm pretty sure a "LEFT OUTER JOIN" needs to be there somewhere. The problem is the rest of the join syntax. Can anyone help?

Informix query:
Expand|Select|Wrap|Line Numbers
  1. SELECT it.lnum, it.vid, it.cc 
  2. FROM it, vt, vr, OUTER hi, ac
  3. WHERE it.vid = vr.vid
  4. AND it.cc = vt.cc 
  5. AND it.lnum = hi.lnum 
  6. AND it.lnum = ac.lnum   
  7.  
table name: field names are:
it: lnum, vid, cc
vt: vid, cc
vr: vid, cc
hi: lnum
ac: lnum

Everything is straightforward except for the FROM statement.

Thanks
based on your query IT, VT and VR seems to be an INNER JOIN while HI and AC are LEFT JOIN. if my assumptions are correct,try this:

Expand|Select|Wrap|Line Numbers
  1. SELECT it.lnum, it.vid, it.cc 
  2. FROM it
  3. INNER JOIN vt on it.cc = vt.cc 
  4. INNER JOIN vr on it.vid = vr.vid
  5. LEFT JOIN hi on it.lnum = hi.lnum 
  6. LEFT JOIN ac on it.lnum = ac.lnum
  7.  
just a note: your columnlist does not include any columns coming from the other table. your left join will not mean anything if that's the case. your inner join will work, though...
Jan 3 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Christian Eriksson | last post by:
Hi! I'm programming Perl DBI accessing Informix databases. I have a problem on a Solaris machine to use my installed Informix driver (DBD::Informix). I get the following error message: ...
2
by: Anthony | last post by:
I have an inventory database that Im trying to create a report out of the IP address are a lookup on a seperat table but I keep getting the above error can I change the table row to something to...
4
by: Matt | last post by:
Hello. I have an Informix SQL statement that I need to run in MS SQL Server. When I try to execute it I get the following error message from Query Analyzer: Server: Msg 195, Level 15, State 10,...
10
by: Joachim Banzhaf | last post by:
Hi, Creating the federated datasource library for informix fails for me. The db2 server is version 8.1 WSE on AIX 4.3. The informix client on this server is version CSDK 2.81/ESQL 9.53 UC2....
2
by: Thomas Bean | last post by:
Hello, I'm fairly new to DB2. I am having some difficulty converting some stored procedres from Informix that use default input parameters. Specifically, the Informix procedures I need to convert...
1
by: Stefan V. | last post by:
Hello! I am trying to convert a query written for SQL Server 2000 database tables, to a MS Access query. Here is what I have in SQL Server: SELECT t2.*, CASE WHEN t2.QType = '3' THEN...
14
by: Khan | last post by:
Hello, I want to connect my intranet server (with php/apache) to the other informix database server, But I didnt it. I dont know how i can do it? Can i use php_informix extensions for example...
0
by: nguyenl | last post by:
My task is to convert this Informix SQl Script to SQL 2005, unfortunately I am not really familiar with Informix SQL. Below is an example script. I can figure out the "Select" statement and the...
4
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.