473,396 Members | 2,154 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,396 software developers and data experts.

Migrating from SQL Server

I'm migrating a huge application wrote for sql server, this software
offers the option for al user to write their own reports. The report
editor was developed many years ago, and it uses the TransactSQL
native syntax for LEFT OUTER JOINS (*=).
The problem is, that syntax obtains diferents data sets than the ANSI
form (FROM T1 LEFT OUTER JOIN T2).

Sample:
Consider that the t3.c column does not contains the 999 value

When execute this sentence:

Select * from T1, T2 LEFT OUTER JOIN T3 ON T2.C = T3.C where T1.B =
T2.B and t3.c = 999

You will obtain
A B C B C D
C D E
----------- ----------- ----------- ----------- -----------
----------- ----------- ----------- -----------

(0 row(s) affected)

but, if you write it in the native transactsql syntax:

Select * from T1,T2,T3 where T1.B=T2.B and T2.C*=T3.C and t3.c = 999

you will obtain

A B C B C D
C D E
----------- ----------- ----------- ----------- -----------
----------- ----------- ----------- -----------
1 1 1 1 1 1
NULL NULL NULL
2 2 2 2 2 2
NULL NULL NULL

(2 row(s) affected)

So there is an inconsitency in the data set, but i HAVE to preserve
this behavior.

Have anyone any idea on what i have to do on DB2 to obtain the same
result?

Thanks
Nov 12 '05 #1
1 1927
pa***@cine.com (Pablo Etcheverry) wrote in message:
I'm migrating a huge application wrote for sql server, this software
offers the option for al user to write their own reports. The report
editor was developed many years ago, and it uses the TransactSQL
native syntax for LEFT OUTER JOINS (*=).
The problem is, that syntax obtains diferents data sets than the ANSI
form (FROM T1 LEFT OUTER JOIN T2).

Sample:
Consider that the t3.c column does not contains the 999 value

When execute this sentence:

Select * from T1, T2 LEFT OUTER JOIN T3 ON T2.C = T3.C where T1.B =
T2.B and t3.c = 999

You will obtain
A B C B C D
C D E
----------- ----------- ----------- ----------- -----------
----------- ----------- ----------- -----------

(0 row(s) affected)

but, if you write it in the native transactsql syntax:

Select * from T1,T2,T3 where T1.B=T2.B and T2.C*=T3.C and t3.c = 999

you will obtain

A B C B C D
C D E
----------- ----------- ----------- ----------- -----------
----------- ----------- ----------- -----------
1 1 1 1 1 1
NULL NULL NULL
2 2 2 2 2 2
NULL NULL NULL

(2 row(s) affected)

You should warite predicate "t3.c = 999" in ON clause. Like this:
Select *
from T1
, T2
LEFT OUTER JOIN
T3
ON T2.C = T3.C
and t3.c = 999
where T1.B = T2.B

Reason:
If you wrote the predicate in WHERE clause, the condition will be
applied for JOINed result.
For your sample:
After JOINed tables you will get 2 rows with t3.c IS NULL.
Predicate "t3.c = 999" will be applied for this result. Both rows
couldn't satisfy the condition, then they will be removed from the
final result.
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: steve | last post by:
I am having huge problems migrating large db’s from one server to another. I use phpmyadmin to dump the data into a file, and then migrate it to my production server. Then I try to use this:...
2
by: Serdar Yegulalp | last post by:
I'm in the process of migrating a lot of data (millions of rows, 4GB+ of data) from an older SQL Server 7.0 database to a new SQL Server 2000 machine. Time is not of the essence; my main concern...
2
by: lcifers | last post by:
First off, sorry if my cross posting offends anyone. I'm posting this in Access and SQL Server groups - not sure which one is appropriate. I have a relatively simple ASP.NET/VB.NET application...
10
by: JDS | last post by:
Hi all. I don't know if this is possible, and if it is, whether it needs to be done within Apache configuration or PHP configuration, but here goes: I am migrating my web server to another...
3
by: BobRoyAce | last post by:
I would really appreciate recommendations for sources of materials on migrating ASP applications to ASP.NET (books, URL's, etc.). Also, is there a magazine that is particularly good for .NET stuff....
4
by: Collin Peters | last post by:
I have searched the Internet... but haven't found much relating to this. I am wondering on what the best practices are for migrating a developmemnt database to a release database. Here is the...
0
by: wingtong | last post by:
Our Deltek accounting software will be migrating from a Jet database to a SQL express database. In the past, when using the Jet database, I have been able to make a copy of the JET database to my...
13
by: Matt Fielder | last post by:
First off, if this is better posted in another group that qualifies as a manged group, please let me know. I currently have an application written in VB.Net using MSDE as the database. Current...
0
by: chowdhp | last post by:
Hi, I am trying to migrate our server MSSQL2000 to MSSQL2005 and getting the following errors. 1. When I tried to restore the Master DB in the test server(single user mode) from a backup file...
64
by: John | last post by:
Hello there, Im cursing my place of employment...and its taken me a month to realise it... The scenario: Ive just stepped into a role to migrate an access database to VB.Net. The access...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.