Laravel雄辩的csv查询后退副本

时间:2019-03-06 08:18:09

标签: php laravel postgresql pdo

我想将数据从csv复制到运行以下sql查询的postgress:

DB::statement("\COPY marketo.leads FROM '/home/mark/dw_files/tests/leads.csv' DELIMITER ',' CSV HEADER;");

我得到了错误:

  

Illuminate \ Database \ QueryException:SQLSTATE [42601]:语法错误:7错误:“ \”或附近的语法错误   第1行:\ COPY从/home/mark/dw_files/tests/leads.cs复制marketo.leads ...           ^(SQL:\ COPY marketo.leads from'/home/mark/dw_files/tests/leads.csv'DELIMITER',CSV HEADER;)

     

由    PDOException:SQLSTATE [42601]:语法错误:7错误:“ \”或附近的语法错误    第1行:\ COPY从/home/mark/dw_files/tests/leads.cs复制marketo.leads ...            ^

尽管当我在psql中运行此查询时,它运行正常。

0 个答案:

没有答案