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

معلومات عامه حول موضوع Insert All & Insert First

Featured Replies

بتاريخ:

السلام عليكم ورحمة الله وبركاته 

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

الأخوة الأعزاء شغلني كثيرا موضوع insert all & insert first وقررت أن أكتب في هذا الموضوع لانتفع به أن واخواني وهذا على قدر علمي فرجاء من الجميع تصيح الخطأ إذا كان به خطأ أو الزيادة عليه لمن يعرف شيء عن هذا الموضوع وكلامي ما هو إلا نواه في بحر عميق 

مرفق ملف يحتوي على الأمثلة البسيطة للموضوع 

Insert all statement.doc

بتاريخ:

جزاك الله خيراً على المشاركة 

تم تحميل الملف والإطلاع عليه 

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

جزاك الله خيراً على المشاركة 

تم تحميل الملف والإطلاع عليه 

وجزاكم وسدد على الحق خطاكم برجاء افادتي اذا كان به أخطاء لاصحح معلوماتي ولحضرتك جزيل الشكر 

بتاريخ:

مشكور ماقصرت وبارك الله فيك ، معلومات رائعة ..

ولكن لماذا ضرورة استخدام الأمر select * from dual;

 

 

 

Insert all statement

·        تستخدم لادخال أكثر من صف من جملة insert  واحدة في جدول أو أكثر

مثال لادخال القيم في جدول واحد

insert all

into departments (department_id,department_name) values (5000,'mohamed')

into departments (department_id,department_name) values (6000,'mustafa')

into departments (department_id,department_name) values (7000,'sama')

into departments (department_id,department_name) values (8000,'anwar')

select *

from dual;

ملاحظة

لابد من كتابة جملة الإستعلام الأخيره حيث أن الجملة بدونها يحدث خطأ

مثال لادخال القيم في جدولين

insert all

into departments (department_id,department_name) values (9000,'mohamed')

into departments (department_id,department_name) values (9900,'mustafa')

into jobs (job_id,job_title,MIN_SALARY,MAX_SALARY) values ('developer','dev',5000,10000)

select *

from dual;

مثال آخر

ننشأ جدول عبارة عن نسخه من جدول الموظفين كالآتي

create table emp_99

as select e.employee_id,e.last_name,e.salary,d.department_name,l.city

from employees e join departments d

on (d.department_id=e.department_id)  join locations l

on (d.location_id=l.location_id)

where 1=2 ;

وجدول آخر عبارة عن

create table emp_100

as select employee_id,last_name,department_id,job_id

from employees

where 1=2

 

نقم بادخال بيانات في الجدول عن طريق

 

insert all    

into emp_99 (employee_id , last_name , department_name , city ) values (emp,name,dept,loc)

into emp_100(employee_id,last_name,job_id)                         values (emp,name,job)

select e.employee_id emp ,e.last_name name ,e.salary sal ,d.department_name dept,l.city loc

,d.department_id d_id,e.job_id job

from employees e join departments d

on (e.department_id=d.department_id) join locations l

on (d.location_id=l.location_id)

where e.department_id=50;

 

مثال آخر لادخال ابيانات عن طريق شرط معين

insert all

  when sal<5000 then

  into emp_99(employee_id,last_name,salary,DEPARTMENT_NAME,city) values (emp,name,sal,dept,loc)

  else

  into emp_100(employee_id,last_name,job_id)values (emp,name,job)

 

select e.employee_id emp ,e.last_name name ,e.salary sal ,d.department_name dept,l.city loc

,d.department_id d_id,e.job_id job

from employees e join departments d

on (e.department_id=d.department_id) join locations l

on (d.location_id=l.location_id)

where e.department_id=50;

يوجد مثال آخر يحقق نفس النتيجه ولكن باسلوب آخر

Insert first

 

insert first

  when sal<5000 then

  into emp_99(employee_id,last_name,salary,DEPARTMENT_NAME,city) values (emp,name,sal,dept,loc)

  else

  into emp_100(employee_id,last_name,job_id)values (emp,name,job)

 

select e.employee_id emp ,e.last_name name ,e.salary sal ,d.department_name dept,l.city loc

,d.department_id d_id,e.job_id job

from employees e join departments d

on (e.department_id=d.department_id) join locations l

on (d.location_id=l.location_id)

where e.department_id=50;

 

 

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

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

 

مشكور ماقصرت وبارك الله فيك ، معلومات رائعة ..

 

ولكن لماذا ضرورة استخدام الأمر select * from dual;

 

 

 

Insert all statement

·        تستخدم لادخال أكثر من صف من جملة insert  واحدة في جدول أو أكثر

مثال لادخال القيم في جدول واحد

insert all

into departments (department_id,department_name) values (5000,'mohamed')

into departments (department_id,department_name) values (6000,'mustafa')

into departments (department_id,department_name) values (7000,'sama')

into departments (department_id,department_name) values (8000,'anwar')

select *

from dual;

ملاحظة

لابد من كتابة جملة الإستعلام الأخيره حيث أن الجملة بدونها يحدث خطأ

مثال لادخال القيم في جدولين

insert all

into departments (department_id,department_name) values (9000,'mohamed')

into departments (department_id,department_name) values (9900,'mustafa')

into jobs (job_id,job_title,MIN_SALARY,MAX_SALARY) values ('developer','dev',5000,10000)

select *

from dual;

مثال آخر

ننشأ جدول عبارة عن نسخه من جدول الموظفين كالآتي

create table emp_99

as select e.employee_id,e.last_name,e.salary,d.department_name,l.city

from employees e join departments d

on (d.department_id=e.department_id)  join locations l

on (d.location_id=l.location_id)

where 1=2 ;

وجدول آخر عبارة عن

create table emp_100

as select employee_id,last_name,department_id,job_id

from employees

where 1=2

 

نقم بادخال بيانات في الجدول عن طريق

 

insert all    

into emp_99 (employee_id , last_name , department_name , city ) values (emp,name,dept,loc)

into emp_100(employee_id,last_name,job_id)                         values (emp,name,job)

select e.employee_id emp ,e.last_name name ,e.salary sal ,d.department_name dept,l.city loc

,d.department_id d_id,e.job_id job

from employees e join departments d

on (e.department_id=d.department_id) join locations l

on (d.location_id=l.location_id)

where e.department_id=50;

 

مثال آخر لادخال ابيانات عن طريق شرط معين

insert all

  when sal<5000 then

  into emp_99(employee_id,last_name,salary,DEPARTMENT_NAME,city) values (emp,name,sal,dept,loc)

  else

  into emp_100(employee_id,last_name,job_id)values (emp,name,job)

 

select e.employee_id emp ,e.last_name name ,e.salary sal ,d.department_name dept,l.city loc

,d.department_id d_id,e.job_id job

from employees e join departments d

on (e.department_id=d.department_id) join locations l

on (d.location_id=l.location_id)

where e.department_id=50;

يوجد مثال آخر يحقق نفس النتيجه ولكن باسلوب آخر

Insert first

 

insert first

  when sal<5000 then

  into emp_99(employee_id,last_name,salary,DEPARTMENT_NAME,city) values (emp,name,sal,dept,loc)

  else

  into emp_100(employee_id,last_name,job_id)values (emp,name,job)

 

select e.employee_id emp ,e.last_name name ,e.salary sal ,d.department_name dept,l.city loc

,d.department_id d_id,e.job_id job

from employees e join departments d

on (e.department_id=d.department_id) join locations l

on (d.location_id=l.location_id)

where e.department_id=50;

 

 

 

لا أعرف والله ياهندسه أنا حاولت بقدر الأمكان أجمع المعلومات دي ولو حد عنده إضافه ياريت يعرفني  

بتاريخ:

إن لم نستخدم عبارة 

select * from dual ;

فمعناه لم نستفد شيء من جملة insert all ،

كيف هذا ؟

حسناً من غير الـ select  الاضافة ستتم لمرة واحدة فقط و لصف واحد only one row وكأني استخدمت جملة الـ insert  الطبيعية 

بينما مع select  فهذه الـ select  وكإنما تعمل لي loop حتى تتم الإضافة لأكثر من صف وهذا هو غرضي من إستخدام insert all

 

فكما هو معروف إن insert هي تنفيذ لصف واحد فقط بينما  select تستطيع إسترجاع أكثر من row  وهنا إستغلينا هذه الصفة في select وكإنما تعمل لنا مفهوم الـ loop لإضافة أكثر من صف بنفس الوقت إن شاء الله إستطعت التوضيح أو الغرض من إلحاق جملة insert all ب select * from dual

بتاريخ:

إن لم نستخدم عبارة 

select * from dual ;

فمعناه لم نستفد شيء من جملة insert all ،

كيف هذا ؟

حسناً من غير الـ select  الاضافة ستتم لمرة واحدة فقط و لصف واحد only one row وكأني استخدمت جملة الـ insert  الطبيعية 

بينما مع select  فهذه الـ select  وكإنما تعمل لي loop حتى تتم الإضافة لأكثر من صف وهذا هو غرضي من إستخدام insert all

 

فكما هو معروف إن insert هي تنفيذ لصف واحد فقط بينما  select تستطيع إسترجاع أكثر من row  وهنا إستغلينا هذه الصفة في select وكإنما تعمل لنا مفهوم الـ loop لإضافة أكثر من صف بنفس الوقت إن شاء الله إستطعت التوضيح أو الغرض من إلحاق جملة insert all ب select * from dual

 

 

 

864025823.jpg

بتاريخ:

miash80

شكراً لحضرتك جزاك الله كل خير هذا من حسن ظنك والله يوفقنا وإياكم إن شاء الله

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

جزاكي الله خيرا يافندم وشكرا على الأفاده الجميلة دي ونفعنا الله من علمكم واسأل الله ان يعلمنا ما ينفعنا وينفعنا بما علمنا ميسم الكرام 

 

 

 

 

بتاريخ:

جزانا الله وإياكم ..والله يوفقكم لما تقدموه من جهد ومساهمة في تقديم المنفعة والفائدة للأخوة الأعضاء..شكراً جزيلاً 

  • بعد 2 أسابيع...
بتاريخ:

السلام عليكم كنت محتاج داله بالجافا تمكني من اخد primary key من جدولين ووضعهم في جدول الكثر الخاص بالعلاقه ميني تو ميني

بتاريخ:

السلام عليكم ورحمة لله وبركاته.

ماشاء ملف جيد والله اني تعلمت منه شي لم اكن أعرفه وراااح يفيدني كثيرر بعد توفيق الله..

 

أشكرك على جهدد وعلى إفادة الأخرين..

 

 

 

مووفق..

بتاريخ:

جزاك الله خير اخي محمد طلعت مجهود متميز ورائع ويستحق الثناء والتقدير
اما موضوع للابداع عنوان وهو ميسم الكرام فهو قليل جدا في حقها لانها بالفعل مبدعة مجتهدة ومثابرة وليسى مجاملتا وجزا الله اختنا الفاضلة ميسم فقد كان شرحها شافيا وكافيا
وتحياتي لكم جميعا

  • بعد 1 شهر...
بتاريخ:

جزاك الله خير اخي محمد طلعت مجهود متميز ورائع ويستحق الثناء والتقدير

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

وتحياتي لكم جميعا

شكراً لحضرتك أستاذنا الفاضلscince

جزانا الله وإياكم

  • بعد 1 سنة...
بتاريخ:

أستاذة ميسم انت فعلاً انسانة مبدعة ربنا يوفقك 

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

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

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

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

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

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.