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

ما الخطأ فى هذا الكود

Featured Replies

بتاريخ:

قمت بعمل استعلام على جدول بحيث يعرض المنتجات التى تم بيعها فى نفس التاريخ وكان صحيحا ولكن وجد
خطأ وهو انه اذا كان هناك منتجين او اكثر تم بيعهم فى نفس التاريخ فان الاستعلام لا يعمل ولكن يعمل عندما يكون
منتج واحد فقط تام بيعه فى التاريخ المذكورز
والاستعلام كالآتى
begin
select all p_id, product, no, price, s_n, p_date
into :product.p_id, :product.product, :product.no, :product.price, :product.s_n, :product.p_date
from product
where product.p_date = :Dd;
end;
فما حل هذه المشكلة
شكرا

بتاريخ:

السلام عليكم
طبيعي انه لا يعمل عند وجود منتج تم بيعه في نفس اليوم حيث سيظهر اكسبشن too_many_rows
لان جملة السيليكت يتم اختيارها في فورمز فاريبلز
و الحل ان تضع شروط اخري لضمان ان ينتج ريكورد و احد فقط عن الاستعلام
اما اذا كنت تريد مثلا ان تعرض المنتجات التي تم بيعها في هذا اليوم للاستفسار مثلا
فيمكن استخدام بلوك من نوع from clause
لعرض المنتجات التي تم بيعها في يوم معين
بالتوفيق

بتاريخ:

طبيعي ان يكون هناك خطأ اذا كان اكثر من منتج بنفس التاريخ
لتفادي الخطأ استخدم Cursor
او تعالج too_many_rows في ال exception

بتاريخ:

السلام عليكم ورحمة الله
قد يفيدك استخدام أمر الdistinct لعدم تكرار البيانات المتشابهه لنفس الحقل

SQL> select distinct job from emp; JOB
---------
ANALYST
CLERK
MANAGER
PRESIDENT
SALESMAN

بتاريخ:

you can use cursor as follow:
[declare
cursor items is
select p_id, product, no, price, s_n, p_date
from product
where product.p_date = :my_date;
begin
open items;
fetch items
into :product.p_id, :product.product, :product.no, :product.price, :product.s_n, :product.p_date ;
if items%notfound then
message('There is no items in that date ' || to_char(:my_date));
end if;
close items;
end;
]
this will bring the first record even if there is many records in the select statement

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

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

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

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

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

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.