on 03-19-2014 8:57 PM
Buen día, quiero hacer un transaction notification que dispare un update a una tabla en el momento que se escriban seriales en la tabla OSRN, pero no tengo idea de como hacerlo en el SP, es decir, como veo en el transaction notification que se hizo una operacion sobre esa tabla? o mejor dicho como capturo la operacion?
Saludos.
Hola Alejandro, y como se que se están ingresando nuevos registros? y como los selecciono para hacer un inner join con otra tabla y marcar un estatus?
mi duda es mas en como saber cuales son los registros nuevos en esa operacion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Este es un ejemplo sobre el Objeto 46. El @transaction_type puede ser "A" Add, "U" Update. "D" Delete
Despues en la variable @list_of_cols_val_tab_del viene la llave del registro modificado. De ahi consultas el valor que necesitas y haces las relaciones que necesitas.
IF @object_type='46' AND @transaction_type IN ('A')
Begin
Declare @MontoMayor numeric(19,6)
Set @MontoMayor = (Select (CashSum + CreditSum + CHECKSUM + TrsfrSum) - DocTotal From OVPM where DocEntry = @list_of_cols_val_tab_del)
IF @MontoMayor > 0
BEGIN
SET @error = 1
SET @error_message = 'Monto Mayor'
END
End
Hola Alejandro, si uso este pedazo de codigo me afecta si alguien crea otra cosa relacionada con ese codigo 100000045 o ya esta casado con la tabla OSRN alli??
IF @object_type=10000045 AND @transaction_type IN ('A')
BEGIN
Declare @Serial varchar(59)
Set @Serial = (Select DistNumber From osrn where AbsEntry = (@list_of_cols_val_tab_del))
update [@TS_SERIALES] set U_ts_usado = 1 where U_ts_co_chasis = (@Serial)
--set @error = 1
set @error_message = N'Serial actualizado' +@Serial +' S/N : ' + @IntSer
end
Saludos
Coloca el 10000045 entre comilla simple asi, '10000045'
Correcto, solo va a ejecutar ese fragmento de codigo cuando se vea modificada esta tabla en un proceso de agregar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Es decir que object type corresponderia para emplearse?
IF @object_type=22 AND @transaction_type IN ('A')
BEGIN
END
end
??
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.