Skip site navigation (1) Skip section navigation (2)

BUG #6583: for loop cursor

From: biju(dot)george(at)ust-global(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6583: for loop cursor
Date: 2012-04-12 08:55:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged on the website:

Bug reference:      6583
Logged by:          Biju George
Email address:      biju(dot)george(at)ust-global(dot)com
PostgreSQL version: 8.4.0
Operating system:   Linux

Just this simple code throws below error --
CREATE OR REPLACE FUNCTION my_temp_func(v_acc_type integer)
v_cur cursor (acc_num integer) is select pid from public.my_trade_table
where acc_type = acc_num;
for record_var in v_cur(v_acc_type) loop
raise notice 'ID is %',;
end loop;
  LANGUAGE plpgsql;

ERROR:  syntax error at or near "$1"
LINE 1:   $1 ( $2 )
QUERY:    $1 ( $2 )
CONTEXT:  SQL statement in PL/PgSQL function "my_temp_func" near line 4

********** Error **********

ERROR: syntax error at or near "$1"
SQL state: 42601
Context: SQL statement in PL/PgSQL function "my_temp_func" near line 4


pgsql-bugs by date

Next:From: Greg StarkDate: 2012-04-12 14:28:54
Subject: Re: BUG #6578: Deadlock in libpq after upgrading from 8.4.7 to 8.4.11
Previous:From: Amit KapilaDate: 2012-04-12 06:23:54
Subject: Re: BUG #6534: Passing numeric Bind variables to ODBC driver convers to "Double precision"

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group