简体   繁体   中英

Query two databases in Monetdb

Im using monetdb and i have two databases on it "mydb" and "test".

I want to get a sub-set of values from 'mydb' into 'test'.

My code:

 insert into test.result 
select sum(chargfeeprepaid) from mydb.data where callingpartyno = 628388881507 
union 
select sum(chargefeeprepaid) from mydb.sms where callingpartyno = 628388881507;

This works fine in MySQL...but in Monetdb i get the error: INSERT INTO: no such scheme 'test'.

Where did i go wrong and what is the correct syntax to do this in monetdb?

Greetings Seleen

There is no way to do this in MonetDB. Every Database is served by it's own process (mserver) and there is no sharing between them.

If you want to migrate data from one database to another you have to either copy the data using the copy commands (see http://goo.gl/OXkto ) or dump the data as sql inserts using the dump commands ( http://goo.gl/5Bfrf and http://goo.gl/EuPwE ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM