Re: [SQL] cursor and for update

2006-03-28 Thread Wiebe Cazemier
On 03/28/06 11:13, Maciej Piekielniak wrote: >create or replace function uporzadkuj_reguly(text,text) RETURNS VOID AS >' >DECLARE > licznik integer:=1; > > reguly CURSOR FOR SELECT * from firewall ORDER BY id_firewall WHERE > tabela=$1 and lancuch=$2 for UPDATE; >BEGIN > for i in reguly LOOP > U

Re: [SQL] cursor and for update

2006-03-28 Thread Maciej Piekielniak
Hello Wiebe, Tuesday, March 28, 2006, 2:42:20 AM, you wrote: >> WC> Fist, what's the error you get? ERROR: missing ".." at end of SQL expression CONTEXT: compile of PL/pgSQL function "uporzadkuj_reguly" near line 7 WC> Second, what does "rekord" do? You don't seem to use it. Yes, i don't nee

Re: [SQL] cursor and for update

2006-03-27 Thread Wiebe Cazemier
On 03/28/06 01:35, Maciej Piekielniak wrote: >Hello , > >I try to translate my old functions from oracle but don't understand what is >wrong. > >create or replace function uporzadkuj_reguly(text,text) RETURNS integer AS >' >DECLARE > tabela ALIAS FOR $1; > lancuch ALIAS FOR $2; > ret integer:=0;

[SQL] cursor and for update

2006-03-27 Thread Maciej Piekielniak
Hello , I try to translate my old functions from oracle but don't understand what is wrong. create or replace function uporzadkuj_reguly(text,text) RETURNS integer AS ' DECLARE tabela ALIAS FOR $1; lancuch ALIAS FOR $2; ret integer:=0; licznik integer:=1; rekord firewall%ROWTYPE; reguly C