Results 1 to 3 of 3
  1. #1
    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

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,009
    Maybe, if you explain what something like "left(act_no, 5)" does.

  3. #3
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •