Databases Reference
In-Depth Information
Instead of altering all the statements used in the application, deine a VPD policy
function to return the predicate. Alter the VPD policy function that was created
earlier, and look at the effect:
The function returns the predicate that uses the SYS_CONTEXT function.
Alternative quoting
It can be quite a challenge to use the correct number of single
quotes ( ' ) to construct the predicate, which needs to be
returned in the VPD policy function. When a string needs to
be enclosed in single quotes, these need to be double up. In the
preceding function, the get_predicate alternative quoting
is utilized to ease this burden. The predicate is enclosed
between alternative quoting characters. The alternative
quoting expression is as follows:
q'<quote_delimiter> the actual string
<quote_delimiter>'
Alternative quoting starts with the letter q , followed by a
single quote and a character (the sample code used a bracket,
but it can be any character that you want). After this sequence
of characters, the actual string is included, followed by the
following combination: the quote delimiter and a single quote.
 
Search WWH ::




Custom Search