[MonetDB-users] Insert query into second database

Fabian Groffen Fabian.Groffen at cwi.nl
Mon Oct 17 19:40:54 CEST 2011


On 17-10-2011 07:22:06 -0700, Seleen wrote:
> Hello, 
> I have two databases  "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 = 200
> union 
> select sum(chargefeeprepaid) from mydb.sms where callingpartyno = 300;"
> 
> 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?

You cannot do this with MonetDB.  Databases are separate parts that have
no connection to each other.  You better use different schemas to do
this, if you don't have resource-wise constraints on the separation of
both tables mydb and test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: Digital signature
URL: <http://www.monetdb.org/pipermail/users-list/attachments/20111017/1046e7a9/attachment.sig>


More information about the users-list mailing list