الاثنين، ٩ مارس ٢٠٠٩

Built-in Object IDs

Some built-in subprograms accept object IDs as actual parameters. An object ID is an internal, opaque handle that is assigned to each object when created in Oracle Forms. Object IDs are internally managed and cannot be externally viewed by the user. The only method you can use to retrieve the ID is to define a local or global variable and assign the return value of the object to the variable.

You make the assignment by way of the FIND_ built-in functions. Once you have used FIND_ within a PL/SQL block, you can use the variable as an object ID while still in that block. The valid PL/SQL type for each object is included in the syntax descriptions for each parameter. The description for the FIND_BLOCK built-in provides an example of how to obtain an object ID.



========================



بعض الـ Built-ins يأخذون معرف هوية الكائن او ما يعرف بـ Object ID كـ Parameter لهم ، و بما أن الـ Object ID ينشاء داخلياً من خلال الـ Forms Builder عند أنشاء اى كائن فانه من المستحيل ان يتعامل المبرمج مع الـ Object ID مباشرتاً ، و لكن بالامكان التعامل معه فى حال تعريف متغير على مستوى النماذج او على مستوى نموذج واحد ( Global Variable , Local Variable ) و وضع قيمة العائدة من الكائن الى هذا المتغير ؛ و وضع هذه القيمة بيتم من خلال الـ Built-in الذى يدعى _Find

فمثلاً فى هذا المثال سنأتى بقيمة معرفة الهوية الخاص بالـ Block ، لكى نتأكد من أنه متواجد بالفعل ام لا .


FIND_BLOCK Example

/*

** Built-in: FIND_BLOCK
** Example: Return true if a certain blockname exists
*/
FUNCTION Does_Block_Exist( bk_name VARCHAR2 )
RETURN BOOLEAN IS
bk_id Block;
BEGIN
/*
** Try to locate the block by name
*/
bk_id := Find_Block( bk_name );
/*
** Return the boolean result of whether we found it.
** Finding the block means that its bk_id will NOT be NULL
*/
RETURN (NOT Id_Null(bk_id));
END;



هنا أحنا عرفنا المتغير bk_id بأنه Block ثم أوجدنا معرفة هوية الخاص بالبلوك التى أنشأنها مسبقاً فى الـ Form Builder - و التى تم تعريفها هنا فى هذه الدالة كعامل الـ bk_name - من خلال الـ Find_Block كما هو موضح فى المثال السابق .

و سوف يتم شرح الـ FIND_BLOCK Built-in بالتفصيل فالدروس الاحقة ...... المهم هنا احنا عرفنا اذاى نحضر الـ ID الخاص بأى كائن .


Share/Save/Bookmark

2 comments:

ماتريكس للتقنية يقول...

جزاك الله خيرا عنا ونتمنى منك المزيد وزادك الله من خيرة

Unknown يقول...

thank you so much Hany Freedom really u r greate

إرسال تعليق

Newer Posts Older Posts Home Page