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 > Oracle > using left in oracle

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Sep 2004
Posts: 8
using left in oracle

hi,

i am migrating my application from sql server to oracle 8i. in a query, which was in sql server, i have used something like left(act_no,5).

this is not working in oracle 8i. please can any of you suggest me a remedy to this prob?

thanks
hetav
Reply With Quote
  #2 (permalink)  
Old
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,993
Maybe, if you explain what something like "left(act_no, 5)" does.
Reply With Quote
  #3 (permalink)  
Old
Drunkard
 
Join Date: Nov 2002
Location: Desk, slightly south of keyboard
Posts: 697
Hi,

I would suspect it returns leftmost n chars. A suitable alternative on Oracle would be substr...

substr( act_no,1,5 )

You can also experiment with these other variants (for right() etc).

substr( act_no,-2 ) -- like right(act_no,2)

substr( act_no,2 ) -- from char 2, all remaining characters

Hth
Bill
__________________
Please don't email me directly with questions. I've probably just got home from the pub and cannot guarantee the sanity of my answers. In fact, I can't believe I actually made it home.
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