الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ايقاف قيد primary key

Featured Replies

بتاريخ:

لدينا جدول فرضا جدول العملاء ويوجد فيه بيانات وتم ايقاف قيد primary key وتكررت بيانات العملاء واكيد انه لن استطيع تفعيل primary key مرة اخرى بعد ما تكررت البيانات  اريد حل او امر في sql  تحذف التكرار بحيث اذا تم تفعيل primary key مرة اخرى لا يطلع لي اي مشكلة

تم تعديل بواسطة eiadali

بتاريخ:

يمكنك عمل اى من الاختيارين:

الاول:

هو انك تعيد ترتيب السيريال من البداية, اذا كان هذا الامر مناسب ولا يتسبب فى اختلاف فى عملية الربط بين هذا الجدول مع باقى الجداول

declare
	cursor v is select rowid,PK_column from your_table;
	pk_val number; --check if your pk is number;
	pk_row varchar2(60);
	new_rec number:=1; --or you can create sequence and put next_val into new_rec;
begin
	open v;
	loop
		fetch v into pk_row,pk_val;
		exit when v%notfound;
		update your_table
		set PK_column=new_rec
		where rowid=pk_row;
		new_rec:=new_rec+1;
	end loop;
	close v;
	commit;
end;

 

الثانى:

هو حذف المتكرر فقط مع استبدالة برقم جديد, وهذا لعمل استعلام عن الاكواد المكررة

SELECT PK_column, COUNT(*) AS dupes 
FROM Your_table
GROUP BY PK_column
HAVING COUNT(*) > 1;

 

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.