How to import an CSV file into a table with PL/SQL procedure
931440Apr 18 2012 — edited Apr 19 2012hi,
I have an CSV file and i would like to import in a table from my database with a procedure in pl/sql. I search for this on forum and I found something like this
DECLARE @bulk_cmd varchar(1000)
SET @bulk_cmd = 'BULK INSERT name_database.table FROM ''C:\file.csv'' WITH (ROWTERMINATOR = '''+CHAR(10)+''')';
EXEC(@bulk_cmd);
or
'BULK INSERT name_database.table
FROM ''C:\file.csv''
WITH (ROWTERMINATOR = '''+CHAR(10)+''')'
but it doesn`t work. It works with PL/SQL import from txt file,etc.., but I want a procedure to include in my program.
Any suggestions or solutions?
Thx.