Re: [SQL] error null value in column" concat_id" violates not-null constraint

2010-11-25 Thread Pavel Stehule
Hello 2010/11/25 Ana Louro : > Hi, > I'm just beggining in PostgreSql 9.0 > > I've created a table ,like this: > > CREATE TABLE auxiliar > ( >  ano integer, >  codigodc character varying, >  id character varying, >  concat_id character varying NOT NULL, >  CONSTRAINT concat PRIMARY KEY (concat_id)

[SQL] error null value in column" concat_id" violates not-null constraint

2010-11-25 Thread Ana Louro
Hi, I'm just beggining in PostgreSql 9.0 I've created a table ,like this: CREATE TABLE auxiliar ( ano integer, codigodc character varying, id character varying, concat_id character varying NOT NULL, CONSTRAINT concat PRIMARY KEY (concat_id); Now i want to insert values on concat_id res

Re: [SQL] insert from a select

2010-11-25 Thread Trinath Somanchi
Is the query stated in the mail a working on. Can we give a query for a column name in the SELECT statement. " Select cl.pkid, cl.depart, cl.sessionid, cl.instrid, cl.classseq,*(select facility from esloc where esloc.pkid = cl.locationid) as facility*, cl.schedule from esclass cl where cl.pkid in

Re: [SQL] insert from a select

2010-11-25 Thread John Fabiani
On Thursday, November 25, 2010 04:32:57 am Carla wrote: > Sorry. I forgot some columns: > > insert into tempclass (pkid, depart, sessionid, instrid, *classeq, > facility, schedule*) > Select cl.pkid, cl.depart, cl.sessionid, cl.instrid, > cl.classseq,(select facility from esloc where esloc.pkid =

Re: [SQL] insert from a select

2010-11-25 Thread Carla
Sorry. I forgot some columns: insert into tempclass (pkid, depart, sessionid, instrid, *classeq, facility, schedule*) Select cl.pkid, cl.depart, cl.sessionid, cl.instrid, cl.classseq,(select facility from esloc where esloc.pkid = cl.locationid) as facility, cl.schedule from esclass cl where cl.pki

Re: [SQL] insert from a select

2010-11-25 Thread Carla
Try to explicit the column names. Something like: insert into tempclass (pkid, depart, sessionid, instrid) Select cl.pkid, cl.depart, cl.sessionid, cl.instrid, cl.classseq,(select facility from esloc where esloc.pkid = cl.locationid) as facility, cl.schedule from esclass cl where cl.pkid in (14507