Aw: Re: Problem with COPY INTO

Martin Kersten martin.kersten at cwi.nl
Fri Apr 15 00:16:54 CEST 2016


A linefeed is not the same as '\n' !!

On 15/04/16 00:13, Knezevic Nikola wrote:
> Hi Martin,
>
> Thanks for the tip, but I get nothing (I also tried playing with different delimiters, just to be sure)
>
> % mclient -d some_db -s "COPY 15 RECORDS INTO errortable FROM STDIN USING DELIMITERS '\t','\n','\r','\'' best effort;" - <test.out
> syntax error, unexpected ',', expecting SCOLON in: "copy 15 records into errortable from stdin using delimiters '\t','\n','\r',"
> syntax error, unexpected sqlINT in: "100"
> % mclient -d some_db -s "COPY 15 RECORDS INTO errortable FROM STDIN USING DELIMITERS '\t','\n','\r' best effort;" - <test.out
> 14 affected rows
> syntax error, unexpected sqlINT in: "5"
> % mclient -d some_db -s "COPY 15 RECORDS INTO errortable FROM STDIN USING DELIMITERS '\t','\r','\'' best effort;" - <test.out
> 0 affected rows
>
> mclient -u monetdb -d some_db
> password:
> Welcome to mclient, the MonetDB/SQL interactive terminal (Jul2015-SP4)
> Database: MonetDB v11.21.19 (Jul2015-SP4), 'mapi:monetdb://internal:50000/some_db'
> Type \q to quit, \? for a list of available commands
> auto commit mode: on
> sql>select * from sys.rejects;
> +-------+-------+---------+-------+
> | rowid | fldid | message | input |
> +=======+=======+=========+=======+
> +-------+-------+---------+-------+
> 0 tuples (1.779ms)
> sql>select * from some_db.errortable;
> +--------------+------+
> | rejectreason | text |
> +==============+======+
> +--------------+------+
> 0 tuples (1.851ms)
>
>
> % mclient -d some_db -s "COPY 15 RECORDS INTO errortable FROM STDIN USING DELIMITERS '\t','\n','\'' best effort;" - <test.out
> 14 affected rows
> syntax error, unexpected sqlINT in: "5"
>
> Lines in the file are delimited by 0x0a (LF) and columns with 0x09 (TAB).



More information about the users-list mailing list