TAILIEUCHUNG - Oracle PL/SQL Language Pocket Reference- P20

Oracle PL/SQL Language Pocket Reference- P20: This pocket guide features quick-reference information to help you use Oracle's PL/SQL language. It includes coverage of PL/SQL features in the newest version of Oracle, Oracle8i. It is a companion to Steven Feuerstein and Bill Pribyl's bestselling Oracle PL/SQL Programming. Updated for Oracle8, that large volume (nearly 1,000 pages) fills a huge gap in the Oracle market, providing developers with a single, comprehensive guide to building applications with PL/SQL and building them the right way. . | CREATE TABLE pets OF Pet_t PRIMARY KEY tag_no NESTED TABLE vaccinations STORE AS pet_vaccinations_tab Using this separate persons table and the REF attribute will allow the existence of people outside the context of their pets something the pet-obsessed may not envision but probably a good idea from a design point of view . In this context REF is called a type modifier. Does a REF sound a lot like a foreign key While there are important differences between REFs and foreign keys see Table Oracle actually claims that REFs are more reliable and persistent than foreign keys -- probably because REFs do not refer to user-changeable values but rather to invisible internal values. In fact the problem with REFs is that they are too persistent. Oracle currently allows you to delete an object that is the target of a REF without deleting the reference to it. They even dignify this state with a name a dangling REF. This is roughly equivalent to what would happen if you delete a department record without changing the records of employees in that department. There is no declarative way to prevent dangling REFs but it should not be too challenging to do so by implementing pre-delete triggers on the table that contains the parent objects. 11 To make life somewhat easier Oracle provides a predicate IS DANGLING to test for this condition 11 It is also possible to use a foreign key in combination with a REF. To do so you would include an attribute for the foreign key in the Pet_t specification and include a FOREIGN KEY clause in the CREATE TABLE statement. UPDATE pets SET owner_ref NULL WHERE owner_ref IS DANGLING Table Chief Differences between Foreign Keys and REFs Characteristic Foreign Key REF Who defines the value used as the pointer User programmer System Requirements on the parent Must have primary or unique key Must be an object table or object view Please purchase PDF Split-Merge on to remove this watermark. Only allows insertions of child if parent

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.