on 10-24-2011 7:24 PM
Hola a todos.
Es posible en una consulta diseñada en el query manager, utilizar como filtro los valores de una tabla creada por el usuario?
Esta es la sintaxis que estoy utilizando:
Select @proc = (a4.u_proceso) from dbo.@proceso a4 where a4.u_proceso = '[%3]'
Al ejecutarla, me logra mostrar los valores y seleccionarlo pero luego me muestra el mensaje de error:
"Incorrect syntax near '@proceso'. 2 ... Valores definidos por el usuario (CSHS) (s) could not be prepared"
Si pongo corchetes dbo.[@proceso] no ejecuta la consulta nisiquiera para seleccionar los valores.
A que se deberá
SOLUCION
--SET @FechaIni = (select TOP 1 t0.fechaini from [dbo].[@parametros] t0 where t0.fechaini = '[%0]')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Solucion
--SET @FechaIni = (select TOP 1 t0.fechaini from [dbo].[@vs_parametros] t0 where t0.fechaini= '[%0]')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Estimado
No es posible asignar variables de SAP (%0,%1...etc) a parametros que esten en tablas de usuario.
Atte.
-
De todas maneras cambialo por esto, si no funciona asi no creo que sea posible
SET @proc = (SELECT a4.u_proceso from [dbo].[@proceso] a4 where a4.u_proceso = '[%3]')
Slds
Edited by: Floyola on Oct 24, 2011 3:33 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gracias por responder.
Justamente así lo hice, pero de esta forma no ejecuta la consulta nisiquiera para seleccionar los valores.
Conoces alguna alternativa, basicamente lo que quiero es ejecutar una consulta desde un SP que necesita un parámetro que no está en ninguna tabla de las estándar de SAP.
Saludos,
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.