This code demonstrates how to upload files into SQL. The files should begin as a
.csv file, typically from a dataframe.
Useful rescources with more detail:
A. Format File - prepare the file for upload into SQL database by changing its format into a pipe-separated (
B. Create Database - enter the GRID (or SecureCRT) and use the following commands on the command line interface.
create table table_import (Column_1 char(20), Column_2 char(20), Column_3 char(20));- this command should have also appeared in the file formatter above
Create Import Directory
chmod 700 /export/mdb_external/import/username
pwd#Get the full directory of your desktop where your file is returns for example:
mv /export/home/rcsguest/rcs_username/Desktop/SampleData.txt /export/mdb_external/import/username
load data local infile '/export/mdb_external/import/username/SampleData.txt' into table table_import fields terminated by '|' lines terminated by '\n' ignore 1 lines;
SELECT * FROM TABLENAME;
Remove temp-import files & folder