From Oracle to DB2, problem set (1)

Source: Internet
Author: User

The series will be sorted out later.

--------------------

Clear table data:
Problem:
Truncate table is not in DB2. You can use the following procedure.
Call sysproc. admin_cmd ('Load from NUL of del replace into ahsimis. ac01_temp ');
Commit;
After a table is called, it may be inactive. Use the following command to activate the table.
Problem:
Sqlstate 57016: the table cannot be accessed because it is not active.
DB2 load query table test. Users

Tablestate:
Check pending

DB2 set integrity for test. Users immediate checked
---------------------
Renaming a table
Sqlstate = 42986

Check whether any index or constraint exists. Delete it first.
Connect to ahsimis user "user ";
Alter table ahsimis. ac01_temp drop check sys_c00249228 drop check sys_c00249229;
Connect reset;
Then rename
Connect to ahsimis;
Rename table ahsimis. ac01_temp to ac01;
Connect reset;

---------------------

Submit

In DB2, whether it is DML or DDL, a commit command is required. Otherwise, the command does not take effect.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.