home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 495 of 2,288   
   Ana C. Dent to Monica Roman   
   Re: Unsigned integer to IP address?   
   06 Oct 03 10:32:01   
   
   From: anacedent@hotmail.com   
      
   Monica Roman wrote:   
   > Hello everyone,   
   > My question is how to upload an unsigned integer so that it looks like   
   > an IP address in Oracle?   
   > A Perl program captures IP addresses from a log server and puts them   
   > into a .csv file that I then sqload into Oracle. When I query the db   
   > the numbers look very different e.g., (just an example) 2423598587   
   > instead of 134.290.34.59 (this was made up, any similarity to real IP   
   > is pure coincidence).   
   > I need them to look like an IP address.   
   >   
   > Thank you much,   
   >   
   > Monica   
      
   Inside the OS an IP# is just a 32-bit integer.   
   It is typically represented in what is called "dottted-quad" notation.   
   This means that each 8-bit byte (0-255) represents one of the 4 numbers   
   displayed. So you need to "convert" the large decimal number into the   
   appropriate ONE & ZERO, group them into four 8 bits bytes & the convert   
   those four values back to decimal (Small Matter Of Programming [SMOP]).   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca