0

How to pass the path to the file name through the function argument? I'm trying to do it like this:

CREATE OR REPLACE FUNCTION sch.test11( file_nam text )
RETURNS void 
LANGUAGE 'plpgsql'

AS $BODY$ 
BEGIN
COPY temp_table(num,let,dis,last_n,oc,dt) 
FROM file_nam  DELIMITER ',' CSV HEADER encoding 'windows-1251';
END;
$BODY$;

But I have a function error when compiling (syntax error ( position: "file_nam"))

And I call this function like that

select * from sch.test11('D:\bd2.csv') 

0 Answers0