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

Problem with IN predicate

I have a query in Oracle like this:
Select 1 from dual
where
(1,1) IN ( (1,1), (2,1) )

and want to convert it to DB2.
I tried this query:
Select 1 from sysibm.sysdummy1
where
(1,1) IN ( (1,1), (2,1) )
I replaced "," with SPACE and ";" but got error.

It will be appreciated to help me to solve this problem.
Best,

Jul 13 '08 #1
4 1412
On Jul 13, 3:13 pm, amir <ahsha...@gmail.comwrote:
I have a query in Oracle like this:
Select 1 from dual
where
(1,1) IN ( (1,1), (2,1) )

and want to convert it to DB2.
I tried this query:
Select 1 from sysibm.sysdummy1
where
(1,1) IN ( (1,1), (2,1) )
I replaced "," with SPACE and ";" but got error.

It will be appreciated to help me to solve this problem.
Best,
I assume that your real query is different and that this is just an
example? Anyhow, try:

select 1 from sysibm.sysdummy1 where (1,1) IN ( values (1,1), (2,1) )

/Lennart
Jul 13 '08 #2
I assume that your real query is different and that this is just an
example? Anyhow, try:
Exactly!
select 1 from sysibm.sysdummy1 where (1,1) IN ( values (1,1), (2,1) )
I tried this but got error like before:
<<SQL0104N An unexpected token "," was found following "+ ) -".
Expected tokens may include: "". SQLSTATE=42601>>
Jul 15 '08 #3
On Jul 15, 7:28 am, amir <ahsha...@gmail.comwrote:
I assume that your real query is different and that this is just an
example? Anyhow, try:
Exactly!
select 1 from sysibm.sysdummy1 where (1,1) IN ( values (1,1), (2,1) )

I tried this but got error like before:
<<SQL0104N An unexpected token "," was found following "+ ) -".
Expected tokens may include: "". SQLSTATE=42601>>
Which platform and version?
/Lennart
Jul 15 '08 #4
On Jul 15, 12:22*pm, Lennart <Erik.Lennart.Jons...@gmail.comwrote:
On Jul 15, 7:28 am, amir <ahsha...@gmail.comwrote:
I assume that your real query is different and that this is just an
example? Anyhow, try:
Exactly!
select 1 from sysibm.sysdummy1 where (1,1) IN ( values (1,1), (2,1) )
I tried this but got error like before:
<<SQL0104N An unexpected token "," was found following "+ ) -".
Expected tokens may include: "". SQLSTATE=42601>>

Which platform and version?

/Lennart
I am connecting directly to DB2 7 Client Command Center
Jul 19 '08 #5

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

Similar topics

5
by: matthias_k | last post by:
Hi, I need to sort elements of a std::list using a function predicate, something like: bool predicate( const& M m1, const& M m2 ) { return m1.somedata < m2.somedata; } I tried to call...
15
by: Hemant Shah | last post by:
Folks, We have an SQL statement that was coded in an application many years ago (starting with DB V2 I think). When I upgraded to UDB 8.2, the optimizer does not use optimal path to access the...
15
by: Andrew Maclean | last post by:
I guess this problem can be distilled down to: How do I search through a string, find the first matching substring, replace it, and continue through the string doing this. Can replace_if() be used...
18
by: jslowery | last post by:
I am not completely knowledgable about the status of lexical scoping in Python, but it was my understanding that this was added in a long time ago around python2.1-python2.2 I am using python2.4...
5
by: Andrew Robinson | last post by:
Any easy answer what is wrong here? private List<string> BodyWords = new List<string>(); string word = "Andrew"; the following causes a compilation error:
9
by: Tony | last post by:
I have an operator== overload that compares two items and returns a new class as the result of the comparison (instead of the normal bool) I then get an ambiguous operater compile error when I...
8
by: Jeff S. | last post by:
I was recently advised: << Use List<struct> and Find() using different Predicate delegates for your different search needs.>> What is "Predicate delegate" as used in the above recommendation? ...
16
by: shapper | last post by:
Hello, I have a generic list as follows: Dim rows As New Generic.List(Of row) Now I have a row: Dim myRow As row I tried to check, further in my code, if the row is nothing: If myRow Is...
5
by: Ganesh | last post by:
hi ! Can the predicate function used in std::sort take optional arguments ? For instance. I have a class Point. I create a vector of this and then want to compare the slopes of these points with...
8
by: thomas | last post by:
priority_queue usually uses the greater<intpredicate function. But as you know, we don't always use priority_queue<int>. Actually we may need the "priority_queue<pair<int,int>,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.