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 > Operator LIKE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-22-05, 06:09
dvtdbd dvtdbd is offline
Registered User
 
Join Date: Feb 2005
Location: Barcelona
Posts: 42
Angry Operator LIKE



SELECT csaldos.empcode, cmaprpro.caupro
FROM csaldos
INNER JOIN cmaprpro ON csaldos.proyec LIKE cmaprpro.proyec

132 DB2 SQL error: SQLCODE: -132, SQLSTATE: 42824, SQLERRMC:
727 DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-132;42824;

Obiously, this is an illegal use of operator LIKE but, anyone could write to me an alternative way of get the same?

Reply With Quote
  #2 (permalink)  
Old 02-22-05, 06:15
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

LIKE can only be used in where cause.
Write something like:

SELECT csaldos.empcode, cmaprpro.caupro
FROM csaldos
INNER JOIN cmaprpro ON (csaldos.proyec = condition) WHERE cmaprpro.proyec LIKE condition.

Hope this helps,
Grofaty

Last edited by grofaty; 02-22-05 at 06:17.
Reply With Quote
  #3 (permalink)  
Old 02-22-05, 06:19
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
What would you like to do? LIKE or JOin?

If join:
SELECT csaldos.empcode, cmaprpro.caupro
FROM csaldos
INNER JOIN cmaprpro ON (csaldos.proyec = cmaprpro.proyec)

or

SELECT csaldos.empcode, cmaprpro.caupro
FROM csaldos, cmaprpro
WHERE csaldos.proyec = cmaprpro.proyec
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