rafaelc
rafaelc

Reputation: 59284

MonetDB - How to call .SQL files from within SQL files?

How can I run .SQL files from other .SQL files using MonetDB?
I went through the whole documentation but had no success finding it.

For instance, in MySql I could do something like

parent.sql

use mydatabase;
source child1.sql
source child2.sql

child1.sql

SELECT * from Products;

child2.sql

SELECT * from Orders;

How can I do that (or something similar) using MonetDB?

Upvotes: 3

Views: 769

Answers (1)

Yaco Zaragoza
Yaco Zaragoza

Reputation: 437

To dump the SQL database, start the MonetDB SQL Client program and type the command

\>...\databasedump.sql
\D
\>

The path after > should be an absolute path name (i.e. start with a drive letter) and be in a save location. By default the database is located in %APPDATA%\MonetDB5. After having made a database dump it can be removed. This folder is located inside the dbfarm\demofolder.

Restoring the SQL database can be done using the MonetDB SQL Client program with the following command

\<...\databasedump.sql

Source: https://www.monetdb.org/Documentation/UserGuide/DumpRestore

Upvotes: 0

Related Questions