on 11-06-2013 11:57 PM
Hola Comunidad buen dia;
Estoy tratando de leer un SP desde el generador de consultas de SAP ya tengo mi SP en SQL ya probé el SP y funciona bien mi duda es como hacer para que el usuario ingrese las variables que necesito se vayan como parámetros es decir;
Si yo lo ejecuto desde el generador de consultas así ;
EXEC dbo.clientespotenciales '100000','99999'
funciona muy bien y me trae el resultado mi problema es cuando quiero hacer lo siguiente;
DECLARE @CODIGO AS CHAR(8)
SET @CODIGO = '[%1]'
EXEC dbo.clientespotenciales @CODIGO
no me permite ingresar estas variables me manda errores alguien sabe como puedo lograr esto?
Gracias por su ayuda.
Saludos
Alejandro
Buen día.
Debes ejecutarlo de la siguiente manera.
DECLARE @CODIGO AS CHAR(8), @CODIGO2 AS CHAR(8)
SET @CODIGO = isnull((select T0.[CardCode] from [dbo].[OCRD] T0 where T0.[CardCode]='[%0]'),'')
SET @CODIGO2 = isnull((select T0.[CardCode] from [dbo].[OCRD] T0 where T0.[CardCode]='[%1]'),'')
EXEC [dbo].[clientespotenciales] @CODIGO,@CODIGO2
Saludos
FLR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.