Modifies stmt
to take into account any parameter which might be null
: if stmt
contains the
equivalent of "xxx = <parameter definition>" and if that parameter is in params
and its value is of type GDA_TYPE_NUL,
then that part is replaced with "xxx IS NULL".
It also handles the "xxx IS NOT NULL" transformation.
For example the following SELECT:
SELECT * FROM data WHERE id = ##id::int:null AND name = ##name::string
in case the "id" parameter is set to NULL, is converted to:
SELECT * FROM data WHERE id IS NULL AND name = ##name::string
if out_stmt
is not null
, then it will contain:
true
)null
if no modification to stmt
were required and no erro occurred (the function returns false
)
null
if an error occured (the function returns true
)This function is used by provider's implementations to make sure one can use parameters with NULL values in statements without having to rewrite statements, as database usually don't consider that "xxx = NULL" is the same as "xxx IS NULL" when using parameters.
stmt | |
out_stmt |
a place to store the new Statement, or |
params |
a Set to be used as parameters when executing |
|