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

مشكلة في الـ Object Type

Featured Replies

بتاريخ:

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

من المعتاد عند إنشاء أمر Object Type بقاعدة البيانات تتم كما يلي :

Create Or Replace Type O_Emp Is Object(EmpNo  Number(10),Ename VarChar2(20));
/
Create Or Replace Type T_Emp Is Table Of O_Emp;
/



بعد ذلك يمكننا إستخدامهم بكل بساطة كما يلي :

Declare
 P_Emp  T_Emp := T_Emp();
Begin
 P_Emp.ExtEnd;
 P_Emp(P_Emp.Count) := O_Emp(1,'Ahmed');
 P_Emp.ExtEnd;
 P_Emp(P_Emp.Count) := O_Emp(2,'Usif');
 P_Emp.ExtEnd;
 P_Emp(P_Emp.Count) := O_Emp(3,'Sara');
End;
/



ولكن عند محاولة ربط Object Type مباشرتاً مع جدول بأكثر من طريقة لا يقبل معي ، أنظروا :

Create Or Replace Type O_Emp Is RefCursor Return Emp%RowType;
/
Create Or Replace Type O_Emp Is Ref Cursor Return Emp%RowType;
/
Create Or Replace Type O_Emp Is Object Of Emp%RowType;
/
Create Or Replace Type O_Emp Is Object Return Emp%RowType;
/
Create Or Replace Type O_Emp Is Record(A  VarChar2(20));
/



من الصحيح إمكاننا إنشاء أمر Type داخل قطعة برمجية كما يلي :

Declare
 Type O_Emp Is Ref Cursor;
 P_Emp  O_Emp;
Begin
 Open P_Emp For Select * From Emp;
 Null;
End;
/




لكن إخواني أنا أرغب في إنشاء Object Type مباشرتاً ، يمكننا من خلالة جلب كافة حقول جدول محدد علي Object Type دون إجراء تعريف له ، كما هو موضح بالمثال التالي :

P_Emp	Emp%RowType;




شكراً

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

هل هناك حل

شكراً

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

لجلب الحقل كله

declare
P_Emp Emp%RowType;
begin select * into p_emp from emp ;
end;

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

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

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

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

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

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

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.