forked from oracle-samples/oracle-db-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbms-assert.sql
More file actions
40 lines (32 loc) · 867 Bytes
/
Copy pathdbms-assert.sql
File metadata and controls
40 lines (32 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
Use DBMS_ASSERT to help guard against SQL injection.
The DBMS_ASSERT package was introduced in Oracle 10g Release 2. It contains functions
that help developers sanitize user input and reduce the likelihood of SQL injection
in applications that concatenate text (they do NOT use bind variables).
*/
BEGIN
sys.DBMS_OUTPUT.put_line (DBMS_ASSERT.schema_name ('HR'));
END;
/
BEGIN
sys.DBMS_OUTPUT.put_line (DBMS_ASSERT.sql_object_name ('EMPLOYEES'));
END;
/
BEGIN
sys.DBMS_OUTPUT.put_line (DBMS_ASSERT.qualified_sql_name ('HR.EMPLOYEES'));
END;
/
BEGIN
sys.DBMS_OUTPUT.put_line (DBMS_ASSERT.schema_name ('HR'));
END;
/
BEGIN
sys.DBMS_OUTPUT.put_line (DBMS_ASSERT.schema_name ('WHO_ME'));
END;
/
BEGIN
DBMS_OUTPUT.put_line (
DBMS_ASSERT.sql_object_name (
'EMPLOYEES, (SELECT * FROM ALL_USERS) u'));
END;
/