Stored Procedure Accelerator Guide for Sybase

Stored Procedure Accelerator Guide for Sybase

Stored Procedure Accelerator Example

Stored Procedure Accelerator Example

You want to mask data called by a stored procedure.
You have a stored procedure named Proc_Dept_Emp. The stored procedure calls the following columns in the Dept_Emp table:
  • EMPLOYEE_ID
  • Last_Name
  • FIRST_NAME
  • JOB_ID
  • Job_Title
  • SALARY
  • COMM
  • DEPARTMENT_ID
You set up the stored procedure accelerator and create a masking rule set. You have a masking rule that masks the Proc_Dept_Emp stored procedure. The following table describes the columns and masking functions that you define in the masking rule:
Column
Masking Function
.*SALARY
999
.*COMM
substring(convert(varchar,\(col),0),1,1)
.*Last_Name
substring(\(col),1,2)
When you create the masking rule, you must enter the column name preceded by .*.
You send the following request to the database:
EXEC Proc_Dept_Emp @manager_id = 25 , @dept_id = 10
The Dynamic Data Masking Java Action converts the request to the following statement:
SELECT EMPLOYEE_ID, Last_Name, FIRST_NAME, JOB_ID, Job_Title, SALARY, COMM, DEPARTMENT_ID FROM tempdb.dbo.DDM_Proc_Dept_Emp_1426236444222_0
The name of the table is the table that Dynamic Data Masking created in the temporary database.
The masking rule then changes the request to the following statement:
SELECT EMPLOYEE_ID, substring(Last_Name ,1,2) Last_Name, FIRST_NAME, JOB_ID, Job_Title, 999 SALARY, substring(convert(varchar,COMM ,0),1,1) COMM, DEPARTMENT_ID FROM tempdb.dbo.DDM_Proc_Dept_Emp_1426236444222_0
Dynamic Data Masking creates a temporary stored procedure in the temporary database that uses the masked select statement and sends the request to the following temporary stored procedure:
EXEC tempdb.dbo.DDM_MASKED_Proc_Dept_Emp_1426236444222 @manager_id=25 ,@dept_id = 10

0 COMMENTS

We’d like to hear from you!