Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > Firebird e Interbase
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 21-03-2005
Avatar de StartKill
StartKill StartKill is offline
Miembro
 
Registrado: ene 2004
Posts: 299
Poder: 23
StartKill Va por buen camino
Wnas,

Revisale esta lineas y ajustale a tu necesidad:

Código SQL [-]
CREATE PROCEDURE AA01 
AS
DECLARE VARIABLE XCODIGO CHAR(3);
DECLARE VARIABLE XNUMBER INTEGER;
begin
  for select fcodigo, fnumber from aa1 into :xcodigo, :xnumber do begin
    insert into aa2 (fcodigo, fnumber) values (:XCODIGO, :xnumber);
  end
  suspend;
end

Código SQL [-]
CREATE PROCEDURE AA02 
AS
DECLARE VARIABLE XCODIGO CHAR(3);
DECLARE VARIABLE XCOD2 CHAR(3);
DECLARE VARIABLE XNUMBER INTEGER;
begin
  for select fcodigo, fnumber from aa1 into :xcodigo, :xnumber do begin
      select fcodigo from aa2 where fcodigo=:xcodigo into :xcod2;
      if (:xcod2 <>:xcodigo) then
          insert into aa2 (fcodigo, fnumber) values (:XCODIGO, :xnumber);
      else
          update aa2 set fnumber=:xnumber where fcodigo=:xcodigo;
  end
  suspend;
end

Your friend,

StartKill
Lima-Perú
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 11:27:33.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi