Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Firebird e Interbase (https://www.clubdelphi.com/foros/forumdisplay.php?f=19)
-   -   Store Procedure solo devuelve un registro (https://www.clubdelphi.com/foros/showthread.php?t=76224)

Rockin 17-10-2011 18:33:28

Store Procedure solo devuelve un registro
 
Buenas, tengo el siguiente SP declarado en mi BD

Código SQL [-]
CREATE PROCEDURE SP_SEGUIMIENTO_LLAMADAS(
  TELEFONO CHAR(11) CHARACTER SET ISO8859_1)
RETURNS(
  FECHA_CONTACTO DATE,
  HORA_CONTACTO TIME,
  ID_AGENTE CHAR(20) CHARACTER SET ISO8859_1,
  RESULTADO CHAR(300) CHARACTER SET ISO8859_1,
  RESULTADO_ICCS CHAR(250) CHARACTER SET ISO8859_1)
AS
begin
for
SELECT   fecha_contacto, hora_contacto, id_agente, resultado, resultado_iccs
from seguimiento_llamadas where telefono_contacto_bbdd = :telefono order by id asc
into   fecha_contacto, hora_contacto, id_agente, resultado, resultado_iccs do
begin
end
suspend;

Pero cuando lo ejecuto solo me devuelve un registro. Pero si hago la consulta directamente en la BD sin SP me devuelve 3 registros que son los que hay en la BD.

¿Sabe alguien porque me pasa esto? No tengo ni idea.

celades1 17-10-2011 18:37:43

hola

el supend esta mal puesto debe ir dentro del bucle entre el begin y el end

si lo pones fuera del bucle es logico solo te devuelve el ultimo registro de la consulta

Saludos

Rockin 17-10-2011 18:43:31

Joder, vaya tontería, y no lo veía.

Funciona Perfecto.

Gracias.


La franja horaria es GMT +2. Ahora son las 16:21:48.

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