Search code examples
windowsmonetdb

importing tbl file to monetDB on windows 10


I am having trouble importing the data of the TPCH-Benchmark (generated with dbgen) into my monetDB-Database. I've already created all the tables and I'm trying to import using the following command:

COPY RECORDS INTO region FROM "PATH\region.tbl" DELIMITERS tuple_seperator '|' record_seperator '\r\n';

And I get the following error message:

syntax error, unexpected RECORDS, expecting BINARY or INTO in: "copy records"

I also found out this one on the internet:

COPY INTO sys.region 'PATH/region.tbl' using delimiters '|','\n';

But I get the following error message:

syntax error, unexpected IDENT, expecting FROM in: "copy into sys.region "C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\region."

Because I'm a new monetDB user I'm not getting

What I'm doing wrong ?

Any help will be appreciate :)


Solution

  • The RECORDS construct expects a number, specifically how many records you are to load. I usually do this:

    COPY 5 RECORDS INTO region FROM '/path/to/region.tbl' USING DELIMITERS '|', '|\n' LOCKED;
    

    Also in the second attempt you are missing a FROM before the path to the file like

    COPY INTO sys.region FROM '/path/to/region.tbl' USING DELIMITERS '|', '\n';
    

    See here for more information: https://www.monetdb.org/Documentation/Manuals/SQLreference/CopyInto