Skip to content
ParticleDB
Release candidateParticleDB 1.1.19-rc.17 is not yet GA or ready for production data.Release status →

Type conversions

Convert values explicitly and handle nulls.

SELECT CAST('42' AS BIGINT) AS value;
SELECT CAST(42 AS TEXT) AS label;
SELECT CAST(NULL AS BIGINT) AS missing;

A cast can fail if the input cannot be represented by the destination type. Validate untrusted input and handle conversion errors instead of relying on silent truncation. SQL NULL remains NULL when cast.

SQL reference · Application guide · Troubleshooting