ascot diagnostics

A6627

Warning: Host variable ‘:{name}’ is undefined here; embedded SQL reads it as NULL

An input host variable of embedded SQL, :name anywhere but an INTO list, that no path assigns before the statement. IRIS compiles and runs the code, and the documentation says what it does: an undefined input host variable is read as SQL NULL, so a WHERE Name = :name matches nothing and a VALUES (:name) stores NULL. Assign the variable first, or use NULL when NULL is meant.

IRIS compiles the example.

Class Demo.UndefinedHostVariable
{

ClassMethod Description() As %String
{
    &sql(SELECT Description INTO :description FROM %Dictionary.ClassDefinition WHERE Name = :className) //! A6627
    Quit description
}

}

All diagnostics