Results for “fallback”
Small, practical examples. Search by task or narrow things down below.
Read the next row’s value
SQLite: LEAD reads a later ordered row without a self join and supports a fallback at the end.
SQLite✓ Tested
Recover from an expected promise rejection
JavaScript: Return a fallback from catch so later handlers receive an ordinary resolved value.
JavaScript✓ Tested
Recover from an expected promise rejection
TypeScript: Return a fallback from catch so later handlers receive an ordinary resolved value.
TypeScript✓ Tested
Replace NULL in a result
Choose a fallback for a missing value.
COALESCE✓ Tested
Return a value from a switch expression
Java: Use an exhaustive switch expression with a fallback for other input values.
Java✓ Tested
Treat an empty trimmed value as missing
SQL: NULLIF converts an empty string to NULL before a fallback is applied.
SQL✓ Tested
Treat an empty trimmed value as missing
SQL Server: NULLIF converts an empty string to NULL before a fallback is applied.
SQL Server✓ Tested
Treat an empty trimmed value as missing
Postgres: NULLIF converts an empty string to NULL before a fallback is applied.
Postgres✓ Tested
Treat an empty trimmed value as missing
SQLite: NULLIF converts an empty string to NULL before a fallback is applied.
SQLite✓ Tested
Use a default value for an unset variable
Supply a fallback without changing the original variable.
parameter expansion✓ Tested