Similarities and differences between DB2 and Oracle

Source: Internet
Author: User

1. Table space for indexes
Oralce:
Create TABLE T1...
Create Index... ON T1... IN INDX_TS
DB2:
Create TABLE T1... IN DATA_TS index in INDX_TS
Create INDEX... ON T1
2. RowID
Oracle:
Oracle has RowID, which is unique in the database and can be obtained in the program.
DB2:
The corresponding value of DB2 cannot be obtained by the program.
3. Some Conversions

Oracle:
Oracle supports some conversions, such:
Create table t1 (c1 int );
Select * from t1 where c1 = '1'
Select 'abc' | 2 from t1
DB2:
DB2 does not support some conversions, such:
Create table t1 (c1 int );
Select * from t1 where c1 = CAST ('1' as int)
Select 'abc' | CHAR (2) from t1
4. Use the function value as the default value in the table.
Oracle:
Oracle supports using the function value as the default value In the table, for example:
Create table t1 (C1 Number default fn () not null,
C2 DATE DEFAULT NOT NULL SYSDATE
)
DB2:
DB2 does not support using the function value as the default value In the table, for example:
Create table t1 (C1 int not null,
C2 TIMESTAMP DEFAULT CURRENT TIMESTAMP
)
This is not allowed.
5. Some built-in functions



6. Public Synonyms)
Oracle:
Common synonyms supported by Oracle
DB2:
DB2 does not support Common synonyms.

7. Date/Time


8. External Connection


Currently, Oracle 9i also supports this ANSI join syntax.
9. Merge string and null
Select 'abc' | c1 from T1
C1 is null
Result:
Oracle: abc
DB2: null
To get 'abc', DB2 needs to do this.
Select 'abc' | coalesce (c1, '') from T1

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.