On 2012-07-25 15:32, li, xiaohua wrote:
Hi all: we want to copy a txt file into a remote monetdb (windows). if we copy into local monetdb via ipaddress, it's OK. but if we copy the same txt file into a remote monetdb, it can't.
Error: could not open file 'd:\\share\\book1.csv': Operation not permitted SQLState: 22000 ErrorCode: 0
what's the problem? is it a bug? or something we don't know?
lixiaohua Shanghai,China
Assuming you use something like COPY INTO t FROM 'd:\\share\\book1.csv' ... then the mserver has to be able to read the file using that path. If you're logged into the mserver with an account other than monetdb, this will not be allowed for security reasons. If you do this remotely (i.e. the server runs on a different system than mclient), the server will try to read the file on it's system, not mclient's system. If you want a remote mserver to read a file on the same host as where mclient is running, you have to send the file through mclient (which is a bit tricky on Windows). Start by looking at http://www.monetdb.org/Documentation/Cookbooks/SQLrecipies/LoadingData and the manual page at http://www.monetdb.org/Documentation/mclient-man-page on how this can be done. You'll need to use the mclient.bat script instead of the mclient.exe binary and run all of this from a cmd window. The description is written with Linux in mind, but something very similar should also work on Windows. You may have to specify a -E option (see the manual). -- Sjoerd Mullender