Consulta sobre transacciones

From: "Fernando Aguada" <faguada(at)cpcipc(dot)org>
To: <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Consulta sobre transacciones
Date: 2004-09-16 15:06:19
Message-ID: 006d01c49bfe$ba2fcdb0$a500a8c0@fernandoa
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Espero que se la ultima vez que los molesto, pero estoy teniendo problemas con una funcion que utiliza
una transaccion, el analizador de consulta me marcar error en la linea del START TRANSACTION,
pero viendo los ejemplos, es correcto, les muestro el codigo de la funcion a ver si alguno ya hizo algo parecido y puede sugerirme alguna idea

declare tresul sucursal%ROWTYPE;

begin
START TRANSACTION;

select * into tresul from sucursal where ctip=ptipo and clet=pletra and csuc=psucur;

update sucursal set cult=cult+1 where ctip=tresul.csti and clet=tresul.csle and
csuc=tresul.cssu;

if not found then
ROLLBACK TRANSACTION;
end if;

select * into tresul from sucursal where ctip=tresul.csti and clet=tresul.csle and
csuc=tresul.cssu;

update totalven set cmodo=2, cnumcomp=tresul.cult where cnumtra=pnumtra;

if not found then
ROLLBACK TRANSACTION;
end if;

COMMIT TRANSACTION;
return(tresul.cult);

end;

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message tgutierrez 2004-09-16 16:04:35 postgreSQL-8.0- beta-Windows 2000 Server
Previous Message Mario A. Soto Cordones 2004-09-16 14:29:13 Re: Guardar imagenes