I am trying to load a CSV file, but getting below 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' 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 |
|
|
Initially I was below issue:
Neo.DatabaseError.Statement.ExecutionFailed
At Dropbox @ position 96538 - 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":'
For which I added
FIELDTERMINATOR '|'
Which resolve the error, but now I am facing null property error.
I am trying to create Nodes for all the object names.
Please suggest.
Thanks
What about:
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
Already tried this.
Error has gone, but nothing happened.
(no changes, no records)
Try this:
LOAD CSV WITH HEADERS
FROM 'Dropbox' AS row
FIELDTERMINATOR '|'
RETURN row limit 1
So you can see how the csv is parsed and what the column headers are. Likely you have a spelling misstake and ObjectId is objectId or something like that (case sensitive, so get it right, it may also be a tailing space in the column name, so you may have to do row["ObjectId "] or row.ObjectId )
Something totally unexpected came in return:
{
"": ""
}
Now I am more worried and confused. But this explains my previous error.
Please suggest how can I resolve this in my csv file.
Data looks fine.
You can always start from here:
LOAD CSV FROM 'Dropbox' AS row
RETURN row limit 1
To see if the database can access the file at all. Then you add in "with header" and the right "fieldterminator".
Thanks.
It seems there is some issue with my csv file but I am not getting it.
I created it again but still the same issue.
CSV File
Could you please help me out with above CSV file, and suggest what I am missing.
Thanks