开发者

Audit Table using Triggers

开发者 https://www.devze.com 2022-12-08 15:57 出处:网络
DROP TABLE IF EXISTS `actividades`.`act_actividad_audit`; CREATE TABLE`actividades`.`act_actividad_audit` (
DROP TABLE IF EXISTS `actividades`.`act_actividad_audit`;
CREATE TABLE  `actividades`.`act_actividad_audit` (
  `fe_creacion` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP 
                                   ON UPDATE CURRENT_TIMESTAMP,
  `usr_digitador` char(10) NOT NULL,
  `ip_digitador` char(15) NOT NULL,
  `id_act_actividad` int(10) unsigned NOT NULL,
  `titulo` char(64) NOT NULL,
  `act_prioridad_id` int(10) unsigned NOT NULL,
  `act_motivo_id` int(10) unsigned NOT NULL,
  `detalle` text,
  `detalle_tecnico` text,
  `hostname_id` int(10) unsigned NOT NULL,
  `hostname_nombre` char(50) NOT NULL,
  `es_SMOP` tinyint(1) NOT NULL,
  `url_SMOP` text,
  `es_tecnico` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Auditoria Actividad General';

I want to populate that audit table with a trigger but how can i开发者_运维百科 send or fill the values for usr_digitador or ip_digitador if that values are on client side.? please help


Usually the user's IP address will be sent as part of the standard HTTP header information. Certainly I've seen it in IIS logs so it's there. I believe it's in the REMOTE_ADDR server variable.

0

精彩评论

暂无评论...
验证码 换一张
取 消