agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: anand086 <anand086@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Hex to Number conversion
Date: Sat, 26 Aug 2017 22:28:59 -0700 (MST)
Message-ID: <1503811739437-5980300.post@n3.nabble.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

Hi,

We have a Oracle system were the hex characters are converted to number
using TO_NUMBER function, like below.

sql> select to_number('cd08cfba70ede0a2','xxxxxxxxxxxxxxxx') from dual;

  TO_NUMBER('CD08CFBA70EDE0A2','XXXXXXXXXXXXXXXX')
--------------------------------------------------
			      14774286977254416546


How can I achieve the same in postgres.

# select to_number('cd08cfba70ede0a2','xxxxxxxxxxxxxxxx');
ERROR:  invalid input syntax for type numeric: " "
Time: 142.581 ms

Regards,
Anand



--
View this message in context: http://www.postgresql-archive.org/Hex-to-Number-conversion-tp5980300.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (3+ messages)  latest in thread

Message-ID: <1503811739437-5980300.post@n3.nabble.com>
Permalink:  ../1503811739437-5980300.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1503811739437-5980300.post@n3.nabble.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: anand086@gmail.com
  Subject: Re: Hex to Number conversion
  In-Reply-To: <1503811739437-5980300.post@n3.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox