473,387 Members | 1,904 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,387 software developers and data experts.

NEED HELP - Query Conversion

We're losing a Sybase datasource and need to pull from an identical DB2
database until the SQL Server becomes available later on this year. If
someone could read through the query and let me know what is wrong with it,
your assistance would be greatly appreciated. The error message I receive
is(this comes from SQL):

Package Error

Error Source: Microsoft OLE DB Provider for ODBC Drivers

Error Description: [IBM][CLI Driver][DB2] SQL0104N An unexpected token "="
was found following "". Expected tokens may include "(+-?:CASE CAST USER
<FLOAT> CURRENT <DECIMAL> <INTEGER>". SQLSTATE=42601

The lines with "=" in them include
---

Case When (AICR.VWFRSCT.MMM_GRD_SEQ Between '160' And '380' ) and
AICR.VWFRSCT.MMM_HOME_COUNTRY = 'US'
---

WHERE
AICR.VWFRSCT.ORG_CODE is not Null and
AICR.VWFRSCT.DIV_CODE *=AICR.VTGROUP_DIV.DIV_CODE and
AICR.VWFRSCT.MARKET_CODE *=AICR.VTMARKET_GROUP.MARKET_CODE and
AICR.VWFRSCT.BUSINESS_UNIT *=AICR.VTBUSS_UNIT.BUSS_UNIT_CODE

---

TIA,

Michael Randall
mr******@mmm.com
Nov 12 '05 #1
1 2368
don't know much, but it has a left outer join in it. *= does not mean
anything in DB2. you need to convert it to:

from table a left outer join table b on a.pk=b.fk

I have not been very thoroughly from your query, but maybe it requires
a 'nested left outer join' like:

from table a left outer join table b on a.pk=b.fk left outer join
table c on a.pk=c.fk

hth,
dotyet
"MK Randall" <mr******@mmm.com> wrote in message news:<bo**********@tuvok3.mmm.com>...
We're losing a Sybase datasource and need to pull from an identical DB2
database until the SQL Server becomes available later on this year. If
someone could read through the query and let me know what is wrong with it,
your assistance would be greatly appreciated. The error message I receive
is(this comes from SQL):

Package Error

Error Source: Microsoft OLE DB Provider for ODBC Drivers

Error Description: [IBM][CLI Driver][DB2] SQL0104N An unexpected token "="
was found following "". Expected tokens may include "(+-?:CASE CAST USER
<FLOAT> CURRENT <DECIMAL> <INTEGER>". SQLSTATE=42601

The lines with "=" in them include
---

Case When (AICR.VWFRSCT.MMM_GRD_SEQ Between '160' And '380' ) and
AICR.VWFRSCT.MMM_HOME_COUNTRY = 'US'
---

WHERE
AICR.VWFRSCT.ORG_CODE is not Null and
AICR.VWFRSCT.DIV_CODE *=AICR.VTGROUP_DIV.DIV_CODE and
AICR.VWFRSCT.MARKET_CODE *=AICR.VTMARKET_GROUP.MARKET_CODE and
AICR.VWFRSCT.BUSINESS_UNIT *=AICR.VTBUSS_UNIT.BUSS_UNIT_CODE

---

TIA,

Michael Randall
mr******@mmm.com

Nov 12 '05 #2

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

Similar topics

24
by: jason | last post by:
Hi Ray...a while ago you explained an elegant solution to enable me to CREATE and EDIT existing tables and queries inside my online access 2000 database.... could you provide refresher links on...
3
by: Philip Yale | last post by:
A colleague of mine has a query which fails to run under SQLAgent batch with the following error: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime...
7
by: Thomi Baechler | last post by:
Hello Everybody I run the following query against to identical databases. Execution time on the first DB is 0 seconds, on the other 6 seconds! SELECT dbo.HRMABZ.EMPKEY ,...
1
by: gary.scott | last post by:
Aaaaaarrgghh ! (that's better) I am trying to convert a field within my Oracle 9i Database that is of type BLOB (but this BLOB may contain a combination of clobs/varchars or images such as gif...
2
by: sal cifone | last post by:
Hello, I am trying to use access vba instead of running an unmatched query. I want to compare two tables and if there is a new sales office in "Commissions" table that is not in the "Conversion"...
1
by: Riley DeWiley | last post by:
I have an UPDATE query that is always setting 0 records. When I cut and paste the SQL into Access and use it, it fails in the same way unless I coerce the date fields to be '=now()', in which case...
2
by: Luke.Schollmeyer | last post by:
I found an unusual problem between 2000 and 2005 I haven't been able to decipher from any documentation. The query structure is as follows: select * from tableA a join tableB b ON...
2
by: Reedsp | last post by:
OS: MS XP Access version: 2003 SP2 I am trying to use an update query to replace quote marks with nothing. In essence, I'm removing quote marks. I get a error message when a field is empty or...
7
by: bruce.dodds | last post by:
Access seems to be handling a date string conversion inconsistently in an append query. The query converts a YYYYMM string into a date, using the following function: CDate(Right(,2) & "/1/" &...
2
by: dvelst | last post by:
Hi All, I have the following query which was based on a working query in MySQL: (don't be afraid of the size of the query you see below, later on I will concentrate on part of this query) ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.