0% found this document useful (0 votes)
29 views

- list - when changed: تا developer 10g س / نا

This document discusses using triggers and global variables in Oracle Application Express (APEX) to track database operations. It provides examples of creating triggers that fire on form instances and database events to increment global counter variables that track the number of inserts, updates, and deletes. The triggers and global variables allow tracking how many times certain operations occurred without directly querying the database.

Uploaded by

hehazem
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

- list - when changed: تا developer 10g س / نا

This document discusses using triggers and global variables in Oracle Application Express (APEX) to track database operations. It provides examples of creating triggers that fire on form instances and database events to increment global counter variables that track the number of inserts, updates, and deletes. The triggers and global variables allow tracking how many times certain operations occurred without directly querying the database.

Uploaded by

hehazem
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

 

 
list  trigger   check box, radio-group, list-item  
."#      item
:+ . "# list item ,-*' "  +" # ,- %&'
2 -
2 -
, -
9: -
A ' ; + @?  >+    >,- ; ' ; #  <
?@" G " E G +  >,-E F ' ; A D 2 C+ 
when-list- .' trigger  list item ." *' +  ,-E  trigger
) ,-( ;  2' &" )- C  ' ;   .C "; changed
:+  F  .  not enabled   N ,-  ,*( +>
list-item ('*+ < ) list 1 ,-  OP -
PL/SQL Editor C R 'A'F -
(when-list-changed) trigger' TP A C -
:+  . ; -

If : list1 =2 then
Set-item-property('emp-tv.no-child', enabled, property-false);
Else
Set-item-property('emp-tv.no-child', enabled, property-true);
End if;
:+ U@F  A

 /

developer 10g 


[email protected]

: P CX" ( set-item-property)

item VTWC  C 

' >2[   '

,-  .#  

'" 2['

  Enabled

enabled \< ,C ' ,- VTWC ,C ,C "  


']& 2[   'Property-false
\< ,*  property-true ^" D no enabled \< ,* 
yes enabled
G  N +  >,-E [ 2 C _ ,`  G U@F 
. ,C 

 /

developer 10g 


[email protected]

#$%( & $)!


%& )  X (user) < c'  #C ,' F G" " Ce  c"  
,F  -F . A " # Uc ,' -F ( Scott) < c' f A'F % ( Scott
   W >  A'cP  c- "[ G  g- "# 
Scott < c'  Uc'? :cF + .[ # VTWC `  Ch c-< c'
.' Trigger ^     F %&
when new form instance
> :<? # G  form  c  ." "[ Trigger   A
( + ) Create  g` R module , '* Triggers  OP .
when new form instance C .
:  .C ; .
If Get_Application_Property ( username) = 'Scott' then
Set_block_property('Emp",Delete_Allowed , Property_False);

  E > 2[ AT2*  c-F  [ 


Get_Application_Property (username)
Scott  , . - < c'   W f%C A ?:c   k
if

'* : 

# VTWC  C  # VTWC ` f "& 2[

 /

developer 10g 


[email protected]

set-block-property
2* f
Emp #   . ,C   # >   2[
# VTWC ,C ` F  <\  Delete_Allowed  &" 2[
Uc'  -  No '  ? -  Property_false ]& 2[

 /

developer 10g 


[email protected]

(  ) & - 3  - 3%) +$ ,-%  %/ &$ 00 1 !*


Global  Global Variable  m" [;   " F _ k  +
G  ,F   Uc'  Cn'  ' - . AF2< F Variable
Global Variable  m" -
Global.insert   >
Global.update   "&
Global.delete   ]&

 /

developer 10g 


[email protected]

when new form instance   form c  Trigger ^  "F 
\  T'  P Global ,"@? 

:Global.insert:=0;
:Global.update:=0;
:Global.Delete:=0;

 /

developer 10g 


[email protected]

 form  c  ( 3 Triggers ) [F  m" -


Post_insert
Post_update
Post_Delete
Post_insert [ >  F ";    Uc'  ,F   Cn 
:Global.insert:=:Global.insert+1;

"" -' Global ,C' '* - F F   


post_update  &" trigger ,C g#@ m D"
:Global.update:=:Global.update+1;

Post_Delete ]& Trigger ,C@ F


:Global.Delete:=:Global.Delete+1;

 /

developer 10g 


[email protected]

F  ,F  ,   n <global ,C' - F    ,  


Uc' <global ,C' - F  Uc ,  ,F  <global ,C' -
"global' '* - fv _ ,C display item  "  F G 
insert .' insert 'P fv <display item >
update .' update 'P fv " <Display item
del .' delete' P fv &] <Display item

"when- button-pressed" trigger ,C   .C "; button " C


:emp.del :=: Global. Delete;
:emp.del >2[

 /

developer 10g 


[email protected]

emp #?  P del .'  display item   <


global.delete' P . "& 2[
:emp.insert :=: global.insert;  + G
:emp.update:=:global.update; ,F 

2  g` R C   C  Uc %[c A  O R form k"


..  .c   

 /

developer 10g 


[email protected]

You might also like