This is an example of how you would upload data from a flat file,
or Comma Separated Value (CSV) file. It’s important to note that
in the file upload you are transferring information that doesn’t
have surrogate key values by leveraing joins inside a
MERGE
statement.
Step #1 : Create a virtual directory
You can create a virtual directory without a physical directory
but it won’t work when you try to access it. Therefore, you
should create the physical directory first. Assuming you’ve
created a /u01/app/oracle/upload
file directory on
the Windows platform, you can then create a virtual directory and
grant permissions to the student
user as the
SYS
privileged user.
The syntax for these steps is:
CREATE DIRECTORY upload AS '/u01/app/oracle/upload'; GRANT READ, WRITE ON DIRECTORY upload TO student;
Step #2 : Position your CSV file in the physical …
[Read more]