Oracle SQL, PLSQL, APEX How To's by Dr. S. Raghunathan - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

 

 

We will try to create another constraint using sql script in Home SQL Workshop SQL Command Window the following script may be typed and executed so that voucher-type column will not accept other than 'J', 'P',

'R' which indicates Journal, Payment , Receipt,

 

ALTER TABLE RAAK-TRANS-MASTER ADD CONSTRAINT "RAAK-TRANS-MASTER-CKl" CHECK (

"VOUCHER-TYPE" IN ( IJI ' IPI ' IRI )) CLICK RUN will generate the constraint required.

 

16,03 HOW TO CREATE UNIQUE CONSTRAINT

In    the    raak-trans-Master,     we    have    column voucher-number and it must be declared as unique value since it has got link with detail file, Before linking this key with detail file, this column must be created and checked   as   unique   value, (No   duplicate   value   is allowed),

→      ObJect Browser under default table option

 

→      select Raak-Trans-Master

 

→      Constraint       →      Create

 

→      change the default constraint name