Working with the DB2 Information Center

Posted: Monday,October 27, 2008 in Kuliah
Tags: ,

Asumsi saya yang membaca ini sudah menginstall DB2 dan dapat dijalankan di komputernya.
1. Information Center Website

http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp
Website ini berguna untuk membantu kita dalam belajar DB2. Digunakan sebagai help DB2.

2. Contoh penggunaannya.. Coba ketik “create view” di search box kiri atas.
Syntax

>>-CREATE–VIEW–view-name————————————–>

>–+———————————————+–AS———->
|    .-,———–.                          |
|    V             |                          |
+-(—-column-name-+–)———————–+
‘-OF–type-name–+-| root-view-definition |-+-‘
‘-| subview-definition |—‘

>–+———————————–+–fullselect–●———>
|       .-,———————–. |
|       V                         | |
‘-WITH—-common-table-expression-+-‘

>–+———————————-+–●———————->
|       .-CASCADED-.               |
‘-WITH–+———-+–CHECK OPTION-‘
‘-LOCAL—-‘

.-WITH NO ROW MOVEMENT-.
>–+———————-+–●———————————><
‘-WITH ROW MOVEMENT—-‘

root-view-definition

|–MODE DB2SQL–(–| oid-column |–+———————+–)—|
‘-,–| with-options |-‘

subview-definition

|–MODE DB2SQL–| under-clause |–+————————+—->
‘-(–| with-options |–)-‘

>–+——–+—————————————————|
‘-EXTEND-‘

oid-column

|–REF IS–oid-column-name–USER GENERATED–+———–+——-|
‘-UNCHECKED-‘

with-options

.-,————————————————————–.
|                            .-,——————————-. |
V                            V                                 | |
|——column-name–WITH OPTIONS—-+-SCOPE–+-typed-table-name-+-+-+-+—-|
|        ‘-typed-view-name–‘ |
‘-READ ONLY——————-‘

under-clause

|–UNDER–superview-name–INHERIT SELECT PRIVILEGES————-|

Cara penggunaan dari create view ini…

Run -> ketik db2cmd

Di DB2 CLP – DB2COPY1 ketik :
db2start
db2 connect to sample
db2
db2 => create view lihatnamastaff as select name from staff
db2 => select * from lihatnamastaff
db2 => quit
exit

Comments
  1. Sheela Dave says:

    Excellent sharing and thanks for same.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s