Hola amigos foreros en firebird puedo hacer esta instrucción
Código SQL
[-]for select i.itecups, i.itesoat from hgstable h, itetable i, afttable a
where i.itecups = h.hgscups and a.aftripsfactura = h.hgsrips and
a.aftcuenta = :cuenta group by i.itecups, i.itesoat into :cups, :soat do
begin
if (upper(tipo) = 'SOAT') then
begin
select first 1 :uvr * p.premultiplo from pretable p
where p.precodigo = :soat and p.codmanual = -1 into :valor_u;
end
else
begin
select first 1 :uvr * p.premultiplo from pretable p
where p.precodigo = :cups and p.codmanual = -1 into :valor_u;
end
update hgstable g set g.hgsunitario = :valor_u, g.hgstotal =
:valor_u * g.hgscantidad, g.hgstru_val = :trun_val where g.hgscups = :cups;
end
como se hace en oracle el
Código SQL
[-]for select i.itecups, i.itesoat from hgstable h, itetable i, afttable a
where i.itecups = h.hgscups and a.aftripsfactura = h.hgsrips and
a.aftcuenta = :cuenta group by i.itecups, i.itesoat into :cups, :soat do
Gracias por su Tiempo