Ask Your Question
3

What steps are required to create a table in db2, using AS and indicating the tablespace?

asked 2023-05-08 04:54:14 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-05-08 05:24:01 +0000

qstack gravatar image

The following steps are required to create a table in DB2 using AS and indicating the tablespace:

  1. Log in to DB2 using a valid user ID and password.
  2. Open a new command window or terminal session.
  3. Type the following command to create a new table:

CREATE TABLE newtablename AS (SELECT * FROM existingtablename)

  1. After the AS keyword, specify the tablespace where the new table will be stored. For example:

CREATE TABLE newtablename AS (SELECT * FROM existingtablename) TABLESPACE newtablespacename

  1. Press Enter to execute the command.
  2. Verify that the new table has been created by running a SELECT statement on the newtablename.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-08 04:54:14 +0000

Seen: 9 times

Last updated: May 08 '23