surfacecleaningvalidate
Cleaningscalar · returns boolean

VALIDATE

Validate a value against a plain-English rule (more flexible sibling of VALID)

Per-row — runs once for each row.

cleaningllmtext

Syntax

VALIDATE({{ value }}, '{{ rule }}')
{{ value }} VALIDATES '{{ rule }}'

Arguments

nametypedescription
valueVARCHAR
ruleVARCHARValidation rule in natural language

About

Check whether a value satisfies an arbitrary rule described in plain English. Returns TRUE/FALSE. Useful for domain-specific or business-rule validation that doesn't fit a predefined type: "is this order amount within policy limits?", "is this license number from a valid issuing state?", "does this description include at least one ingredient?". For well-defined format checks (emails, phones, dates), prefer VALID — it's faster and uses the shared type library.

Examples

Text with price passes rule

SELECT
  validate ('This product costs $29.99', 'contains pricing')

Text without date fails rule

SELECT
  validate ('Hello world', 'contains a date')

Nearby rabbit holes

same domain
Climb back to The Looking Glass