Copying an ASCII file to data table : File to Table « Table « PostgreSQL






Copying an ASCII file to data table


CREATE TABLE employee (
    ID         int,
    name       varchar(10)
);

select * from employee;
/*
file: subjects.sql
1,Joe
2,Alison
3,Jess
*/
-- Copying an ASCII file

COPY subjects FROM 'c:\\subjects.sql'
               USING DELIMITERS ',' WITH NULL AS '\null';

drop table employee;
           
       








Related examples in the same category

1.Copies data from a system file into the publishers table