CREATE TABLE

Поиск
Список
Период
Сортировка
Искать

CREATE TABLE

От:
Ingrith Andrea Correa Vargas <i-correa@uniandes.edu.co>
Дата:

Hello!

I have a question:

I want to create a table with a column wich will have a DEFAULT
user-function value.
Can you write an example, with the right syntax?!

I have been making some examples, but I always have a syntax error that I
can't solve.

Thank you in advance, and I'll be waiting for a response!



// Ingrith :)


Re: [SQL] CREATE TABLE

От:
Remigiusz Sokolowski <rems@gdansk.sprint.pl>
Дата:
> 
> I want to create a table with a column wich will have a DEFAULT
> user-function value.
> Can you write an example, with the right syntax?!
> 
> I have been making some examples, but I always have a syntax error that I
> can't solve.
> 
> Thank you in advance, and I'll be waiting for a response!

It could be something like:
create table test(
test_id int4 default nextval('test_seq'),
test_txt text
);
	Regards
	Rem

-------------------------------------------------------------------*------------
Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *		
-----------------------------------------------------------------*****----------

Re: [SQL] CREATE TABLE

От:
David Martinez Cuevas <david@estadistica.unam.mx>
Дата:
On Thu, 25 Feb 1999, Ingrith Andrea Correa Vargas wrote:

> 
> Hello!

Hola Ingrith

> 
> I have a question:
> 
> I want to create a table with a column wich will have a DEFAULT
> user-function value.
> Can you write an example, with the right syntax?!
> 
> I have been making some examples, but I always have a syntax error that I
> can't solve.
> 
> Thank you in advance, and I'll be waiting for a response!

This an example of what you want
create sequence seq_master;
create table master ( id int default (nextval('seq_master')));

Obviously, 'nextval' is not a user defined function, but i guess you can
use one of yours.

NOTICE: I'm using PGSQL 6.3-2

Suerte.


David Martinez Cuevas	   
     Office 622-60-72      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     Home 565-25-17          "Eat Linux, Drink Linux...  SMOKE LINUX "
                           @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   



FAQ