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 Statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-11-04, 23:52
thanat thanat is offline
Registered User
 
Join Date: Feb 2004
Posts: 10
Unhappy SQL Statement

SELECT [MONTH_ID] & 'X' AS Expr1
FROM DT_MONTH;
A result above it
200301X
A result is MS ACCESS

how can i do with DB2 Same a result above
Reply With Quote
  #2 (permalink)  
Old 02-12-04, 01:11
thanat thanat is offline
Registered User
 
Join Date: Feb 2004
Posts: 10
More Detail

SELECT [Coumn] & 'THIS IS STRING'
FROM X
This case to add string to Feild Data of Microsoft Access

What SQL Startment to do IN DB2 SQL

Please help me
Reply With Quote
  #3 (permalink)  
Old 02-12-04, 01:43
cgprakash cgprakash is offline
Registered User
 
Join Date: Feb 2002
Posts: 96
Try this.

SELECT MONTH_ID||'X' AS Expr1 FROM DT_MONTH;
Reply With Quote
  #4 (permalink)  
Old 02-12-04, 02:41
thanat thanat is offline
Registered User
 
Join Date: Feb 2004
Posts: 10
CAN NOT

Error: [IBM][CLI Driver][DB2/NT] SQL0440N No function by the name "||" having compatible arguments was found in the function path. SQLSTATE=42884
Reply With Quote
  #5 (permalink)  
Old 02-12-04, 03:06
cgprakash cgprakash is offline
Registered User
 
Join Date: Feb 2002
Posts: 96
Try this.
SELECT MONTH_ID concat 'X' AS Expr1 FROM DT_MONTH;
Reply With Quote
  #6 (permalink)  
Old 02-12-04, 03:39
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

The MONTH_ID is probably not character type field. So you shout convert non_character type to charater type because only character types can be concatenated.

Please try:
SELECT CHAR(MONTH_ID) CONCAT 'X' AS Expr1 FROM DT_MONTH;

Hope this works,
Grofaty
Reply With Quote
  #7 (permalink)  
Old 02-12-04, 03:57
thanat thanat is offline
Registered User
 
Join Date: Feb 2004
Posts: 10
EXCELLENT MAN

Thank you verymuch
i' just to learn DB2 and just to know to convert the feild before concat anything
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