الانتقال إلى المحتوى

أرجو المساعده من أصحاب الخبرة في Pl/sql


أحساس غالي

Recommended Posts

السلام عليكم
ممكن مساعده من أصحاب الخبرة والمعرفة

السؤال الأول







1.3
Create any table with a primary key column.

Input the primary key column value. Write a PL/SQL procedure to delete the record of the given primary key column value. If the value does not exist, then the procedure must raise appropriate exception.






السؤال الثاني


For the table created in 1.3,

Write a PL/SQL function which will use any mathematical SQL function. Primary key column value must be passed as the input parameter.

تم تعديل بواسطة أحساس غالي
رابط هذا التعليق
شارك

السؤال الاول

create or replace procedure del_pk_val(pk_val number) is
sql_stmt varchar2(200);
i employees.employee_id%type ;
begin
select employee_id into i from employees 
where employee_id = pk_val ;

sql_stmt :=  'delete from employees '||' where employee_id = :id' ;
execute immediate sql_stmt using pk_val ;

exception 
when no_data_found then
dbms_output.put_line('no such value');
End ;
/
show errors ;




لاحظ ان جملة ال select فائدتها عمل بحث على قيمة ال pk هل هو موجود ام لا
وايضا اذا كان غير موجود يتم رفع ال Exception ضمنيا واظهار الرسالة الموجودة فى الكود

رابط هذا التعليق
شارك

مشكورين ع المساعده بس مافهمت الحله ممكن توضيح أكثر هل يحتاج نسوي جدول كريت تابل أو مايحتاج ممكن توضيخ أكثر


وأاالف شكرا

رابط هذا التعليق
شارك

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

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

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

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

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