SQL Assistant Insert null with Import of pipe delimited file

Tools

SQL Assistant Insert null with Import of pipe delimited file

From an excel file I concatenate the columns with a pipe between the columns. I import the .txt file in SQL Assistant (version 12.0). If there is no value I'm getting spaces in the teradata table. How do I change my Insert so that I get a NULL in the table column?

.txt file:
aaa|100||doe
bbb|200|debbie|jones

CREATE SET TABLE DB_NAME.sss_testnull ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL
(
id1 varchar(3) character set latin not casespecific,
customer1 varchar(10) character set latin not casespecific,
first_name varchar(20) character set latin not casespecific,
last_name varchar(40) character set latin not casespecific
)
UNIQUE PRIMARY INDEX ( id1)

insert db_name.sss_testnull(?,?,?,?)

select
*
from db_name.sss_testnull
order by id1

Result of select:
id1 customer1 first_name last_name
aaa 100 doe
bbb 200 debbie jones

I want a NULL (?) for first_name of id1=aaa.
Tags (1)
2 REPLIES
Junior Supporter

Re: SQL Assistant Insert null with Import of pipe delimited file

Take a look at NULLIF.

HTH.

Cheers.

Carlos.

Re: SQL Assistant Insert null with Import of pipe delimited file

I tried, but haven't got the right syntax. How would I code the insert statement?