Categorias:

Funções de cadeia de caracteres e binários (funções de AI)

AI_REDACT

Oculta informações de identificação pessoal (PII) de dados de texto não estruturados.

Sintaxe

AI_REDACT( <input> [,  <categories> ] [, <return_error_details> ] )
Copy

Argumentos

Obrigatório:

input

Um valor VARCHAR contendo dados de texto que podem conter informações de identificação pessoal (PII).

Opcional:

categories

Um ARRAY de valores de cadeia de caracteres que especificam os tipos de PII a serem ocultados. Se nada for especificado, todas as categorias de PII compatíveis serão ocultadas. Consulte Categorias de PIIs detectadas para obter uma lista de categorias compatíveis.

Passing an unsupported category results in an error.

return_error_details

A 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_ERROR to be set to FALSE.

Retornos

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.

Notas de uso

Exemplos

Consulte Exemplos.