If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > sql query from Oracle to DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-27-04, 05:38
TheLastHero TheLastHero is offline
Registered User
 
Join Date: Oct 2004
Posts: 2
sql query from Oracle to DB2

I'm a beginner in DB2 and for my company I have to write a sql statement. The statement is already working in Oracle but it doens't work with DB2. Does somebody know how to make this query work?
(sleutel of key is for example "VAR_TST" and xdata.sleutel = also "VAR_TST")
select *
from xdata
where sleutel = '",sleutel of key,"'
and exists(
select * from xdata w
where w.sleutel > 0
and w.extra like '%-' || xdata.sleutel || '-%'
)

In Oracle is:
sleutel = VARCHAR2
extra = VARCHAR2

Last edited by TheLastHero; 10-27-04 at 05:54.
Reply With Quote
  #2 (permalink)  
Old 10-27-04, 09:47
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
If, as you say,
Quote:
sleutel = VARCHAR2
then how can you do this:
Quote:
where w.sleutel > 0
Reply With Quote
  #3 (permalink)  
Old 11-04-04, 06:40
TheLastHero TheLastHero is offline
Registered User
 
Join Date: Oct 2004
Posts: 2
<quote> where w.sleutel > 0 </quote>

It already works and this was one of the problems, but this does work in Oracle.

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On