if no cursor

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
Responder
dante
Rank: Programador Sênior
Rank: Programador Sênior
Mensagens: 48
Registrado em: Qui, 24 Jan 2008 1:58 pm
Localização: são paulo sp
Danilo Maranini
Aprendendo e Compartilhando

ESTOU COM UM PROBLEMA

TENHO O SEGUINTE CURSOR



declare
cursor c_up is

select
COD_part,
RAMAL,
TELEFONE,
DDD,
DDI,
COD_PAIS,
cod_tipo_tel
from telefone_participante
where cod_part = :contatos.cod_participante;

Selecionar tudo

begin

go_block('telefones');
first_record;
:telefones.RAMAL := null;
:telefones.TELEFONE := null;
:telefones.DDD := null;
:telefones.DDI := null;
:telefones.COD_PAIS := null;
:telefones.cod_tipo_tel := null;
FOR regc_up in c_up LOOP
:telefones.RAMAL := regc_up.RAMAL;
:telefones.TELEFONE := regc_up.TELEFONE;
:telefones.DDD := regc_up.DDD;
:telefones.DDI := regc_up.DDI;
:telefones.COD_PAIS := regc_up.COD_PAIS;
:telefones.cod_tipo_tel := regc_up.cod_tipo_tel;
exit when :system.last_record = 'true';
next_record;
end loop;
first_record;





ELE ESTÁ FUNCIONANDO CERTINHO, AS VEZES CARREGA 4 REGISTROS E COLOCA NO LUGAR CORRETO.

POREM quando O RETORNO DO CURSOR É NULO ELE NÃO APAGA OS REGISTROS QUE POSSUEM LA.
EU COLOCO OS CAMPOS =NULL; ANTES DE ABRIR O CURSOR POREM ELE APAGA APENAS A PRIMEIRA LINHA.



alguém SABE ONDE EU POSSO COLOCAR UMA CONDIÇÃO IF PARA ELE APAGAR TODOS OS CAMPOS PREENCHIDOS.
NO CASO SERIA UM LOOP.

alguém ME AJUDA???

VLW!
rodfbar
Rank: DBA Pleno
Rank: DBA Pleno
Mensagens: 241
Registrado em: Ter, 09 Out 2007 11:15 am
Localização: Batatais - SP

tenta o comando clear_block

Selecionar tudo

begin 

go_block('telefones'); 
first_record;
--
clear_block;

FOR regc_up in c_up LOOP 
:telefones.RAMAL := regc_up.RAMAL; 
:telefones.TELEFONE := regc_up.TELEFONE; 
:telefones.DDD := regc_up.DDD; 
:telefones.DDI := regc_up.DDI; 
:telefones.COD_PAIS := regc_up.COD_PAIS; 
:telefones.cod_tipo_tel := regc_up.cod_tipo_tel; 
exit when :system.last_record = 'true'; 
next_record; 
end loop; 
first_record; 
dante
Rank: Programador Sênior
Rank: Programador Sênior
Mensagens: 48
Registrado em: Qui, 24 Jan 2008 1:58 pm
Localização: são paulo sp
Danilo Maranini
Aprendendo e Compartilhando

opaa!!!


funciooonoo

vlw cara !!
:D
Responder
  • Informação
  • Quem está online

    Usuários navegando neste fórum: Nenhum usuário registrado e 12 visitantes