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

Discussion of open issues, suggestions and bugs regarding usage of ODBC Drivers
Post Reply
jgoemaat
Posts: 5
Joined: Mon 17 Dec 2018 23:08

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

Post by jgoemaat » Wed 06 Feb 2019 19:37

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 ...

MaximG
Devart Team
Posts: 1337
Joined: Mon 06 Jul 2015 11:34

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

Post by MaximG » Tue 12 Feb 2019 09:03

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.

jgoemaat
Posts: 5
Joined: Mon 17 Dec 2018 23:08

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

Post by jgoemaat » Tue 12 Feb 2019 16:51

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!

MaximG
Devart Team
Posts: 1337
Joined: Mon 06 Jul 2015 11:34

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

Post by MaximG » Tue 12 Feb 2019 19:17

Thanks for your comment. We are glad that you found the necessary solution. We will describe the detailed recommendations in our documentation shortly

Post Reply