الانتقال إلى المحتوى
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.

ما الخطأ فى هذا الكود... Function يحتوى على Parameter

Featured Replies

بتاريخ:

السلام عليكم ،،
أريد عمل Function يحتوى على Parameter عبارة عن رقم الموظف بحيث عندما أدخل رقم الموظف
تقوم بإرجاع عدد سنوات الخدمة .
فما الخطأ فى هذا الكوك..مع الشرح إذا سمحتم!

create or replace function get_service_yrs(p_empno in t_emp.empno%type)
return number IS
v_yrs number(30) ;
cursor emp_rec is
select empno,ename,hiredate from t_emp
where empno=p_empno ;
begin
for x in emp_rec loop
select (sysdate-hiredate)/365 service into v_yrs
from t_emp where current of emp_rec ;
end loop ;
return v_yrs ;


وجزاكم الله خيرا ،،

بتاريخ:

بص انت اكتب الكود دا

CREATE FUNCTION GET_SERV(EMP NUMBER) RETURN NUMBER IS
s_date number;
BEGIN

FOR I IN (SELECT * FROM t_emp where empno=emp) loop
s_date := round((sysdate-i.hire_date)/365);
end loop;
return s_date;
end;

تم تعديل بواسطة HELL-BOY

بتاريخ:
  • كاتب الموضوع

شكرا لك أخى Hell-Boy على مجهودك ،،،

بتاريخ:

العفو اخي الكريم
انت ممكن تستغني عن اللوب تماما لانها هترجع قيمه واحده فانت مش محتاج تعمل لوب
انا كتبتهالك علشان بتبقا اسهل من انك تعمل ديكلير للكرسور بعد كدا تلوب عليه
كلمه
where current of cursor_name
بنكتبها لما الكرسور بيعمل ابضيت بس زي كدا

cursor waleed is select * from emp for update

هنا هنحتاج نكتب
update emp set sal = sal*1.1
where current of cursor_name

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

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

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

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

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

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.