Oracle® OLAP DML Reference 11g Release 2 (11.2) Part Number E17122-07 |
|
|
PDF · Mobi · ePub |
The OBSCURE function provides two mechanisms for encoding a single-line text expression. Depending on the mechanism you use, OBSCURE can also restore the encoded value to its original form.
Note:
This function performs simple encoding. For information on using secure encryption and other security features in Oracle, see Oracle Database Security Guide.TEXT
Note:
The return value of the OBSCURE function always has a text data type. However, unless you specify the TEXT keyword, the actual value returned byOBSCURE(HASH)
and OBSCURE(HIDE)
is binary. When you want to be able to manage these encoded values as text (for example, when you want to be able to store them in a text file), you must specify the TEXT keyword. See Example 8-59, "Generating Text Data".OBSCURE({HASH|HIDE|UNHIDE} [TEXT] seed-exp input-exp)
Specifies that Oracle OLAP encodes the input text expression according to the seed expression that you specify. With the HASH keyword:
Encoded values cannot be restored to their original form.
The same seed expression and input text always produce the same result.
Specifies that Oracle OLAP encodes the input text expression according to the seed expression that you specify. With the HIDE keyword:
Encoded values can be un-encoded to their original form with UNHIDE.
The same seed expression and input text always produce different results.
The HIDE keyword provides a mechanism for storing values in encoded form while actually comparing their un-encoded values.
When specified with the original seed expression, decodes values encoded with the HIDE keyword to their original form. See "Decoding Text".
The TEXT keyword causes OBSCURE to convert binary data to text, such that the return value consists only of text data. When you do not specify the TEXT keyword, the output of OBSCURE is binary data. See "Decoding Text", and "Generating Text Data".
A single-line case-sensitive text expression that is used as a seed value when encoding of the input text expression.
A single-line case-sensitive text expression to be encoded or decoded by OBSCURE.
When you have used OBSCURE(HIDE) with the TEXT keyword to encode a text expression, you must also specify the TEXT keyword with OBSCURE(UNHIDE)
to decoded expression to its original value.
Example 8-59 Generating Text Data
The following statements illustrate the use of the TEXT keyword.
DEFINE encoded_text VARIABLE TEXT DEFINE unencoded_text VARIABLE TEXT unencoded_text = 'max' encoded_text = OBSCURE(HIDE TEXT 'XXXX' unencoded_text) SHOW encoded_text
This SHOW statement generates the following output.
c5WF/XfABuY
The same statements without the TEXT keyword would produce binary output from the SHOW statement.