on 08-18-2010 11:27 PM
--If @object_type = 'TM01' and @transaction_type in ('A','U') Begin
--Select t0.u_itemcode from [@TMUBICACION] T0
--if t0.u_itemcode not in (select itemcode from oitm) begin
--set @error = 500
--set @error_message = 'Articulo incorrecto'
--end
--if t0.u_itemcode in (select itemcode from OITM) begin
-- Update OITM
-- set u_ubicacion=t0.u_ubicacion
-- from [@TMUBICACION] T0 where t0.u_itemcode = itemcode
--end
Tengo esta consulta en el transactionnotification, pero quiero unirlas, primero que cuando coloque el codigo del articulo y si es incorrecto me mande que no existe. Y por otra parte si todo esta bien, me actualice el campo SDK de la OITM.
Necesito que me indiquen primero si la logica esta bien y lo otro como unir todo.
Necesitas guardar el itemcode en una variable, para esto, debes comparar que el itemcode que estas tratando de seleccionar es = a tu variable @list_of_cols_val_tab_del
entoces despues para validar que te marque el error pondrias
if @tuvariable not in (select........)
set error .......
if @tuvariable in (select ........)
OK
asi porque si no, estas trayendo todo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
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.