Skip to main content

الجزء الرابع: قيد سلامة المرجع المتتالي Cascading Referential Integrity Constraint

الجزء الرابع: قيد سلامة المرجع المتتالي
Cascading Referential Integrity Constraint

هذا الجزء يعد مكمل للجزء الثاني والثالث, قيد الCascading Referential Integrity  ينطبق على قيد الForeign key  الذي سبق ذكره في الجزء الثاني,  للوصول الى اعدادات هذا القيد:  



ولكن ماعمل هذا القيد؟ يتحكم هذا القيد بكيفية معالجة القيم في الجدول الذي به المفتاح الخارجي FK , اذا تم حذف او تعديل الحقول المرتبطة معه في الجدول الذي به المفتاح الرئيسي PK , بعبارة ابسط كما في الجدولين ادناه, اذا تم حذف او تعديل في جدول tblGender  المعرف رقم 2 , ماهي القيم التي ستكون في حقول المرتبطة بهذا المعرف؟ هل ستحذف او تعدل؟ هل ستتغير هل ستبقى؟  






الجواب كالأتي:

الخيارات المتاحة عند أعداد قيد سلامة المرجع المتتالي Cascading Referential Integrity :

1.      عدم فعل شيء No Action : هذا هو التصرف الأفتراضي, مايعنيه هو عند محاولة حذف او تعديل لسجل في جدول وكان هذا السجل فيه قيد المفتاح الرئيسي Primary Key يشير الى مفتاح خارجي Foreign Key  في جدول
اخر , سيظهر خطأ عند محاولة الحذف او التعديل وتسترجع هذه العمليات
Rollback اي لا يتم تطبيقها.


2.      التوالي Cascade : عند محاولة حذف او تعديل لسجل في جدول وكان هذا السجل فيه قيد المفتاح الرئيسي Primary Key يشير الى مفتاح خارجي Foreign Key  في جدول اخر , سيتم حذف او تعديل كلا السجلين!


3.      وضع قيمة ملغية Set Null : عند محاولة حذف او تعديل لسجل في جدول وكان هذا السجل فيه قيد المفتاح الرئيسي Primary Key يشير الى مفتاح خارجي Foreign Key  في جدول اخر , جميع الحقول التي تشير الى ذلك المفتاح الرئيسي Primary Key سيتم وضع قيمة باطلة او ملغية وهي الNULL   في تلك الحقول.



4.      وضع قيمة افتراضية Set Default : عند محاولة حذف او تعديل لسجل في جدول وكان هذا السجل فيه قيد المفتاح الرئيسي Primary Key يشير الى مفتاح خارجي Foreign Key  في جدول اخر , جميع الحقول التي تشير الى ذلك المفتاح الرئيسي Primary Key سيتم وضع قيمة أفتراضية في تلك الحقول.

Comments

Popular posts from this blog

How To Play .srt Subtitles File in Windows Media Player

How To Play .srt Subtitles File in Windows Media Player links: https://sourceforge.net/projects/wmpsub/ wmp,.srt Subtitles File in Windows Media Player,How To Play .srt Subtitles File in Windows Media Player,How To,Safaa Al-Hayali,saf3al2a,srt subtitle in WMP,Windows,Windows Media Player,media,.ass,local subtitles

How to fix the disk is write protected

in this video tutorial, I'll show you how to remove/solve/fix the disk is write protected from USB flash drive. To download the necessary 2 files: Download >  SAFAA_ALHAYALI.IMG  - 1.18 MB Download >  Win32DiskImager-0.9.5-install.exe - 11.7 MB write protection,remove write protection,write protected,How to fix the disk is write protected,how to solve the disk is write protected,how to remove the disk is write protected,USB write protected,fix USB write protected,fix HDD write protected,how to,windows,USB flash drive ERROR,fix USB flash drive write protected,USB flash drive write protected

Virtual Box : How to Increase Disk Size - Windows

How to increase disk size or disk storage in oracle virtual box the command you have to use: vboxmanage.exe modifymedium "[YourPathToVdiFileOfYourVirtualMachine]" --resize [NUMBER] virtual,box,vbox,oracle,partition,size,disk,increase,resize,windows,10,microsoft,vdi,vboxmanage,configuration,Safaa AL-Hayali,saf3al2a,Oracle,VirtualBox,How to,windows 10