Hi kindly correct me the following code
CREATE OR REPLACE FUNCTION dataimport()
RETURNS void AS
$BODY$
DECLARE

t_name RECORD;

BEGIN
FOR t_name IN
SELECT
c.relname
FROM
pg_catalog.pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE
c.relkind = 'r'
AND n.nspname = 'public'
ORDER BY 1

LOOP

copy t_name.relname from E'C:\\bcp\\'|| t_name.relname||'.txt' using delimiters '|'

END LOOP;

END;
$BODY$
LANGUAGE 'plpgsql';

i am getting following error
ERROR: syntax error at or near "$1"
LINE 1: copy $1 from E'C:\\bcp\\'|| $2 ||'.txt' using delimiters ...