- カテゴリ:
:doc:`/sql-reference/functions-string`(AI 関数)
AI_REDACT¶
非構造化テキストデータから個人を特定できる情報(PII)を編集します。
構文¶
AI_REDACT( <input> [, <categories> ] [, <return_error_details> ] )
引数¶
必須:
input個人を特定できる情報(PII)を含む可能性があるテキストデータを含む VARCHAR 値。
オプション:
categories編集される PII のタイプを指定する文字列値の ARRAY。指定しない場合、サポートされるすべての PII カテゴリが編集されます。サポートされているカテゴリのリストについては、 検出される PII カテゴリ をご参照ください。
Passing an unsupported category results in an error.
return_error_detailsA BOOLEAN flag that indicates whether to return error details in case of error. When set to TRUE, the function returns an OBJECT that contains the value and the error message, one of which is NULL depending on whether the function succeeded or failed.
Requires that the session parameter
AI_SQL_ERROR_HANDLING_USE_FAIL_ON_ERRORto be set to FALSE.
戻り値¶
Generally, a VARCHAR containing placeholder values in place of redacted PII, such as [NAME] where the input text had "John Smith".
If the session parameter AI_SQL_ERROR_HANDLING_USE_FAIL_ON_ERROR is set to FALSE and the optional argument
return_error_details is set to FALSE or is not passed, and the function cannot process the input, the function returns NULL.
If the session parameter AI_SQL_ERROR_HANDLING_USE_FAIL_ON_ERROR is set to FALSE and the optional argument
return_error_details is set to TRUE, the function returns an OBJECT with the following fields:
value: A VARCHAR value that contains the redacted text, or NULL if an error occurred.
error: A VARCHAR value that contains the error message if an error occurred, or NULL if the function succeeded.
使用上の注意¶
AI_REDACT で編集できる PII のカテゴリについては、 検出される PII カテゴリ をご参照ください。
AI_REDACT の現在のバージョンの制限については、 制限事項 をご参照ください。
例¶
例 をご参照ください。