Import Null Values

Database

Import Null Values

I have a Teradata table created for me to store massive amounts of imported data. At times I do not receive data for every field. I have 4 columns and I received a file with 835K distinct memberID numbers. The other 3 columns I have no data for. I am trying to do an

insert into mytable values (?,?,?,?);

Where the last ? is the data values I do have. The purpose is these memberID numbers will be used to query tables on the claims server to obtain the data for the 3 missing columns. My error is you have 4 parameters and 1 data and nothing will populate. If I put fake information in the 3 other columns, I get the same error message. Any advice?

3 REPLIES
Junior Contributor

Re: Import Null Values

insert into mytable (column4) values (?);

And don't forget to add COMPRESS to the remaining 3 columns.

Teradata Employee

Re: Import Null Values

Dieter,

Since NULLable column require a presence bit, are NULL values not compressed automatically? If not, what value is stored in the physical row when a column does have a NULL value?

Thanks

Junior Contributor

Re: Import Null Values

There's no automatic compression for NULLs. 

The stored value will be probably zero for numeric column, spaces for Chars and an empty string for Varchar.