[ Version ( since = "4.2.9" ) ]
public bool rewrite_statement_for_null_parameters (Statement stmt, Set @params, owned Statement? out_stmt) throws Error
stmt to take into account any parameter which might be
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
out_stmt is not
null, then it will contain:
- the modified statement if some modifications were required and no error occured (the function returns
nullif no modification to
stmtwere required and no erro occurred (the function returns
nullif an error occured (the function returns
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.
a place to store the new Statement, or
a Set to be used as parameters when executing