# While LOAD CSV getting error 'Neo.DatabaseError.Statement.ExecutionFailed'

**URL:** <https://community.neo4j.com/t/while-load-csv-getting-error-neo-databaseerror-statement-executionfailed/68132>\
**Category:** General\
**Tags:** load-csv\
**Created:** [May 28, 2024, 10:35am UTC](https://community.neo4j.com/t/while-load-csv-getting-error-neo-databaseerror-statement-executionfailed/68132 "2024-05-28T10:35:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sulabhagrawal01](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sulabhagrawal01](https://community.neo4j.com/u/sulabhagrawal01)\
**Post date:** [May 28, 2024, 10:35am UTC](https://community.neo4j.com/t/while-load-csv-getting-error-neo-databaseerror-statement-executionfailed/68132/1 "2024-05-28T10:35:48Z")

</div>

Hi,

While csv file LOAD I am getting below error for some quote at position, as below:

#### Neo.DatabaseError.Statement.ExecutionFailed

At [Dropbox](https://www.dropbox.com/scl/fi/ksc4ujiy07ykg0drpraz4/Call_Object.csv?rlkey=dqjwcxyw8r6hjl2y0d1qhkjzc&st=021qo8mn&dl=0) @ position 96611 - there's a field starting with a quote and whereas it ends that quote there seems to be characters in that field after that ending quote. That isn't supported. This is what I read: 'environment":'

Cypher:  
LOAD CSV WITH HEADERS FROM '[Dropbox](https://www.dropbox.com/scl/fi/ksc4ujiy07ykg0drpraz4/Call_Object.csv?rlkey=dqjwcxyw8r6hjl2y0d1qhkjzc&st=021qo8mn&dl=0)' AS row

MERGE (o:Object {objectName: row.ObjectName})  
SET  
o.objectApp = row.ObjectApp,  
o.objectType = row.ObjectType

Please suggest how to correct this ?

Thanks

---

<div class="post-metadata">

**Author:** ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)\
**Post date:** [May 28, 2024, 11:36am UTC](https://community.neo4j.com/t/while-load-csv-getting-error-neo-databaseerror-statement-executionfailed/68132/2 "2024-05-28T11:36:12Z")

</div>

I think the issue is in your data. Can you post it?

---

<div class="post-metadata">

**Author:** ![sulabhagrawal01](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sulabhagrawal01](https://community.neo4j.com/u/sulabhagrawal01)\
**Post date:** [May 28, 2024, 12:45pm UTC](https://community.neo4j.com/t/while-load-csv-getting-error-neo-databaseerror-statement-executionfailed/68132/3 "2024-05-28T12:45:59Z")

</div>

Above query have been resolved. Seems it was due to FIELDTERMINATOR , I created a comma seperated CSV, but when I pasted the sample data here, it appears instead of ',' it is '|'.  
But now I am facing another error:

#### Neo.ClientError.Statement.SemanticError

Cannot merge the following node because of null property value for 'objectId': (:Object {objectId: null})

Query:  
LOAD CSV WITH HEADERS  
FROM '[Dropbox](https://www.dropbox.com/scl/fi/3o700qwtx2daqrgqrd061/CallObject.csv)' AS row  
FIELDTERMINATOR '|'  
MERGE (o:Object {objectId: toInteger(row.ObjectId)})  
SET  
o.objectName = row.ObjectName,  
o.objectApp = row.ObjectApp,  
o.objectType = row.ObjectType

Sample Data:

| ObjectId | ObjectApp | ObjectName | ObjectType | ObjectDDM | DBCreate | DBRead | DBUpdate | DBDelete | ETBT |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | ABC | ADA001 | P | ABCD-INKASSO | | Y | | | |
| 2 | ABC | ADA02N01 | N | ABCD-INKASSO | | Y | | | |
| 3 | ABC | ADA02P01 | P | | | | | | |
| 4 | ABC | ADA10N06 | N | ABCD-UMSATZ | | Y | | | |
| 5 | ABC | ADAA001 | P | | | | | | |
| 6 | ABC | ADAA0010 | P | | | | | | Y |
| 7 | ABC | ADAA002 | P | | | | | | |
| 8 | ABC | ADAA003 | P | ABCD-BEARBSCHR | | Y | | | Y |
| 9 | ABC | ADAA009 | P | | | | | | Y |
| 10 | ABC | ADAA01 | P | ABCD-BEARBSCHR | ABCD-INKASSO | | Y | | |

Could you please suggest.

Thanks

---

<div class="post-metadata">

**Author:** ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)\
**Post date:** [May 28, 2024, 4:39pm UTC](https://community.neo4j.com/t/while-load-csv-getting-error-neo-databaseerror-statement-executionfailed/68132/4 "2024-05-28T16:39:28Z")

</div>

You can not merge nodes with null values for the match properties. You can either skip these nodes in your import or set a default value using coalesce.

You can skip with a 'with' and 'where' clause following your 'Load with csv' and before the 'merge'.

---

<div class="post-metadata">

**Author:** ![sulabhagrawal01](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sulabhagrawal01](https://community.neo4j.com/u/sulabhagrawal01)\
**Post date:** [May 28, 2024, 5:19pm UTC](https://community.neo4j.com/t/while-load-csv-getting-error-neo-databaseerror-statement-executionfailed/68132/5 "2024-05-28T17:19:45Z")

</div>

Can you can see in above data there is no null value in ObjectId column, also I have used both the options:

```auto
LOAD CSV WITH HEADERS
FROM 'Dropbox' AS row
FIELDTERMINATOR '|'
WITH row WHERE row.ObjectId IS NOT NULL
MERGE (o:Object {objectId: toInteger(row.ObjectId)})
SET
o.objectName = row.ObjectName,
o.objectApp = row.ObjectApp,
o.objectType = row.ObjectType

```

and

```auto
MERGE (o:Object {objectName: COALESCE(row.ObjectId, '9999')})

```

still the same issue.

Then I tried below cypher:

```auto
LOAD CSV FROM 'Dropbox' AS row
RETURN row limit 1

```

and this returns

[""]  
.

Seems there is some issue with my csv file, but I have tried everything, not getting what I am missing.  
Could you please check below csv file and suggest what I missed.

[CSV File](https://www.dropbox.com/scl/fi/iuwtp81uxkdaprethpenz/CallObject.csv?rlkey=mqgmer0zo4lbywuzpzmuzwpoj&st=g0410xao&dl=0)

Thanks

---

<div class="post-metadata">

**Author:** ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)\
**Post date:** [May 28, 2024, 5:51pm UTC](https://community.neo4j.com/t/while-load-csv-getting-error-neo-databaseerror-statement-executionfailed/68132/6 "2024-05-28T17:51:12Z")

</div>

When I click on the "CSV File" to view the file in your dropbox, I am presented with a grid that has the 'id' in a column without a header. It looks like a generated row counter. The file does not contain that column when downloaded, thus it does not have the ObjectId column in the data your are loading.

 ![Screen Shot 2024-05-28 at 1.46.42 PM](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/5/8/585134bba45bc6393fc044785364e7220838397f.png)

 ![Screen Shot 2024-05-28 at 1.47.23 PM](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/0/b/0bfb874d3ee7564ecd51638961b444fb593ebe3f.png)

I suggest you create a column in your spreadsheet for ObjectId and fill it with a series.
