Friday, June 12, 2009

Basic DB2 commands - I

We use the IBM DB2 Control Center for a variety of reasons, mostly to look at data through some simple SQL queries.

Control Center has a number of neat commands that can help save time. It should be noted however, that the reasons for using these commands should NOT be intended to replace ETL workflows which can be scheduled on a regular basis to do the necessary updates.

Consult the DB2 manual for more commands or other examples.

CREATE

To create a table:

CREATE TABLE > like <> in <> INDEX IN <>;

INSERT

If you want to insert records into a table from another table:

INSERT INTO <> SELECT * FROM <> WHERE <>;


DELETE

To delete records from a table:

DELETE FROM <> WHERE <>;

No comments:

Post a Comment