Duplication error . please help.

From: Kumar S <ps_postgres(at)yahoo(dot)com>
To: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
Cc: pgsqlnovice <pgsql-novice(at)postgresql(dot)org>
Subject: Duplication error . please help.
Date: 2005-03-09 21:02:06
Message-ID: 20050309210206.39769.qmail@web51402.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Dear group,

Looking forward to get some help form experiences
members.

BEGIN TRANSACTION;
INSERT INTO
EXPERIMENT(study_id,genechip_id,sample_id,mat_id,hyb_id,exp_aim)VALUES((SELECT
study_id from study where study_author = 'Georgantas
RW 3rd and Civin CI'),(SELECT genechip_id from
genechip where genechip_array = 'U133B'),(SELECT
sample_id FROM sample WHERE sample_name ='Human stem
cells'),(SELECT mat_id FROM material_manip where
mat_treatment_type = 'ES H1-1a'),(select hyb_id from
experiment where exp_id =
(currval('experiment_exp_id_seq'))),'In this
experiment ES H1-1a sample was used test on U133B chip
');
INSERT INTO
PLATFORM(platform_filename,platform_file_loc,exp_id)VALUES('RGeo-ESHSC-H1ES-1a-U133B','\/home\/database\/bob\/data\/es\/RGeo-ESHSC-H1ES-1a-U133\/RGeo-ESHSC-H1ES-1a-U133B',(currval('experiment_exp_id_seq')));

INSERT INTO
CEL(exp_id,platform_id,affy_x,affy_y,affy_mean,affy_stdv,affy_npixels)VALUES((currval('experiment_exp_id_seq')),(SELECT
platform_id from platform where platform_filename =
'RGeo-ESHSC-H1ES-1a-U133B'),0,0,125.0,18.8,25);

INSERT INTO
CEL(exp_id,platform_id,affy_x,affy_y,affy_mean,affy_stdv,affy_npixels)VALUES((currval('experiment_exp_id_seq')),(SELECT
platform_id from platform where platform_filename =
'RGeo-ESHSC-H1ES-1a-U133B'),1,0,7702.0,1603.0,25);

INSERT INTO
CEL(exp_id,platform_id,affy_x,affy_y,affy_mean,affy_stdv,affy_npixels)VALUES((currval('experiment_exp_id_seq')),(SELECT
platform_id from platform where platform_filename =
'RGeo-ESHSC-H1ES-1a-U133B'),2,0,121.0,23.4,30);

INSERT INTO
CEL(exp_id,platform_id,affy_x,affy_y,affy_mean,affy_stdv,affy_npixels)VALUES((currval('experiment_exp_id_seq')),(SELECT
platform_id from platform where platform_filename =
'RGeo-ESHSC-H1ES-1a-U133B'),3,0,8156.0,1584.3,25);

I get the following error, when I execute.
BEGIN
INSERT 132600251 1
INSERT 132600252 1
psql:/home/database/bob/dbsqls/torun/ESHSC-H1ES/test.sql:6:
ERROR: more than one row returned by a subquery used
as an expression
psql:/home/database/bob/dbsqls/torun/ESHSC-H1ES/test.sql:8:
ERROR: current transaction is aborted, commands
ignored until end of transaction block
psql:/home/database/bob/dbsqls/torun/ESHSC-H1ES/test.sql:10:
ERROR: current transaction is aborted, commands
ignored until end of transaction block
psql:/home/database/bob/dbsqls/torun/ESHSC-H1ES/test.sql:12:
ERROR: current transaction is aborted, commands
ignored until end of transaction block

when I removed the :
INSERT INTO
PLATFORM(platform_filename,platform_file_loc,exp_id)VALUES('RGeo-ESHSC-H1ES-1a-U133B','\/home\/database\/bob\/data\/es\/RGeo-ESHSC-H1ES-1a-U133\/RGeo-ESHSC-H1ES-1a-U133B',(currval('experiment_exp_id_seq')));

This is the result:
BEGIN
INSERT 132600246 1
INSERT 132600247 1
INSERT 132600248 1
INSERT 132600249 1
INSERT 132600250 1

Clean result.

when I uncommented insert into cel statements, the
result is this:

BEGIN
INSERT 132600244 1
INSERT 132600245 1
bob=> rollback;
ROLLBACK

Clean.

when I execture every statement I get the foollowing
error:
ERROR: more than one row returned by a subquery
ed as an expression

Can any one help suggesting a way to deal this
problem.

thank you.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Sean Davis 2005-03-09 21:35:52 Re: Duplication error . please help.
Previous Message Mitch Pirtle 2005-03-09 19:36:34 Re: Storing Documents