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

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


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?

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

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

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

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