<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Decimal to hexadecimal conversion vith Oracle in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256400#M888069</link>
    <description>Oracle 9i has a function rawtohex(&lt;X&gt;) which returns the raw string x converted to hexadecimal as the following example shows:&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; select rawtohex(job_id) from jobs;&lt;BR /&gt;&lt;BR /&gt;sks&lt;/X&gt;</description>
    <pubDate>Fri, 23 Apr 2004 01:17:55 GMT</pubDate>
    <dc:creator>Sanjay Kumar Suri</dc:creator>
    <dc:date>2004-04-23T01:17:55Z</dc:date>
    <item>
      <title>Decimal to hexadecimal conversion vith Oracle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256397#M888066</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;Is there a way to convert decimal value to hexadecimal within an Oracle SQL request?</description>
      <pubDate>Thu, 22 Apr 2004 07:55:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256397#M888066</guid>
      <dc:creator>Sylvain CROUET</dc:creator>
      <dc:date>2004-04-22T07:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to hexadecimal conversion vith Oracle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256398#M888067</link>
      <description>Bonjour Sylvain,&lt;BR /&gt;&lt;BR /&gt;If think there is no direct SQL function to do this.&lt;BR /&gt;&lt;BR /&gt;Take a look at :&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.revealnet.com/pipelines/plsql/archives.htm#code27" target="_blank"&gt;http://www.revealnet.com/pipelines/plsql/archives.htm#code27&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Nicolas</description>
      <pubDate>Thu, 22 Apr 2004 08:15:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256398#M888067</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2004-04-22T08:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to hexadecimal conversion vith Oracle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256399#M888068</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can get the hexadecimal value for a number by using the function TO_CHAR in SQLPLUS.&lt;BR /&gt;&lt;BR /&gt;To convert a decimal number to hexadecimal  For example, the number "123"  will be converted to "7B". &lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; select to_char(123,'XXX') from dual &lt;BR /&gt; &lt;BR /&gt;output  :  7B&lt;BR /&gt;&lt;BR /&gt;You must ensure that your format string is as large as the biggest value you will need to convert, but this is a built-in feature.&lt;BR /&gt;&lt;BR /&gt;Or you can write a PLSQL package to define your own function for the conversion. Eg:- below.&lt;BR /&gt;&lt;BR /&gt;FUNCTION dec_to_hex (decin IN NUMBER) RETURN VARCHAR2 IS &lt;BR /&gt;  v_decin NUMBER; &lt;BR /&gt;  v_next_digit NUMBER; &lt;BR /&gt;  v_result varchar(2000); &lt;BR /&gt;BEGIN &lt;BR /&gt;  v_decin := decin; &lt;BR /&gt;  WHILE v_decin &amp;gt; 0 LOOP &lt;BR /&gt;    v_next_digit := mod(v_decin,16); &lt;BR /&gt;    IF v_next_digit &amp;gt; 9 THEN &lt;BR /&gt;      IF v_next_digit = 10 THEN v_result := 'A' || v_result; &lt;BR /&gt;      ELSIF v_next_digit = 11 THEN v_result := 'B' || v_result; &lt;BR /&gt;      ELSIF v_next_digit = 12 THEN v_result := 'C' || v_result; &lt;BR /&gt;      ELSIF v_next_digit = 13 THEN v_result := 'D' || v_result; &lt;BR /&gt;      ELSIF v_next_digit = 14 THEN v_result := 'E' || v_result; &lt;BR /&gt;      ELSIF v_next_digit = 15 THEN v_result := 'F' || v_result; &lt;BR /&gt;      ELSE raise_application_error(-20600,'Untrapped exception'); &lt;BR /&gt;      END IF; &lt;BR /&gt;    ELSE &lt;BR /&gt;      v_result := to_char(v_next_digit) || v_result; &lt;BR /&gt;    END IF; &lt;BR /&gt;    v_decin := floor(v_decin / 16); &lt;BR /&gt;  END LOOP; &lt;BR /&gt;  RETURN v_result; &lt;BR /&gt;END dec_to_hex; &lt;BR /&gt; &lt;BR /&gt;      v_return := v_return + TO_NUMBER(v_charval) * POWER(2,v_power); &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I hope this helps.&lt;BR /&gt;&lt;BR /&gt;Indira A&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Apr 2004 00:56:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256399#M888068</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2004-04-23T00:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to hexadecimal conversion vith Oracle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256400#M888069</link>
      <description>Oracle 9i has a function rawtohex(&lt;X&gt;) which returns the raw string x converted to hexadecimal as the following example shows:&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; select rawtohex(job_id) from jobs;&lt;BR /&gt;&lt;BR /&gt;sks&lt;/X&gt;</description>
      <pubDate>Fri, 23 Apr 2004 01:17:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256400#M888069</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-04-23T01:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to hexadecimal conversion vith Oracle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256401#M888070</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;In 8i (8.1) and up, it is simply:&lt;BR /&gt; select to_char( number, 'xxxxxxx' ) from t;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps too!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Fri, 23 Apr 2004 06:02:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256401#M888070</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-04-23T06:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to hexadecimal conversion vith Oracle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256402#M888071</link>
      <description>Well, this Oracle function seem not to work in my case:&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; select ip_address, to_char(ip_address, 'XXXXX') from opc_node_names where node_name like 'cexi01%';&lt;BR /&gt;&lt;BR /&gt;IP_ADDRESS TO_CHA&lt;BR /&gt;---------- ------&lt;BR /&gt; 957054740 ######&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; select ip_address, rawtohex(ip_address) from opc_node_names where node_name like 'cexi01%';&lt;BR /&gt;&lt;BR /&gt;IP_ADDRESS RAWTOHEX(IP_ADDRESS)&lt;BR /&gt;---------- --------------------------------------------&lt;BR /&gt; 957054740 C50A3A063029&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IP_ADDRESS's type is NUMBER(12)</description>
      <pubDate>Fri, 23 Apr 2004 07:14:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256402#M888071</guid>
      <dc:creator>Sylvain CROUET</dc:creator>
      <dc:date>2004-04-23T07:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to hexadecimal conversion vith Oracle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256403#M888072</link>
      <description>Does it work with on X for every figure ?&lt;BR /&gt;&lt;BR /&gt;select to_char(957054740,'XXXXXXXXX') from dual;&lt;BR /&gt;&lt;BR /&gt;TO_CHAR(95&lt;BR /&gt;----------&lt;BR /&gt;  390B7F14&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Nicolas</description>
      <pubDate>Fri, 23 Apr 2004 07:33:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/decimal-to-hexadecimal-conversion-vith-oracle/m-p/3256403#M888072</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2004-04-23T07:33:55Z</dc:date>
    </item>
  </channel>
</rss>

