If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: formatting dollar quoted copy

I am trying to write a pg plsqlfunction that will loop through a query and import CSV files but I cannot seem to get the formatting correct. what am I doing wrong here?
DECLARE
currenwholesaler RECORD;
csv_filename TEXT;
BEGIN
FOR currenwholesaler IN SELECT "id" as currentid FROM "public"."wholesalers" WHERE "import_type_id" IS NOT NULL LOOP
CSV
EXECUTE 'COPY product_import_temp FROM /home/action/'|| currenwholesaler.currentid ||'import.csv' ;
END LOOP;
END;