Create a data operation log dictionary in PB [Favorit]

xiaoxiao2021-03-05  24

Create a log dictionary -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------- SUSUE

--------- As the table already exists, first delete - IF EXISTS (SELECT 1 from sysobjects where name = 's_log' and xtype = 'u') Drop Table S_Log; Go

------- Construction New Table and Primary Key Create Table S_Log (p_id IdenTentity Not Null, - ID C_UID VARCHAR (20) NULL, - Name Name C_DDTTT VARCHAR (20) NULL, - Date Time C_ACT VARCHAR (20) NULL, - Action C_SQL VARCHAR (2048) NULL, --SQL Statement Constraint PK_LOG Primary Key Clustered (p_id));

// Function Name: None GF_Log (String S_SQL) // Parameters: String S_SQL // SQL Statement // Call: DataWindow Sqlpreview Script: // GF_Log (this.getsqlpreview ()) // PB High Versions available // GF_LOG (Sqlsyntax ) // Function: Record user operation log // Original: Susue 2003-12-14 string ls_act // Action IF POS (S_SQL, 'SELECT')> 0 Then Returnchoose Case Left (S_SQL, 6) Case 'INSERT' LS_ACT = 'Insert' case 'update' ls_act = 'update' case 'delete' ls_act = 'Delete' End Choose

String Ls_UID, LS_DDTT / / User ID, System Time LS_UID = GS_UID GS_NAMELS_DDTT = GF_DATETIME () // Custom Accept System Time Function INSERT INTO S_LOG (C_UID, C_DDTT, C_ACT, C_SQL) VALUES (: Ls_UID,: LS_DDTTTT,: LS_ACT ,: s_sql);

转载请注明原文地址:https://www.9cbs.com/read-36842.html

New Post(0)