create table with default value...

Поиск
Список
Период
Сортировка
От Frederic boucher
Тема create table with default value...
Дата
Msg-id 19991105163855.90355.qmail@hotmail.com
обсуждение исходный текст
Ответы Re: [SQL] create table with default value...
Список 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 по дате отправления:

Предыдущее
От: "Frederic boucher"
Дата:
Сообщение: Re: [SQL] Accessing other database...
Следующее
От: Stuart Rison
Дата:
Сообщение: Re: [SQL] create table with default value...