CSV Import - Set table column to fixed value


I'm trying to import a CSV file to an existing Oracle (v19c) table and I want to set a couple of columns to fixed values like:

  • “some string”
  • SYSDATE (Oracle pseudo-function for the current date/time)

The first row of the CSV file has the column names, and I've checked that option in DataGrip.

Then I edited the table column mapping, replacing the pre-selected CSV column name with the fixed value.

Datagrip loads the records, and reports no errors, but the table column value is always NULL.

I've tried surrounding the string value with nothing, single quotes (Oracle's standard) and double quotes. But the result is always the same; the table column is NULL.

And trying to use the SYSDATE function in a date field causes DataGrip to raise a system error, without saving any rows.

Is this possible, or does the CSV file layout have to match the database table definition exactly?



Could you please clarify if you need to insert values from CSV file or create table from CSV file?


I'm not sure if I understand your question. The first sentence of my post was:

> I'm trying to import a CSV file to an existing Oracle (v19c) table.

So I'm loading new records from the CSV file into a current table (without changing they table's definition). I want to set just a couple table columns with fixed values using either constant strings or Oracle functions (SYSDATE).

Thanks for your help.


You said “replacing the pre-selected CSV column name with the fixed value”. Could you please attach screenshot demonstrating it? If you change column name in mapping it doesn't change the values. If you need to insert some values, you may change them in CSV file.


Yaroslav Bedrov I just replied to your support email.

I thought I could simply change the mapping. It seems overly-burdensome to update the source CSV file since the column value will be a constant.

For others, this is what I'm trying to do:



If anyone's interested, Yaroslav's answer was: 

But mapping is about column mapping, not about values. It just says from which column in CSV file it should take data and into which it should be placed. Because you may have different namings in CSV file and DB table.

My response was:

  1. “It seems very limiting to expect that the CSV file columns will map one-to-one to database table column.”
  2. I asked him to submit this as a DataGrip enhancement request, since competitors' tools support this feature.

Please sign in to leave a comment.