首页 > 解决方案 > How to insert csv file to postgresql using jmeter

问题描述

i'm trying to insert CSV data file to POSTGRESQL from JMETER using "LOAD DATA" statement. But LOAD DATA statement won't working. On the internet load statement becoming highlighted and working but on my machine its not becoming highlighted and getting error on it.

Here is my SQL query:

"LOAD DATA INFILE '/Desktop/Summary/oca_sum.csv' INTO TABLE Load FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' "

And error is:

org.postgresql.util.PSQLException: ERROR: syntax error at or near "DATA" Position: 6

Thanks.

标签: sqlpostgresqljmeter

解决方案


You are trying to run a MySQL command against a PostgreSQL database.

PostgreSQL uses a different syntax for accomplishing the same task.


推荐阅读