Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-20-2019 06:01 PM
I have been trying not for 24hrs to get these CSV loaded with a relationship. However it keeps hanging on:
Neo.ClientError.Statement.SyntaxError: Invalid input 'S': expected 'n/N' (line 1, column 384 (offset: 383))
Initially when I wasn't using the " USING PERIODIC COMMIT" I was running into memory issues. After some research the USING PERIODIC COMMIT should solve the memory issue. which seems it did.
the import was written:
USING PERIODIC COMMIT LOAD CSV with headers from "file:///unit2.csv" as unitRow create (:rigs {UnitID: unitRow.Unit, Rigname: unitRow.Rigname, Region: unitRow.Region, Status: unitRow.Status, UnitType: unitRow.type, MaxInventoryValue: unitRow.MAX_ALLOWD_VAL, Client: unitRow.client, Regulations: unitRow.Local_Reg, Latitude: unitRow.latitude, Longitude: unitRow.longitude}); WITH * USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM "file:///masterinventory.csv" as ventRow create (riginventory:RigInventory {ItemID: ventRow.Item, LongDescription: ventRow.LongDescription, QtyOnHand: ventRow.QtyOnHand, UnitPrice: ventRow.UnitPrice, UsageQty: ventRow.UsageQty, Area: ventRow.Area, Lev1: ventRow.Lev1, Lev2: ventRow.Lev2, Lev3: ventRow.Lev3, Lev4: ventRow.Lev4, RigUnit: ventRow.Unit}) with riginventory Match (u:Rigs {UnitID : riginventory.RigUnit }) Create (u)-[:HOLDS_STOCK]->(riginventory)
I was hoping somebody can help in the right direction. Many thanks.
Solved! Go to Solution.
11-22-2019 02:48 AM
Most of Neo4J is case sensitive
For example
Label :Person is different than :person
11-21-2019 05:17 AM
your inclusion of WITH *
as the start of the 2nd statement is causing failure. I'm not sure what is trying to be accomplished with this WITH *
but if it is removed then the statement will run and no longer produce a syntax error
11-21-2019 02:39 PM
Thanks that worked. However it didn't work in the default browser. I used the Canary browser and that worked ok. However there relationship wasn't created. Thanks for the feedback
11-21-2019 04:52 PM
I spoke too soon.It looked like it worked but it only loads the 118 nodes, but all are empty. I checked the CSV with a tool and came back ok. so I am doing something wrong. I am just focusing on the first statement.
USING PERIODIC COMMIT LOAD CSV with headers from "file:///unit2.csv" as unitRow create (:Rigs {UnitID: unitRow.Unit, Rigname: unitRow.Rigname, Region: unitRow.Region, Status: unitRow.Status, UnitType: unitRow.type, MaxInventoryValue: unitRow.MAX_ALLOWD_VAL, Client: unitRow.client, Regulations: unitRow.Local_Reg, Latitude: unitRow.latitude, Longitude: unitRow.longitude})
Also tried FIELDTERMINATOR. but made no difference.
11-21-2019 05:59 PM
Okay figured it out. Good learning curve , The statement with LOAD CSV is case sensitive, meaning if the column headers in the CSV are uppercase the Statement needs to be UPPERCASE too. All loaded perfectly.. now the fun part starts
11-22-2019 02:48 AM
Most of Neo4J is case sensitive
For example
Label :Person is different than :person
All the sessions of the conference are now available online