query ... returned 4 columns - Mailing list pgsql-general

From Sorin Schwimmer
Subject query ... returned 4 columns
Date
Msg-id 575461.48561.qm@web56008.mail.re3.yahoo.com
Whole thread Raw
Responses Re: query ... returned 4 columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: query ... returned 4 columns  (Richard Huxton <dev@archonet.com>)
List pgsql-general
Hi All,

I'm trying to write a stored PLPG/SQL procedure:

CREATE OR REPLACE FUNCTION
arch_expected_stuff(CHAR(12)) RETURNS VOID
AS $$
  -- Archives expected_stuff
  -- takes packing slip
  DECLARE
    o expected_stuff%ROWTYPE;
  BEGIN
    o:= * FROM expected_stuff WHERE packslip=$1; --
LIMIT 1;
    INSERT INTO archive.expected_stuff VALUES (o);
    DELETE FROM expected_stuff WHERE packslip=$1;
  END;
$$ LANGUAGE PLPGSQL;


When I issue a

select arch_expected_stuff('246');

I receive the following error:ERROR:  query "SELECT  *
FROM expected_stuff WHERE packslip= $1  LIMIT 1"
returned 4 columns
CONTEXT:  PL/pgSQL function "arch_expected_stuff" line
6 at assignment

Yes, both expected_stuff and archive.expected_stuff
have 4 columns. What is the error?

Thanks for your help,
Sorin



____________________________________________________________________________________
The fish are biting.
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php

pgsql-general by date:

Previous
From: Floyd Shackelford
Date:
Subject: foreign key support for inheritance
Next
From: "Shoaib Mir"
Date:
Subject: Re: How to use pg_resetxlog if data directory is in c:/Program Files ?