Hi y'all
I use an INSERT SQL statement with revExecuteSQL and I use placeholders to fill in the values.
One of the values needs to be (SQL) NULL.
Unfortunately, "empty" and "null" are not SQL NULL, so my query inserts either an empty string or a \0.
How to insert NULL with revExecuteSQL with placeholders?
How to insert NULL in a placeholder?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 7
- Joined: Tue Aug 18, 2015 7:25 am
Re: How to insert NULL in a placeholder?
I guess I found a pretty good solution myself (sorry, this usually happens *after* asking others for help )
I just set the placeholder itself to "NULL", using: (assume placeholder 6 is the one that should be NULL)
I just set the placeholder itself to "NULL", using: (assume placeholder 6 is the one that should be NULL)
Code: Select all
if tParams[6] is empty then
replace ":6" with "NULL" in tSQL
end if