How do I populate the database? source foo.sql?

I’ve tried several techniques to importing data, no success.

I don’t have much SQL, do I need to do something like “load infile”
through SQL to import data? Or, can I do something through rails with
the “source foo.sql” command, which looks promising but I, for one,
can’t
figure out the syntax :frowning:

[email protected] ~/goodfellow-tool/db $
[email protected] ~/goodfellow-tool/db $ sqlite3 development.sqlite3 <
data.sql
SQL error near line 1: near “/”: syntax error
[email protected] ~/goodfellow-tool/db $
[email protected] ~/goodfellow-tool/db $ cat data.sql
insert into db/development.sqlite3.calls (name) values (“goodfellow”);

[email protected] ~/goodfellow-tool/db $
[email protected] ~/goodfellow-tool/db $ source data.sql
bash: data.sql: line 1: syntax error near unexpected token (' bash: data.sql: line 1:insert into db/development.sqlite3.calls (name)
values (“goodfellow”);’
[email protected] ~/goodfellow-tool/db $
[email protected] ~/goodfellow-tool/db $
[email protected] ~/goodfellow-tool/db $ sqlite3 development.sqlite3
SQLite version 3.4.1
Enter “.help” for instructions
sqlite> .schema
CREATE TABLE calls (“id” INTEGER PRIMARY KEY NOT NULL, “start” integer
DEFAULT NULL, “end” integer DEFAULT NULL, “name” varchar(255) DEFAULT
NULL, “avaya_login” integer DEFAULT NULL);
CREATE TABLE schema_info (version integer);
sqlite> .quit
[email protected] ~/goodfellow-tool/db $

thanks,

Thufir

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs