Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    11

    Unanswered: IP address formats

    Hello,

    I'm very new to Oracle.
    I have IP addresses stored in database as varchars. Now I want to do operations with ranges. How do I convert the string representations of ip addresses to numeric format?

    Thanks,
    Rovshan

  2. #2
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    see the oracle sql manual at

    http://download-west.oracle.com/docs...a96540/toc.htm

    use the instr function to find the position of the full stops
    and then use substr to extract the number,
    then use to_number to convert to a number i.e.

    select to_number(substr('10.1.1.99',instr('10.1.1.99','.' ,1)+1, instr('10.1.1.99','.',2)-1)) from dual

Posting Permissions

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