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

Write a PL-SQL to display and insert numbers from 20 to 30

Featured Replies

بتاريخ:


السلام عليكم
لمن لديه الخبره في loop
الموضوع في المرفقات

Write a PL-SQL block to display and insert numbers from 20 to 30 in the table ODD_EVEN. Repeat the step using all 3 loop structures in PL-SQL

.[/size

بيانات الجدول من 20_ 30..... ODD-EVEN


CREATE TABLE ODD_EVEN(GIVEN_no number(8) primary key, description char(8) not null)

Gaven no description
20 EVEN
21 ODD
22 even

تم تعديل بواسطة أحساس غالي

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

بيانات الجدول من 20_ 30..... ODD-EVEN


column name data type size attributes
Gaven_no number 8 primary key
description char 8 not null


Gaven no description
20 EVEN
21 ODD
22 even

بتاريخ:

بسم الله الرحمن الرحيم

النوع الاول Basic Loop

Declare 
I number := 20; 
Begin 

   Loop
   Dbms_output.put_line(I||' is even'); 
    I := I + 1; 
    Dbms_output.put_line(I||' is odd');  
     Exit when i = 30 ;
     end loop;   
 End;



النوع الثانى While Loop


Declare 
I number := 20; 
Begin 

  while(I <=29) Loop 
   Dbms_output.put_line(I||' is even'); 
    I := I + 1; 
    Dbms_output.put_line(I||' is odd');  
     End Loop; 
        
 End; 



النوع الثالث For Loop


 Declare 
I number := 0; 
Begin 
 For I in 20..30 loop 
  If MOD(1,2) =0 then 
   Dbms_output.put_line(I||' is even'); 
    else
    Dbms_output.put_line(I||' is odd'); 
       end if;
     End Loop;         
 End; 



بالتوفيق ان شاء الله فى هذا الاختبار B) .... و بعدين مفيش اى مرفقات بس الاجابه دى بناءا على فهمى اتمنى ان تكون هو ما قصدته ...

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

مشكور أخوي ع الأجابة

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

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

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

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

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

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.