Page 1 of 1

Windows ODBC Drivers for BigCommerce - cannot set CustomerGroupId to Null (must be 0)

Posted: Wed 06 Feb 2019 19:37
by jgoemaat
Hello!

Maybe this is by design, but while I am able to set a value for Customers.CustomerGroupId (such as 1), I am not able to remove members from that group by clearing out that value, such as setting it to Null.

Code: Select all

UPDATE Customers SET Customers.CustomerGroupId = Null WHERE BC_Customers.Email='test.user@company.com';
After some experimentation, I saw the BigCommerce API returns a "0" for group (if they are not in a group), yet it's confusing as Access or a SQL SELECT query shows an empty value for Customers.CustomerGroupId which I think should be 0.

So I found I can set the Group to 0 and does work.

Code: Select all

UPDATE Customers SET Customers.CustomerGroupId = 0 WHERE BC_Customers.Email='test.user@company.com';
Just thought I would pass this along ...

Re: Windows ODBC Drivers for BigCommerce - cannot set CustomerGroupId to Null (must be 0)

Posted: Tue 12 Feb 2019 09:03
by MaximG
Indeed, it is one of the features of our driver's behavior. Such implementation helps to avoid the '"fieldname" does not allow null values' error that appears when Null values while updating the "fieldname" field are explicitly specified.

Re: Windows ODBC Drivers for BigCommerce - cannot set CustomerGroupId to Null (must be 0)

Posted: Tue 12 Feb 2019 16:51
by jgoemaat
Thanks for the reply! Would be nice to have it documented that a 0 (zero) value needs put in the Customers.CustomerGroupId field to perform an insert as there is no descriptive error returned - took a bit of troubleshooting to figure that out. Or maybe I missed that in the documentation?

Thank you!

Re: Windows ODBC Drivers for BigCommerce - cannot set CustomerGroupId to Null (must be 0)

Posted: Tue 12 Feb 2019 19:17
by MaximG
Thanks for your comment. We are glad that you found the necessary solution. We will describe the detailed recommendations in our documentation shortly