3

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?

rafaelc
  • 57,686
  • 15
  • 58
  • 82

1 Answers1

0

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

Yaco Zaragoza
  • 429
  • 1
  • 7
  • 18
  • Please update your question to have some more details – Yaco Zaragoza Dec 28 '15 at 18:40
  • I don't know what else I could write. I guess its fine to understand. What you wrote works, but how do I call another SQL file from within the `databasedump.sql` that you mentioned? – rafaelc Dec 28 '15 at 18:52
  • 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. – Yaco Zaragoza Dec 28 '15 at 19:17