BSON_CHECK Function Examples | VantageCloud Lake - Examples: Using BSON_CHECK to Validate BSON Data - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

Example: BSON_CHECK with Valid BSON Data

The string passed to BSON_CHECK in this query has valid BSON syntax; therefore, the function returns 'OK'.

SELECT BSON_CHECK('160000000268656C6C6F0006000000776F726C640000'xb);

Result:

OK

Example: BSON_CHECK with Invalid BSON Data

The string passed to BSON_CHECK in this query is not valid BSON syntax. The bold portion is an incorrect length for the string that follows. Therefore, the function returns an error message.

SELECT BSON_CHECK('160000000268656C6C6F0005500000776F726C640000'xb);

Result:

INVALID: error_message_explaining_syntax_error