PDA

Ver la Versión Completa : sp en select


look
12-12-2011, 22:03:20
¿Hola, es posible utilizar una sp dentro de una sentencia select?, algo mas o menos asi:

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í:


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
Creo que debería ir así:


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...