Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Table using Local CSV File

I have the following query to create a table however the file name is located on my local machine (as I don't have access to the Oracle Box) how can I use a local file to create a table on the Oracle Database). All the examples I have seen assume the file is located on the Oracle Database Server.

CREATE OR REPLACE DIRECTORY file_dir AS 'c:/temp';
GRANT WRITE ON DIRECTORY file_dir TO CPS_OWNER;

create table CPS_OWNER.TEMP_TOGGLE_LIST (
      USER_ID varchar2(30)   
    )
    organization external (
      type oracle_loader
      default directory file_dir
      access parameters (records delimited by newline fields)
     location ('users.csv')
  )
  reject limit unlimited;
like image 263
Dritzz Avatar asked Dec 10 '22 21:12

Dritzz


1 Answers

Right click in SQL Developer on the Tables node in the connection tree.

Where to click

Select 'Import Data'

Point to your CSV file.

Go through the wizard.

I talk about this in detail with screenshots here.

Or, watch the Movie.

like image 124
thatjeffsmith Avatar answered Dec 28 '22 07:12

thatjeffsmith