Encoding and result string length

Поиск
Список
Период
Сортировка
От kumar
Тема Encoding and result string length
Дата
Msg-id 025001c41d4c$5db0bbc0$7502a8c0@hdsc.com
обсуждение исходный текст
Ответы Re: Encoding and result string length
Список pgsql-sql
Dear Friends,
 
Postgres 7.3.2 on Linux 8
 
I would like to fetch the datas from a table in a encoded format.
 
create table encodeco(c1 int4, c2 int4);
insert into encodeco values(10000, 20000);
select * from encodeco;
 
So I want to encode the data while selecting.
select encode(c1,'base64') from encodeco;

ERROR:  Function encode(integer, "unknown") does not exist
 Unable to identify a function that satisfies the given argument types
 You may need to add explicit typecasts
 
So i  tried
    select encode('c1','base64') from encodeco;
   
I got a result as
    1     YzE=
 
But this is the encoded value for 'c1' and not for the value 10000.
 
Please shed some light.
 
Also is it possible to get the encoded values with only 2 charactors, irrespective of the values of c1 ranging from 100 to 10 million
 
Thanks
Kumar
 

В списке pgsql-sql по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: SQL Standatd
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Encoding and result string length