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 > Truncating a input

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-20-04, 20:51
melb melb is offline
Registered User
 
Join Date: Aug 2003
Location: AUS
Posts: 26
Truncating a input

Hi all,
I want to insert a value which is 15 charcter in length to a variable which is only 10 charcter in length.

eg: name Character(10) = 'abcdefghijklmn'.

I just want only the first 10 letters to be inserted in to name. is there any truncate function. please let me know.

cheers
melb
Reply With Quote
  #2 (permalink)  
Old 05-21-04, 07:01
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Arrow

Yes there is

substr(myvariable,1,10)

but please see the sql reference, or the topmost
posts in this forum

BOW
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
Reply With Quote
  #3 (permalink)  
Old 05-24-04, 00:48
melb melb is offline
Registered User
 
Join Date: Aug 2003
Location: AUS
Posts: 26
thanks Kristian K. Hansen
it worked

cheers
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