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 > how to write substing atmt in db2 udb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-09-09, 07:11
truepavan truepavan is offline
Registered User
 
Join Date: Nov 2009
Posts: 1
how to write substing atmt in db2 udb

Hi,

I have a query which dispalys the o/p of script name,path,server info etc,..But i want to extract only script name from this. The problem here is if we write any substr stmt it will mnot give result properly ,becos he parameters that o/p is displaying will vary from query to query.....


Thanks,
Pavan
db2-UDB dba
Reply With Quote
  #2 (permalink)  
Old 11-09-09, 07:23
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Do you have any example of input and the desired output ???
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 11-09-09, 12:17
Stealth_DBA Stealth_DBA is offline
Registered User
 
Join Date: May 2009
Posts: 472
truepavan, without knowing your data or a sample (as sathyaram_s asked for), I can only guess.

You may be able to use the LOCATE function to find the starting position of what you are looking for. Then you can use that as the second position of the SUBSTR function.
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