Search Postgresql Archives

Re: Giving error for function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sachin Srivastava <ssr.teleatlas@xxxxxxxxx> writes:
> I am getting the below error while I am running the below function
> "add_po_doc_hist", for "c_company" cursor, please suggest what is wrong
> with code.
> ERROR:  relation "c_company" does not exist
> CONTEXT:  compilation of PL/pgSQL function "add_po_doc_hist" near line 11

> CREATE OR REPLACE FUNCTION add_po_doc_hist(subscriberid bigint)
>   RETURNS void AS
> $BODY$
> DECLARE
> --Select All Companies for the subscriber entered
> c_company CURSOR FOR
>                 SELECT company_id
>                 from PSM_COMPANY_PROFILE
>                 where is_BUYER = 1
>   and subscriber_id=subscriberID;
> v_company c_company%ROWTYPE;

The error is pointing you here.  I believe the problem is that c_company
is a cursor, not a table, and as such can't be referenced with %rowtype.

I think you could just use RECORD instead ...

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux