Gracias!!! Me causa gracia pensar que perdi tanto tiempo probando tantas cosas y el problema era tan sencillo de solucionar..
Aca esta el procedimiento y funciona correctamente!!!!
Código SQL
[-]begin
select count(pendientes.cod_presup) from pendientes where pendientes.cod_presup=:cod_presup into :cantidad;
if (:cantidad=0 or (:cantidad is NULL) ) then
begin
for
select presupuestos.cod_presup, presupuestos.cod_cliente,clientes.nombre||' '||clientes.apellido AS CLIENTE,fecha
from presupuestos, CLIENTES
where presupuestos.cod_presup=:cod_presup AND PRESUPUESTOS.cod_cliente=CLIENTES.cod_cliente into :CODpresup, :codcliente, :cliente,:fecha
do
begin
insert into pendientes(cod_cliente,FECHA_AT,cliente,cod_presup) values(:codcliente,:fecha, :cliente,:codpresup);
end
end
end