create table with default value... - Mailing list pgsql-sql

From Frederic boucher
Subject create table with default value...
Date
Msg-id 19991105163855.90355.qmail@hotmail.com
Whole thread Raw
Responses Re: [SQL] create table with default value...  (Stuart Rison <rison@biochemistry.ucl.ac.uk>)
List pgsql-sql
Hi,

I have a table with a Unique ID named U_ID that come from a sequence like 
that :

create table the_table( U_ID integer default NEXTVAL('THE_SEQUENCE'), ...

and I would like to have a field of type varchar that would be something 
like

create table the_table( U_ID integer default NEXTVAL('THE_SEQUENCE'), name varchar(50) default 'NT_'+itoa(U_ID)
);

so the field 'name' would be the string concatenation of "NT_" and the 
string value of the field U_ID.

Is there a way to do this?

Thanks for your precious help!  ;)

\fb

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


pgsql-sql by date:

Previous
From: "Frederic boucher"
Date:
Subject: Re: [SQL] Accessing other database...
Next
From: Stuart Rison
Date:
Subject: Re: [SQL] create table with default value...