pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Pepe TD Vo <pepevo@yahoo.com>
To: Pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: %rowtype
Date: Fri, 09 Nov 2018 08:26:40 +0100
Message-ID: <cca2ac7b8f6f19c5334d6aa803be33e1065bd7be.camel@cybertec.at> (raw)
In-Reply-To: <1769600488.1326361.1541732091653@mail.yahoo.com>
References: <1769600488.1326361.1541732091653.ref@mail.yahoo.com>
	<1769600488.1326361.1541732091653@mail.yahoo.com>

Pepe TD Vo wrote:
> Would you please tell me what I did wrong here?
> I couldn't find the rowtype eliminate with a cursor in multi-tables selected.
> 
> 
> CREATE OR REPLACE FUNCTION "CIDR_STAGING"."PR_MIG_STG_I864" ( v_Ret OUT int ) RETURNS integer as $$
>  declare 
>    c1 cursor is
>       SELECT ...;
>    rec1            c1%rowtype;

There is a type associated with each view and table, but not with a cursor.

You need to use the generic type "record" for "rec1".

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





view thread (4+ messages)  latest in thread

Message-ID: <cca2ac7b8f6f19c5334d6aa803be33e1065bd7be.camel@cybertec.at>
Permalink:  ../cca2ac7b8f6f19c5334d6aa803be33e1065bd7be.camel@cybertec.at/
Also on:    postgresql.org/message-id/cca2ac7b8f6f19c5334d6aa803be33e1065bd7be.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, pepevo@yahoo.com
  Subject: Re: %rowtype
  In-Reply-To: <cca2ac7b8f6f19c5334d6aa803be33e1065bd7be.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox