الانتقال إلى المحتوى
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)  مستخدما pl/sql  يطبع البيانات على الشكل التالي الذي في الصورة 

مساعدة : استخدم  group by.

 

 الحل ولكن به أخطاء ولا أعرف ما هو الخطا أرجو منكم المساعدة

create or replace procedure showData

as
CURSER  EMPCUR IS 
SELECT deptno,max(sal),min(sal) FROM emp
group by deptno
order by deptno asc;
REC1 EMP%ROWTYPE;
begin
OPEN EMPCUR;
FETCH EMPCUR INTO REC1;
WHILE EMPCUR%FOUND LOOP
dbms_output.put_line(REC1.DEPTNO||' '||REC1.min(sal)||' '||REC1.MAX(SAL));
END LOOP;
FETCH EMPCUR INTO REC1;
end;
/
 

post-123914-0-35126000-1364998270_thumb.png

بتاريخ:

السلام عليكم

إليكِ الحل:

 

 

 

CREATE OR REPLACE PROCEDURE showdata
IS
   CURSOR empcur
   IS
      SELECT   deptno,
               MAX (sal) max_salary,
               MIN (sal) min_salary
          FROM emp
      GROUP BY deptno
      ORDER BY deptno ASC;
BEGIN
   FOR rec IN empcur
   LOOP
      DBMS_OUTPUT.put_line (   rec.deptno
                            || ' '
                            || rec.max_salary
                            || ' '
                            || rec.min_salary
                           );
   END LOOP;
END;
/
 
بتاريخ:

 

 

create or replace procedure showData as
            CURSER  EMPCUR IS SELECT deptno,max(sal),min(sal)
FROM emp
group by deptno
order by deptno asc;
            deptno1 emp.deptno%type;
            min_sal  emp.sal%type;
            max_sal emp.sal%type;
begin               
            OPEN EMPCUR;
            Loop
                        FETCH EMPCUR INTO deptno1, min_sal, max_sal;
                        exit when empcur%notfound;
                        dbms_output.put_line(deptno1||' '||min_sal|' '||max­_sal);                  
            end loop;
            close empcur;
end;

 

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

بتاريخ:

 

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

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

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

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

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

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

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

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

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.