X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 64BFE52876 for ; Thu, 2 Jun 2005 06:17:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20575-03 for ; Thu, 2 Jun 2005 09:17:53 +0000 (GMT) Received: from ausimss.pervasive.com (ausimss.pervasive.com [66.45.103.246]) by svr1.postgresql.org (Postfix) with ESMTP id 5F6CB52849 for ; Thu, 2 Jun 2005 06:17:51 -0300 (ADT) Received: from ausbayes1.aus.pervasive.com ([172.16.8.6]) by ausimss.pervasive.com with InterScan Messaging Security Suite; Thu, 02 Jun 2005 04:17:49 -0500 Received: from BLRMAIL1.aus.pervasive.com ([10.3.16.60]) by ausbayes1.aus.pervasive.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 2 Jun 2005 04:17:45 -0500 content-class: urn:content-classes:message Subject: Re: Convert int to hex MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Thu, 2 Jun 2005 14:47:40 +0530 Message-ID: <02767D4600E59A4487233B23AEF5C59922C2B8@blrmail1.aus.pervasive.com> X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] Convert int to hex Thread-Index: AcVm680BcWi+EYetR4S/psS0paI33gAaA1qQ From: "Ramakrishnan Muralidharan" To: "Fernando Grijalba" , X-OriginalArrivalTime: 02 Jun 2005 09:17:48.0011 (UTC) FILETIME=[F169B3B0:01C56753] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.054 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/63 X-Sequence-Number: 21664 Hi, You can use to_hex() function to convert integer to hexa number. I = have tried with a small example. create table testing( id int4 , sHex varchar( 20 ) ) insert into testing( id ) values( 204678 ); insert into testing( id ) values( 2076876 ); update testing set sHex =3D ( cast( to_hex( id ) as varchar( 20 ) ) ) select * from testing Id | shex -------|------ 204678 | 31f86 2076876| 1fb0cc=20 Regards, R.Muralidharan =20 -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Fernando Grijalba Sent: Thursday, June 02, 2005 2:12 AM To: pgsql-sql@postgresql.org Subject: [SQL] Convert int to hex I want to be able to change an int4 from a sequence and store it as varchar in the database as a hex number. Is this possible? Thank you, Fernando ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster