From: | anand086 <anand086(at)gmail(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Hex to Number conversion |
Date: | 2017-08-27 05:28:59 |
Message-ID: | 1503811739437-5980300.post@n3.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-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.
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Kretschmer | 2017-08-27 07:25:46 | Re: Hex to Number conversion |
Previous Message | anand086 | 2017-08-26 08:04:42 | Re: Execute format Insert sql failing with query string argument of EXECUTE is null for column with timestamp with timezone |