rewrite_sql_statement_for_null_parameters


Description:


[ Version ( since = "4.2.9" ) ]
public SqlStatement? rewrite_sql_statement_for_null_parameters (owned SqlStatement sqlst, Set @params, out bool out_modified) throws Error

Modifies sqlst to take into account any parameter which might be null: if sqlst 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.

If out_modified is not null, then it will be set to true if sqlst has been modified by this function, and to false otherwise.

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.

Parameters:

sqlst

a SqlStatement

out_modified

a place to store the boolean which tells if stmt has been modified or not, or null

params

a Set to be used as parameters when executing stmt

Returns:

the modified sqlst statement, or null if an error occurred


Namespace: Gda
Package: libgda-6.0