emacs-libpq icon indicating copy to clipboard operation
emacs-libpq copied to clipboard

How to UPDATE table SET column = NULL with the NULL as parameter?

Open gnusupport opened this issue 3 years ago • 1 comments

I would like to provide parameter NULL to:

UPDATE table SET column = $1

And currently providing "NULL" as string does not work. Is there any existing solution?

gnusupport avatar Jun 26 '22 06:06 gnusupport

	(rcd-sql "INSERT INTO businesses (businesses_company, businesses_name, businesses_description,
                                          businesses_url, businesses_tag1, businesses_tag2, businesses_tag3)
                  VALUES ($1, $2, $3, $4, $5, $6, $7)"
		 cf-db company name description url tag-1 tag-2 tag-3)

If tag-1 above is nil then it would b good for emacs-libpq to understand nil as NULL as there is now way to provide NULL as parameter. It means I have to use format before providing SQL to module.

IMHO it is better providing parameters to module rather than using format.

gnusupport avatar Sep 11 '22 05:09 gnusupport