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)
-   -   sp en select (https://www.clubdelphi.com/foros/showthread.php?t=76993)

look 12-12-2011 22:03:20

sp en select
 
¿Hola, es posible utilizar una sp dentro de una sentencia select?, algo mas o menos asi:
Código SQL [-]
select a.CLV_CLIE,a.no_fact, osaldoafcxc(a.clv_clie,:fecha)
from cuent1 a , conc1 b
where b.tipo = 'C' and a.tipo_mov = b.num_cpto and b.con_refer = 'N'

osaldoafcxc es un procedimiento que me devuelve el saldo a fecha de un cliente, pero esto no me funciona.

¿que puedo hacer?

mightydragonlor 12-12-2011 23:05:42

Creo que debería ir así:

Código SQL [-]
select
     a.CLV_CLIE,
     a.no_fact,
     (SELECT * FROM osaldoafcxc(a.clv_clie,:fecha))
from cuent1 a , conc1 b
where b.tipo = 'C' and a.tipo_mov = b.num_cpto and b.con_refer = 'N'

look 12-12-2011 23:22:01

Cita:

Empezado por mightydragonlor (Mensaje 420979)
Creo que debería ir así:

Código SQL [-]
select
     a.CLV_CLIE,
     a.no_fact,
     (SELECT * FROM osaldoafcxc(a.clv_clie,:fecha))
from cuent1 a , conc1 b
where b.tipo = 'C' and a.tipo_mov = b.num_cpto and b.con_refer = 'N'

Excelente, gracias.

luisgutierrezb 12-12-2011 23:30:41

[quote=mightydragonlor;420979]Creo que debería ir así...

Bueno no se si puedas crear funciones como MS SQL u otros, donde podrias poner el select como lo tienes originalmente...


La franja horaria es GMT +2. Ahora son las 11:34:30.

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