SQLite’s json_valid() Now Accepts an Argument that Defines What “Valid” Means

SQLite’s json_valid() function allows us to check whether a JSON string is well formed or not.

Prior to SQLite 3.45.0 the json_valid() function only accepts one argument – the value to check. However, from SQLite 3.45.0 (released on 15 January 2024), we can now provide an optional second argument to define what valid – or “well formed” – means.

Continue reading

Oracle Adds Support for IF EXISTS and IF NOT EXISTS Syntax Modifiers

Many RDBMSs implement IF EXISTS and IF NOT EXISTS syntax modifiers that can be used with DDL object creation, modification, and deletion, such as CREATE TABLE and DROP TABLE statements, to name just a couple.

These syntax modifiers allow us to run such statements without getting an error in the event that the object already exists (if we’re trying to create it or modify it) or doesn’t exist (if we’re trying to drop it).

Continue reading

Improvements to the TRIM(), LTRIM() and RTRIM() Functions in SQL Server 2022

The release of SQL Server 2022 in November 2022 introduced a bunch of new functionality, including some enhancements to the TRIM(), LTRIM() and RTRIM() functions.

The enhancements in the LTRIM() and RTRIM() functions are different to those in the TRIM() function. Below is a quick overview of the enhancements to these functions, along with examples.

Continue reading

SQLite Renames PRINTF() to FORMAT()

SQLite has introduced the FORMAT() function, which can be used to format strings.

More precisely, it has actually just renamed its SQL PRINTF() function to FORMAT(). The reason is for better compatibility with other DBMSs. The original PRINTF() name is retained as an alias for backwards compatibility.

The FORMAT() function (or its naming) was introduced in SQLite 3.38.0, which was released on 22 February 2022.

Continue reading