"ERROR...[ODBC Redshift Wire Protocol driver]...Cannot insert a NULL value into column" occurs if you haveĀ NULLCHAR=SAS and DBNULL=NO enabled


When you have NULLCHAR=SAS and DBNULL=NO enabled, the following error could be returned:

ERROR: During insert: [SAS][ODBC Redshift Wire Protocol driver][Redshift]
ERROR: Cannot insert a NULL value into column

This issue is due to a driver configuration option, Extended Column Metadata, that is disabled by default. Enabling this option circumvents the error.

In Windows environments, this option is available in the ODBC data source configuration on the Advanced tab. To ensure that the option is enabled, select the Extended Column Metadata option.

In Linux environments, you add ExtendedColumnMetadata=1 to the data source in your odbc.ini file to enable this option.

In a connection that does not contain DSN, you add CONOPTS="ExtendedColumnMetadata=1" to the LIBNAME statement to enable this option.

If this issue persists after you have enabled the Extended Column Metadata option, contact SAS Technical Support.