October 24th, 2002, 02:23 PM
Primary Key useage
Hi all. I've built the following table:
but when I try to execute the following insert statement:
CREATE TABLE wms_users (user_id int4 PRIMARY KEY,
firstname character varying(255) NOT NULL,
lastname character varying(255) NOT NULL,
username character varying(25) NOT NULL,
password character varying(32) NOT NULL,
email character varying(255) NOT NULL,
clearance integer DEFAULT 1,
answer character varying(255),
status integer DEFAULT 1 NOT NULL,
added timestamp(0) without time zone DEFAULT now() NOT NULL
I get the following error message:
insert into wms_users (firstname,lastname,username,password,email,clearance,status) values ('Debra','Bilous','debra','password','email@example.com',2,1);
ExecAppend: Fail to add null value in not null attribute user_id
I seem to remember in MySQL being able to define a column as a primary key and an insert statment as I've used above would have worked.
Can anyone tell me why I'm getting this error?
Thanks in advance,
October 24th, 2002, 03:04 PM
I already caught you back at Tek-Tips .