[Solved] Inserting records from csv

Creating tables and queries

[Solved] Inserting records from csv

Postby jza » Wed May 24, 2017 2:00 am

I have a CSV and want to insert its data into a ODB table. I tried the SQL statements and can't use INSERT INTO... also tried just copy pasting but didnt work for multiple records. Any other ideas.
Last edited by Hagar Delest on Sun May 28, 2017 9:03 pm, edited 2 times in total.
Reason: tagged [Solved].
AOO 4.1.1 on Arch Linux
User avatar
jza
 
Posts: 239
Joined: Mon Nov 03, 2008 11:33 am
Location: Cancún, Mexico

Re: Inserting records from csv

Postby Villeroy » Wed May 24, 2017 1:27 pm

Depends on the csv.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 25384
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Inserting records from csv

Postby charlie.it » Wed May 24, 2017 6:48 pm

jza wrote:I have a CSV ...

Ciao, can we see the file?
charlie
macOS 10.12 Sierra: Open Office 4.1.5 - LibreOffice 5.4.3.2
Windows 7 pro (VirtualBox): Open Office 4.1.5 - LibreOffice 5.4.4.2
Ubuntu 17.04 LTE (VirtualBox): LibreOffice 5.1.6.2
http://www.charlieopenoffice.altervista.org
User avatar
charlie.it
Volunteer
 
Posts: 292
Joined: Wed Aug 21, 2013 2:12 pm
Location: Italy

Re: Inserting records from csv

Postby jza » Wed May 24, 2017 9:35 pm

Thanks I solved it by adding the whole SQL sentence to each row.
AOO 4.1.1 on Arch Linux
User avatar
jza
 
Posts: 239
Joined: Mon Nov 03, 2008 11:33 am
Location: Cancún, Mexico

Re: Inserting records from csv

Postby Villeroy » Wed May 24, 2017 11:26 pm

I don't understand. Would you mind to share your solution with us?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 25384
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Inserting records from csv

Postby jza » Wed May 24, 2017 11:43 pm

I insert the cv fields withing the VALUES() of the INSERT INTO table (column...) VALUES (csv-values....)
AOO 4.1.1 on Arch Linux
User avatar
jza
 
Posts: 239
Joined: Mon Nov 03, 2008 11:33 am
Location: Cancún, Mexico


Return to Tables & Queries

Who is online

Users browsing this forum: No registered users and 2 guests