Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 31-07-2003
Newbie Newbie is offline
Miembro
 
Registrado: jul 2003
Ubicación: Veracruz, México
Posts: 30
Poder: 0
Newbie Va por buen camino
Ya lo hice, gracias!!!
En efecto, Interbase no da la capacidad de hacer lo que yo pretendía, pero tampoco recurrí a la creación de una vista. Lo que hice fue crear el siguiente procedimiento almacenado
Código:
CREATE PROCEDURE "Totales_Remesa" 
RETURNS (
    SCVE_SUCURSAL INTEGER,
    ABREVIATURA VARCHAR(3),
    TOTAL INTEGER)
AS
begin
  for Select Scve_Sucursal, CABreviatura3,
             (select sum(stotal) from Numeracion_remesa where scve_sucursal = S.scve_sucursal
             and cstatus = 'G') Total
      from sucursal S
      into  :scve_sucursal, :abreviatura, :total
  do
      begin
        if (total is null) then
          total = 0;
        suspend;
      end
end
y lo llamo para saber el total en cada tienda; y cuando quiero obtener el total de todas las tiendas apoyándome en el mismo procedimiento almacenado, lo que hago es
Código:
select sum(total) from "Totales_Remesa"
o bien, directamente con un query obtengo el total de todas las tiendas
Código:
select sum(stotal) from Numeracion_remesa where cstatus = 'G'
Gracias por su apoyo
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 23:07:44.


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