JoseKilo
JoseKilo

Reputation: 2463

Insert NULL in Google Cloud SQL using CSV import

I am importing CSV files into Google Cloud SQL using its import functionality. It allows to import data into a Cloud SQL table.

API reference: https://cloud.google.com/sql/docs/admin-api/v1beta4/instances/import

If I use a CSV row with empty values, like:

,,,,42,,

I am getting 0 values in the SQL table. I would like to get NULL values instead. Is it possible ?

Upvotes: 6

Views: 961

Answers (1)

sonium
sonium

Reputation: 1072

I found it to work using NULL as a field value:

"gid://Customer/10031988754",0,0,"GBP","[]","GB"
"gid://Customer/1003793973310",0,NULL,NULL,"[]","GB"

this was unexpected, since CSV export generates entries with "N as NULL

Upvotes: 0

Related Questions