revDatabaseColumnIsNull not working properly ??
Posted: Sun Jul 27, 2008 6:54 pm
Wondering if anyone has run across a problem with Rev 2.9 where the function revDatabaseColumnIsNull reports empty non nullable database fields as null?
I'm using MySQL for the database and the 2.9 Database drivers in Revolution.
Here's the structure for the related fields:
I'm using the snippet that has already been found in the forums:
And here is the result:
The first instance of null is not a nullable field in the database, it is an empty string for the first record, while the second null is a nullable field.
I've searched the forums to no avail, so any insight into what is causing the problem would be most appreciated.
Thx
I'm using MySQL for the database and the 2.9 Database drivers in Revolution.
Here's the structure for the related fields:
Code: Select all
Field Type Collation Attributes Null Default
prodAbbr varchar(6) latin1_swedish_ci No
prodUsed tinyint(3) UNSIGNED Yes NULL
Code: Select all
put "SELECT * FROM product LIMIT 3" into tSQL
put revQueryDatabase(tConnectionId, tSQL) into tResultSet
if tResultSet is not a number then
answer error tResultSet
exit mouseUp
end if
put revDatabaseColumnNames(tResultSet) & return into field "Test4"
put revDatabaseColumnTypes(tResultSet) & return after field "Test4"
put revDatabaseColumnCount(tResultSet) into tColumnCount
repeat until revCurrentRecordIsLast(tResultSet)
repeat with tColumn = 1 to tColumnCount
if revDatabaseColumnIsNull(tResultSet, tColumn) then
put "null" after field "Test4"
else
put empty into tHolder
get revDatabaseColumnNumbered(tResultSet, tColumn, "tHolder")
put tHolder after field "Test4"
end if
put tab after field 2
end repeat
put return after field "Test4"
revMoveToNextRecord tResultSet
end repeat
revCloseCursor tResultSet
Code: Select all
prodID,isCommon,prodAbbr,prodName,prodCost,prodUsed,prodEstimate
SMALLINT,SMALLINT,STRING,STRING,STRING,SMALLINT,FLOAT
10nullBLANK0.00null0.00
21TPTestProduct3.7800.00
I've searched the forums to no avail, so any insight into what is causing the problem would be most appreciated.
Thx