On Tue, 15 Mar 2005, Celia McInnis wrote:
> In a plpgsql procedure is there any way to form an insert command which has
> some null values for values of the inputs?
>
> Currently when I form such a command, the command becomes null if there are
> any null values inserted for the fields.
Are you making a query string for execute?
Something like:
querystring := 'insert into foo(col1) values (' || variable || ')';
won't work if variable is null. You'd probably need something like:
querystring := 'insert into foo(col1) values (' ||
COALESCE(variable,'NULL') || ')';