Use an encryption key to encrypt table data.

Syntax

SELECT ENCRYPT (column_name, encryption_key, 'password') FROM SYSTEM.DATABASE.SCHEMA.TABLE

Arguments

  • column_name - column name in following table

  • encryption_key - title of encryption key.

  • ‘password’ - supply password for encryption key if it was set when created.

  • FROM OBJECT - the table containing the column.

Examples

Encrypt

SELECT ENCRYPT(surname, my_key, 'mypassword') from Ora1.fullname

Create a table “mask” with encrypted data, using key1 as the encryption key

create table "backupmysql"."cirrotest"."cirrotest"."mask" 
as select encrypt(decimal_test, key1, password) c1
from "Postgres"."postgres"."postgres"."masktest"
using key1;

See Also