These functions convert strings from/to base64-encoding.
encode_base64 returns a varchar containing base64-encoded data. decode_base64 returns a varchar containing the result of the base64-decoding.
Base64-encode a string
SQL> select encode_base64('Rutabaga'); callret VARCHAR _______________________________________________________________________________ UnV0YWJhZ2E= 1 Rows. -- 25 msec.
Using encode-base64 with serialize to persist complex data
declare n any; n := vector ('a', 3.14157, 4711, 'Hic Iacet Corpus.'); http (sprintf ('<input type="hidden" name="saved" value="%s">', encode_base64 (serialize (n))));
To retrieve this data in VSP context when handling a form submit:
declare n any; n := deserialize (decode_base64 (get_keyword ('saved', params, '')));