as requested by the DBI man page:
[root]/home/alex# perl perl_dbi_nulls_test.pl
Using connect arguments, db version: 3.3.16
=> Drop table 'dbi__null_test_tmp', if it already exists...
DBD::SQLite::db do failed: no such table: dbi__null_test_tmp(1) at dbdimp.c
line 271 at perl_dbi_nulls_test.pl line 92.
=> Create table 'dbi__null_test_tmp'...
=> Insert 4 rows into the table...
Values 1 Homer
Values 2
Values 3 Marge
Values 4
=> Testing clause style 0: WHERE mycol = ?
=> WHERE clause style 0 returned incorrect results.
Non-Null test rows returned: 3
Null test rows returned:
=> Testing clause style 1: WHERE NVL(mycol, '-') = NVL(?, '-')
DBD::SQLite::db prepare failed: no such function: NVL(1) at dbdimp.c line 271
at perl_dbi_nulls_test.pl line 120.
=> Testing clause style 2: WHERE ISNULL(mycol, '-') = ISNULL(?, '-')
DBD::SQLite::db prepare failed: near "ISNULL": syntax error(1) at dbdimp.c
line 271 at perl_dbi_nulls_test.pl line 120.
=> Testing clause style 3: WHERE DECODE(mycol, ?, 1, 0) = 1
DBD::SQLite::db prepare failed: no such function: DECODE(1) at dbdimp.c line
271 at perl_dbi_nulls_test.pl line 120.
=> Testing clause style 4: WHERE mycol = ? OR (mycol IS NULL AND ? IS NULL)
=> WHERE clause style 4 is supported.
=> Testing clause style 5: WHERE mycol = ? OR (mycol IS NULL AND SP_ISNULL(?) =
1)
DBD::SQLite::db prepare failed: no such function: SP_ISNULL(1) at dbdimp.c
line 271 at perl_dbi_nulls_test.pl line 120.
=> Testing clause style 6: WHERE mycol = ? OR (mycol IS NULL AND ? = 1)
=> WHERE clause style 6 returned incorrect results.
Non-Null test rows returned: 3
Null test rows returned:
closing dbh with active statement handles at perl_dbi_nulls_test.pl line 167.
1 styles are supported
4: WHERE mycol = ? OR (mycol IS NULL AND ? IS NULL)
--------------------
here is my connect:
my $dbh = DBI->connect("dbi:SQLite:dbname=nullstest.db", undef, undef,
{
RaiseError => 0,
PrintError => 1
}
) || die DBI->errstr;