load a .sql file into vertica
Guys,
How do i load the schema, data and all other constraints from a .sql file.
I am trying to install the mysql sample database file which is in a .sql format.
While i was installing VMart database, i saw a lot of sql files which i guess were being called by the script.
How do i do it manually?
regards,
Anmol
http://www.mysqltutorial.org/wp-content/uploads/downloads/2013/05/mysqlsampledatabase1.zip
0
Comments
Following syntax should help you:
1. From linux shell:
/opt/vertica/bin/vsql -f "./test.sql" -U dbadmin -w password
2. From VSQL:
vsql=> \i '/home/dbadmin/test.sql'
Thee examples assumes that sql file is named as "test.sql". Hope this helps.
Thanks,
Pravesh
The following can be achieved using vsql utility by Vertica.
To work with vsql
1.If you are a dbadmin user, you can do a man command for vsql. 2.For more help on working with vsql
https://my.vertica.com/docs/7.0.x/HTML/index.htm#Authoring/ProgrammersGuide/vsql/CommandLineOptions....
3. For more help on vsql
Hope this helps
As for the data i suggest you dump it into a csv file and load it via copy command !