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

اكتب Procedure........... ارجو الرد ؟؟؟؟

Featured Replies

بتاريخ:

مرحبا باخواني الاعزاء وبعد :
ارجو المساعدة بحل السؤال التالي :
اكتب Procedure لاسترجاع معدل الراتب السنوي وأعلى راتب سنوي
وأقل راتب سنوي لموظفي القسم المدخل رقمها ........

(يعني لما ندخل اي رقم موظف من جدول emp
يعطينا معدل الراتب السنوي له و أعلى راتب سنوي وأقل راتب سنوي ) ... هكذا.....

ارجو الرد ؟؟؟؟؟؟

مشكوورين
بتاريخ:

مش عارفة حضرتك مدخل الدنيا ف بعضها او انا مافهمتش اصد حضرتك

يعنى مثلا تقول بروسيدر ترجع اعلى راتب سنوى واقل راتب سنوى للموظفين ال ف قسم معين


.. بس حضرتك بعدها دخلت الموظف ورقمه وحوار

create or replace procedure  pro_emp(dept_no emp.deptno%type)
is
cursor emp_cr is select max((sal*12) +nvl(comm,0)*12) maxsal ,min((sal*12) +nvl(comm,0)*12) minsal
from emp where deptno=dept_no;
max_sal emp.sal%type;
min_sal emp.sal%type;
begin open emp_cr ;
loop
fetch emp_cr into max_sal,min_sal; exit when emp_cr%notfound;
dbms_output.put_line('maxsalary is' || max_sal || ' ' || 'minsalary' || ' ' || min_sal); 
end loop;
end;

بتاريخ:

الأخ العزيز
الإجابة كما يلي

create or replace procedure sal_info
(p_deptno in number,
p_year_maxsal out number,
p_year_minsal out number,
p_year_avgsal out number)
is
begin select max(sal*12) ,min(sal*12),round(avg(sal*12),0)
into p_year_maxsal , p_year_minsal ,p_year_avgsal
from emp group by p_deptno;
end;


ثم نبدء بالتنفيذ كما يلي

set serveroutput on;
declare
v_max number;
v_min number;
v_avg number;
begin sal_info (10,v_max,v_min ,v_avg);
dbms_output.put_line(v_max||' '||v_min||' '||v_avg);
end;


مع تمنياتي لك بالتوفيق

بتاريخ:

انا بصراحة كل اللى فهمتة انك عايز تدخل رقم الموظف يرجعلك مرتبة السنوى واعلى مرتب سنوى لنفس الادرارة اللى بيشتغل فيها الموظف واقل مرتب سنوى لنفس الادارة برضو
يا رب اكون فهمت صح




create or replace procedure emp_sal(emp_id emp_no.emp%type)
is
cursor c1 is select dept_no from emp where emp_no=emp_id;
cursor c2 is select (nvl(sal*12,0))+(nvl(comm*12,0)) from emp where emp_no=emp_id;
cursor c3 is select nvl(max(sal*12),0),nvl(min(sal*12),0) from emp where dept_no=h group by dept_no;
h number;
x number;
y number;
z number;
begin
------- to get the department number into h-------------
open c1;
fetch c1 into h;
close c1;
------ to get the annual salary for the employee-----
open c2;
fetch c2 into x;
close c2;
-------- to get the max and the min annual salary for the same employee department -------
open c3;
fetch c3 into y,z;
close c3;

dbms_output.put_line( x || ' ' ||y||' '||z);
end;

بتاريخ:

^^^^^^^^

الاخ shaldum ... أحببت ان اضع اجابتك على هذا النحو .. لكي يستطيع الاخرون قراءتها بسهولة . اعتذر منك

create or replace procedure emp_sal(emp_id emp_no.emp%type)
is
cursor c1 is select dept_no from emp where emp_no=emp_id;
cursor c2 is select (nvl(sal*12,0))+(nvl(comm*12,0)) from emp where emp_no=emp_id;
cursor c3 is select nvl(max(sal*12),0),nvl(min(sal*12),0) from emp where dept_no=h group by dept_no;
h number;
x number;
y number;
z number;
begin ------- to get the department number into h-------------
open c1;
fetch c1 into h; close c1;
------ to get the annual salary for the employee-----
open c2;
fetch c2 into x; close c2;
-------- to get the max and the min annual salary for the same employee department -------
open c3;
fetch c3 into y,z; close c3;

dbms_output.put_line( x || ' ' ||y||' '||z);
end

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

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

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

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

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

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.