null (Attribute)



Reflects the representation for the SQL NULL value that is returned by the interpreter, for this statment, for database values that are NULL.

null get: Returns the current object the interpreter uses for this statement for the SQL NULL value. If the programmer has not changed this attribute, its value is the value of the null attribute of the database connection this statement is assigned to. Normally this is the.nilobject.
null set: Set this attribute to either the.nilobject, or some alternativestringvalue.
Remarks: By default, ooSQLite uses the.nilobject to represent the SQL NULL value. Queries for values stored in the database will return the.nilobject for any value that is SQL NULL. However, by changing the value of thenullattribute, the Rexx programmer can change the value the interpreter returns for NULL when this statement is executed. Typically this would be done when the returned values are going to be displayed as text and the programmer would prefer to work with a string directly. PerhapsNULL, orno value. When aooSQLiteStmtobject is instantiated, thenull attribute is assigned the value of the null object that is used to instantiate the statement.

Notethat this attribute does not affect the value the programmer must use to assign a SQL NULL to the database. The programmer must use the.nilobject for that.

Details Raises syntax errors when incorrect usage is detected. This attribute is provided by ooSQLite, there is no similar feature provided by SQLite.
Example: This example sets thenullattribute of the statment tono value. This allows the application to invoke theleftmethod on the returned value without having to check that the return is the.nilobject. Note that invoking theleftmethod on the.nilobject will raise a syntax condition:
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE)
sql = 'SELECT * FROM foods ORDER BY name;'
stmt = .ooSQLiteStmt~new(dbConn, sql)
stmt~null = 'no value'
say stmt~columnName(1)~left(25) ¦¦ stmt~columnName(2)~left(25) ¦¦ stmt~columnName(3)~left(25)
say '='~copies(80)
do while stmt~step == stmt~ROW
say stmt~columnText(1)~left(25) ¦¦ stmt~columnText(2)~left(25) ¦¦ stmt~columnText(3)~left(25)
end