Wednesday, September 15, 2010

DB2 Basic Commands

1) To import data from a csv file to a table in database:
import from C:\testfile.csv of del insert into workemployee
2) To export data to a csv file from a table in database:
export to C:\names.csv of del select * from names
3) To connect to db2 database
connect to database_name user user_id using pwd
4) To set the schema for accessing the tables under a schema
set current schema schema_name
5) To list all tables under the schema or in general to list all tables. Two ways of doing the same.
- list tables for schema schema_name
- list tables

No comments: