0

I want to load data from a CSV file, using UTL_FILE, but an error has occurred (see below), please note that I'm connecting to the database remotely and the CSV file is in my local machine.

29283. 00000 -  "invalid file operation"
*Cause:    An attempt was made to read from a file or directory that does
           not exist, or file or directory access was denied by the
           operating system.
*Action:   Verify file and directory access privileges on the file system,
           and if reading, verify that the file exists.

Is it necessary to put the CSV file where the DB is mounted?

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
AbdeAMNR
  • 165
  • 1
  • 5
  • 18
  • Possible duplicate of [Ora-29283 error on 11g](https://stackoverflow.com/questions/40481993/ora-29283-error-on-11g) – Luke Woodward Jan 09 '19 at 21:29
  • I understand that the Oracle 11g can only access files on the server where the DB is Mounted but is there any other way to load data from a CSV file using pl/SQL without depending on a third party programming language? – AbdeAMNR Jan 09 '19 at 22:41
  • Can't you just create an external tables, based on the csv file and take it from there on? There's an excellent article here -> https://oracle-base.com/articles/9i/external-tables-9i. – g00dy Jan 10 '19 at 07:00

1 Answers1

1

If the file is local to your machine, your options are:

  • transfer the file to the server, or
  • make a location on your machine visible/mountable by the server, or
  • use a client tool to load the data from your machine to the server

Assuming we'll be going with the last one, you can do this with:

SQL Developer - Expand the "Tables" tab, right click on your table and choose Import

SQL Loader - SQL Loader can be run locally (assuming you have the Oracle client) installed on your machine

Plenty of SQL Loader examples on https://asktom.oracle.com, or via the standard documentation

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sutil/oracle-sql-loader.html

Connor McDonald
  • 10,418
  • 1
  • 11
  • 16