Table with differerent Data Types

Started by xaviergxfabout 18 years ago3 messagesgeneral
Jump to latest
#1xaviergxf
xaviergxf@gmail.com

Hi,

I´m trying to do the follow: create a table like:
create table t(
cod serial,
data_type char(10),
value ???
);

I would like to do the follow the table would tell me what data type
its the value. For instance:

insert into t values(1, 'Integer', 12);
insert into t values(2, 'String', 'test');
insert into t values(3, 'Float', 1.23);

How can i do that? Its that possible? How Can i solve this problem?

Thanks a lot

#2Klint Gore
kgore4@une.edu.au
In reply to: xaviergxf (#1)
Re: Table with differerent Data Types

xaviergxf wrote:

Hi,

I�m trying to do the follow: create a table like:
create table t(
cod serial,
data_type char(10),
value ???
);

I would like to do the follow the table would tell me what data type
its the value. For instance:

insert into t values(1, 'Integer', 12);
insert into t values(2, 'String', 'test');
insert into t values(3, 'Float', 1.23);

How can i do that? Its that possible? How Can i solve this problem?

see http://www.varlena.com/varlena/GeneralBits/110.php

klint.

--
Klint Gore
Database Manager
Sheep CRC
A.G.B.U.
University of New England
Armidale NSW 2350

Ph: 02 6773 3789
Fax: 02 6773 3266
EMail: kgore4@une.edu.au

#3xaviergxf
xaviergxf@gmail.com
In reply to: xaviergxf (#1)
Re: Table with differerent Data Types

hi, i haven´t found the explication about my problem...

Show quoted text

On 24 abr, 03:04, kgo...@une.edu.au (Klint Gore) wrote:

xaviergxf wrote:

Hi,

   I´m trying to do the follow: create a table like:
create table t(
  cod serial,
  data_type char(10),
  value ???
);

I would like to do the follow the table would tell me what data type
its the value. For instance:

insert into t values(1, 'Integer', 12);
insert into t values(2, 'String', 'test');
insert into t values(3, 'Float', 1.23);

How can i do that? Its that possible? How Can i solve this problem?

seehttp://www.varlena.com/varlena/GeneralBits/110.php

klint.

--
Klint Gore
Database Manager
Sheep CRC
A.G.B.U.
University of New England
Armidale NSW 2350

Ph: 02 6773 3789  
Fax: 02 6773 3266
EMail: kgo...@une.edu.au

--
Sent via pgsql-general mailing list (pgsql-gene...@postgresql.org)
To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general- Ocultar texto entre aspas -

- Mostrar texto entre aspas -