0% found this document useful (0 votes)
181 views

Example of Edbldr

This document provides an example of using EDB Loader (edbldr) to load data from a CSV file into a PostgreSQL database table. It shows the structure of the CSV file with sample data and the associated CTL file used to define the load process. Running the edbldr command loads the data from the CSV file into the city_1 table in the test database, and confirms that 3 records were processed successfully. A query on the new city_1 table then displays the data that was loaded.

Uploaded by

Ravindra Malwal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
181 views

Example of Edbldr

This document provides an example of using EDB Loader (edbldr) to load data from a CSV file into a PostgreSQL database table. It shows the structure of the CSV file with sample data and the associated CTL file used to define the load process. Running the edbldr command loads the data from the CSV file into the city_1 table in the test database, and confirms that 3 records were processed successfully. A query on the new city_1 table then displays the data that was loaded.

Uploaded by

Ravindra Malwal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

example of edbldr =

smaple .csv file:

city.csv

nashik,MH,2000

pune,MH,3000

bhopal,MP,2000

sample of .ctl file:

city.ctl

LOAD DATA

INFILE 'city.csv'

BADFILE 'city.bad'

insert

INTO TABLE city_1

FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'

TRAILING NULLCOLS

(name,state,public)

insert data into city_1 table(database test)

[enterprisedb@localhost ~]$ edbldr -d test control=city.ctl bad=city.bad log=city.log

EDB*Loader: Copyright (c) 2007-2017, EnterpriseDB Corporation.

Enter the user name : enterprisedb

Enter the password :

Successfully processed (3) records

[enterprisedb@localhost ~]$ edb-psql -d test -U enterprisedb

psql.bin (10.1.5)

Type "help" for help.

test=# select * from city_1;

name | state | public

--------+-------+--------

nashik | MH | 2000
pune | MH | 3000

bhopal | MP | 2000

(3 rows)

test=# exit

You might also like