Thread: ERROR: INSERT has more target columns than expressions

ERROR: INSERT has more target columns than expressions

From
Kumar S
Date:
Dear Group,
 I am trying to insert data in to a single row
(although I have ~ 10K rows to fill, I am
experimenting with one row because this data is highly
inconsistent )


mtdase=> INSERT INTO cdna_exp

(cdna_SPOT,cdna_NAME,cdna_Clone_ID,cdna_Gene_Symbol,cdna_Gene_Name,cdna_Cluster_ID,cdna_Accession,cdna_Preferred_name,cdna_SUID,cdna_CH1I_MEAN,cdna_CH1D_MEDIAN,cdna_CH1I_MEDIAN,cdna_CH1_PER_SAT,cdna_CH1I_SD,cdna_CH1B_MEAN,cdna_CH1B_MEDIAN,cdna_CH1B_SD,cdna_CH1D_MEAN,cdna_CH2I_MEAN,cdna_CH2D_MEAN,cdna_CH2D_MEDIAN,cdna_CH2I_MEDIAN,cdna_CH2_PER_SAT,cdna_CH2I_SD,cdna_CH2B_MEAN,cdna_CH2B_MEDIAN,cdna_CH2B_SD,cdna_CH2BN_MEDIAN,cdna_CH2DN_MEAN,cdna_CH2IN_MEAN,cdna_CH2DN_MEDIAN,cdna_CH2IN_MEDIAN,cdna_CORR,cdna_DIAMETER,cdna_FLAG,cdna_LOG_RAT2N_MEAN,cdna_LOG_RAT2N_MEDIAN,cdna_PIX_RAT2_MEAN,cdna_PIX_RAT2_MEDIAN,cdna_PERGTBCH1I_1SD,cdna_PERGTBCH1I_2SD,cdna_PERGTBCH2I_1SD,cdna_PERGTBCH2I_2SD,cdna_RAT1_MEAN,cdna_RAT1N_MEAN,cdna_RAT2_MEAN,cdna_RAT2_MEDIAN,cdna_RAT2_SD,cdna_RAT2N_MEAN,cdna_RAT2N_MEDIAN,cdna_REGR,cdna_SUM_MEAN,cdna_SUM_MEDIAN,cdna_TOT_BPIX,cdna_TOT_SPIX,cdna_X_COORD,cdna_Y_COORD,cdna_TOP,cdna_BOT,cdna_LEFT,cdna_RIGHT,cdna_SECTOR,cdna_SECTORROW,cdna_SECTORCOL,cdna_SOURCE,cdna_
 PLATE,cd
na_PROW,cdna_PCOL,cdna_FAILED,cdna_IS_VERIFIED,cdna_IS_CONTAMINATED,cdna_LUID)
VALUES (
'9215','18491','IMAGE:267638','FLJ22004','hypothetical
protein

FLJ22004','Hs.108812','N25427',NULL,'115416','224',NULL,NULL,NULL,NULL,'289','135',NULL,'89','348','58',NULL,NULL,NULL,NULL,'390','290',NULL,'439','88','527',NULL,NULL,'0.625',NULL,'0','-0.019',NULL,NULL,'0.782','34',NULL,'23',NULL,'1.534','1.013','0.652',NULL,NULL,'0.987',NULL,'0.6',NULL,NULL,'1126','52',NULL,NULL,'960','968','996','1004','16','24','23','GF201:96(69H10):384(24P20)','24','P','20','0','Y','U');

ERROR:  INSERT has more target columns than
expressions



How is this possible I have 71 expressions and 71
values in the statement. Is there a problem that I am
not exposed to deal with.  Experts, can you please
help me.

Thank you.

Kumar.


(P.S: I really appreciate your patience and thank you
very much the kind help you people are pouring since I
embarked on making a database)



_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

Re: ERROR: INSERT has more target columns than expressions

From
Tom Lane
Date:
Kumar S <ps_postgres@yahoo.com> writes:
> ERROR:  INSERT has more target columns than expressions

> How is this possible I have 71 expressions and 71
> values in the statement.

I count 72 names in the column-names list.

            regards, tom lane

Re: ERROR: INSERT has more target columns than expressions

From
Reinhard Hnat
Date:
Am Montag, 18. Oktober 2004 16:09 schrieb Kumar S:
> Dear Group,
>  I am trying to insert data in to a single row
> (although I have ~ 10K rows to fill, I am
> experimenting with one row because this data is highly
> inconsistent )
>
...>dna_LEFT,cdna_RIGHT,cdna_SECTOR,cdna_SECTORROW,cdna_SECTORCOL,cdna_SOURCE,cd
>na_ PLATE,cd
> na_PROW,cdna_PCOL,cdna_FAILED,cdna_IS_VERIFIED,cdna_IS_CONTAMINATED,cdna_LU
>ID) VALUES (
> '9215','18491','IMAGE:267638','FLJ22004','hypothetical

I am not shure if the linebreaks are as shown in your posting. Sometimes I
have experienced that editors automatically add linebreaks in sql statements
which lead to some trouble. So bring columnname 'cdna_PROW' for example on
the same line and add blanks after each komma to allow automatic linebreaks
on positions where they can't do any harm.
--
r.hnat