Sqlite3: create a database from file using one line command-line script

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Sqlite3: create a database from file using one line command-line script

kostasvgt
Hi, I need to run a command to create a database and populate it from a
.sql file at once from command-line, not dot-commands.
Is there any way to do this in one line?

Thanks.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sqlite3: create a database from file using one line command-line script

Donald Griggs
sqlite3  myDatabase.db  ".read myCommands.sql"


On Wed, Feb 6, 2019 at 3:30 PM kostasvgt <[hidden email]> wrote:

> Hi, I need to run a command to create a database and populate it from a
> .sql file at once from command-line, not dot-commands.
> Is there any way to do this in one line?
>
> Thanks.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sqlite3: create a database from file using one line command-line script

Keith Medcalf
In reply to this post by kostasvgt

sqlite3 database.db < myscript.sql


---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.


>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>[hidden email]] On Behalf Of kostasvgt
>Sent: Wednesday, 6 February, 2019 12:47
>To: [hidden email]
>Subject: [sqlite] Sqlite3: create a database from file using one line
>command-line script
>
>Hi, I need to run a command to create a database and populate it from
>a
>.sql file at once from command-line, not dot-commands.
>Is there any way to do this in one line?
>
>Thanks.
>_______________________________________________
>sqlite-users mailing list
>[hidden email]
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users