SQLQUERYDEFAULT

Description

Similar to the SQLQUERY function, except that it accepts a default_value to return if no matching record is found.

Syntax

SQLQUERYDEFAULT ( TextSourceField, "connection", "sqlStatement", "default_value" )

Parameter Description
TextSourceField Source value used in the SQL statement.
connection The connection for the database to run the query against.

If the connection is Scribe Internal Database, the SCRIBE user must have at least SELECT privileges on any table referenced in the SQL statement.
sqlStatement The SQL statement to execute.
default_value Default value to return if the query does not return a value.

Remarks

Use this function to avoid wrapping the SQLQUERY function in ISERROR when a default value is needed.

If the database was configured as <table>.dbo.<fieldname> then you must include dbo. in the query. See SQLQUERY for more information. 

See also

SQLQUERY

SQLQUERYDEFAULT2