Racle Forms 10g

March 23, 2018 | Author: neeladrip | Category: Pl/Sql, Data Management Software, Software, Areas Of Computer Science, Databases


Comments



Description

racle Forms 10g release 2 : Demos, Tips and TechniquesHome page 1. Introduction Here is a collection of Oracle Forms 10g sample dialogs extracted from a complete Oracle Forms tutorial. This tutorial has been written in French and it would be too time consuming to translate it all in English. This is the reason why I have only extracted and translated these sample dialogs. The purpose of this article is not to teach how to build a new form from scratch. It intends to show some of the main advanced features of the product. To clearly understand in details how these dialogs work, you will have to open them in the Forms Builder and examine them thoroughly. However, in this article, I am going to explain the best I can the most important mechanisms of each sample. These sample have been tested with an Oracle Forms 10g release 10.1.2.0.2 on an Oracle Database 10g Express Edition Release 10.2.0.1.0. 2. Description of the sample dialogs 2.1 Main screen TUTO_FORMS.FMB This dialog is the entry point of the samples. Click on a button to start the corresponding dialog. 2.2 Canvases TEST_CANVAS.FMB This sample shows three types of canvas :    The content canvas (light green) The stacked canvas (white) The tab canvas (dark green) Stacked canvas A stacked canvas is displayed atop²or stacked on²the content canvas assigned to the current window. Stacked canvases obscure some part of the underlying content canvas, and often are shown and hidden programmatically. You can display more than one stacked canvas in a window at the same time A stacked canvas allows to scroll a big canvas in a delimited window. In this sample, the stacked canvas (CV_EMP_1) is twice bigger than its viewport. The <Down> button allows to move the stacked canvas programatically: Set_View_Property('CV_EMP_1', VIEWPORT_Y_POS_ON_CANVAS, 140) ; Here are the properties of this stacked canvas: Viewport Viewport X position Viewport Y position Viewport Width Viewport Height 77 11 212 138 Physical Viewport X position on canvas 0 Viewport Y position on canvas 0 Width Height 212 324 The second Stacked canvas (CV_EMP_3) demonstrates how to integrate in a Tab canvas: 3. update and delete from the target tables from this view. called from the three block-level triggers:    ON-INSERT ON-UPDATE ON-LOCK .FMB This sample show how you can base a block on a view that aggregate the columns of several tables (in this case. The code that handles the target table is located in a program unit.2.3 Blocks 2. DEPT and EMP) and when you can insert.1 Block based on a complex view TEST_BLOC_VUE. UPDATE DEPT SET WHERE Exception When no_data_found Then -.DEPTNO ) . -.DNAME DEPTNO = :EMP_DEPT.Not found -> insert -Message('Insert into DEPT table'). DNAME = :EMP_DEPT.DNAME ) . INSERT INTO DEPT ( DEPTNO.DEPTNO.This is the code of the ins_upd_emp_dept procedure: PROCEDURE ins_upd_emp_dept IS LN$Dummy PLS_INTEGER := 0 . End . -.Table EMP -Begin Select 1 Into LN$Dummy . :EMP_DEPT. DNAME ) VALUES ( :EMP_DEPT.Table DEPT -Begin Select 1 Into LN$Dummy From DUAL Where exists( select deptno from dept where deptno = :EMP_DEPT.DEPTNO . BEGIN -.Found -> update -Message('Update DEPT table'). ENAME = :EMP_DEPT. . End .From DUAL Where exists( select empno from emp where empno = :EMP_DEPT.EMPNO ) . :EMP_DEPT.EMPNO . -.Not found -> insert -Message('Insert into EMP table').EMPNO. ENAME ) VALUES ( :EMP_DEPT. INSERT INTO EMP ( EMPNO.ENAME ) .Found -> update -Message('Update EMP table').ENAME EMPNO = :EMP_DEPT. END. UPDATE EMP SET WHERE Exception When no_data_found Then -. 2.FMB This sample demonstrates how a block can be based on stored procedures.2 Block based on stored procedures TEST_BLOC_PROC.3. This feature can be implemented in two ways:   A REF CURSOR A PL/SQL table In addition to that. there are also two different locations where to implement this functionality:  The ON-xxx triggers . := :emp. END. delete and lock orders are managed in the corresponding On-xxx triggers: Example of ON-INSERT trigger: DECLARE LR$Emp emp_pkg.emp_insert( LR$Emp ). The transactionnal triggers In this sample. LR$Emp. REF CURSOR and ON-xxx triggers The Query Data Source Type is set to Procedure and the Query Data Source Name indicates the name of the query procedure.job LR$Emp.comm := :emp.sal LR$Emp.sal.empno := :emp. The insert.ename := :emp. Block1 (EMP). . The stored procedures are located in the PKG_EMP package shipped with the scripts. emp_pkg.job. update.empno.comm. BEGIN LR$Emp. := :emp. LR$Emp.ename. the top block uses a REF CURSOR with the ON-xxx triggers The bottom block uses a collection with the standard transactionnal triggers.emp_rec. The variable used as parameter is of type of emp_pkg.ename%TYPE. r. ename. emp. END emp_insert. r.ename. r.sal%TYPE. Then the emp_pkg.job.job%TYPE. emp. Collection and transactionnal triggers This block uses a collection of records with the emp.emp_insert() stored procedure: ------------.comm%TYPE). Block2 (EMP_TRG). r. CURSOR empselect IS . TYPE emptab IS TABLE OF emp_rec INDEX BY BINARY_INTEGER. job.emp_rec TYPE emp_rec IS RECORD( empno ename job sal comm emp. emp.comm).empno.emp_query procedure. emp. PROCEDURE emp_query(emp_data IN OUT emptab) IS ii NUMBER.pkg. comm) VALUES(r. sal.Insert ------------PROCEDURE emp_insert(r IN emp_rec) IS BEGIN INSERT INTO emp (empno.empno%TYPE.sal. END emp_query. (see them in detail in the EMP_PKG package) . emp_data( ii ). job. emp_data( ii ). The insert.comm.job. END LOOP. sal. emp_data( ii ). EXIT WHEN empselect%NOTFOUND. LOOP FETCH empselect INTO emp_data( ii ).empno. BEGIN OPEN empselect. emp_data( ii ).sal.delete and lock orders are also managed by stored procedures. ii := ii + 1. ename.ename. The collection of records is an IN OUT parameter. read from the database and returned to Forms.SELECT empno. comm FROM emp ORDER BY ename . ii := 1. update. Have also a look at the Query Data Source Column property that manages the relation between the columns of the collection and the items of the block. . 2. but we will see how easy it is to work with this sort of object via the ON-xxx triggers. VARCHAR2(100 BYTE).FMB In this dialog. TAB_TYP_CASE . There is no standard buit-in to base a block on a collection. NUMBER(8.3. we can see how to handle a table that contains a nested table (collection). Here is the description of the table (ARTICLES) CREATE TABLE ARTICLES ( CODE LIBELLE PRIX QTETOT CASES ) NESTED TABLE CASES STORE AS CASES_NT VARCHAR2(20 BYTE).2). NUMBER(8.0).3 Block based on a relational table that contains a collection TEST_COLLECTION. QUERY_DATA_SOURCE_NAME.EMP.CODE || ''') cases)' .RETURN AS VALUE. Set_Block_Property( 'CASES'. NUMBER In this sample.populate the block -Execute_Query . LC$Req ) . . Go_Block('CASES' ). Populate the detail block (nested table) The detail block (CASES) is dynamically populated each time a master record change in a When-NewRecord-Instance of the master block: Declare LC$Req Begin If :ARTICLES. Go_Block('ARTICLES') . the first block (ARTICLES) displays the standard columns of the ARTICLE table and the second block (detail) displays the columns of its nested table.CODE Is not null Then -. Else Go_Block('CASES' ). Clear_Block . Varchar2(256) . cases.QTE FROM TABLE ( SELECT cases FROM articles WHERE code = ''' || :ARTICLES. Clear_Block .Dynamic query of secondary block -LC$Req := '(SELECT cases. TAB_TYP_CASE is a table of objects of type : TYP_CASE create or replace TYPE TYP_CASE AS OBJECT ( EMP QTE ) VARCHAR2(10). -. TAB_TYP_CASE() ) . it will be no longer possible to insert anything in the nested table. . QTETOT.insert an empty collection Indeed. CASES ) VALUES ( :ARTICLES. PRIX.CODE. we have to handle the insertion into the ARTICLE table in a ON-INSERT trigger: ---------------------------------------------------------------we are doing an explicit insert because the new record cannot contain a NULL collection --- -------------------------------------------------------------INSERT INTO ARTICLES ( CODE.Go_Block('ARTICLES') .LIBELLE. End if . -. Because it is not possible to create a new article with a NULL collection. :ARTICLES. LIBELLE.QTETOT. :ARTICLES. End .PRIX. if we insert a NULL collection. :ARTICLES. ON-DELETE: -.Delete row in the collection -DELETE FROM TABLE ( SELECT cases FROM articles WHERE code = :ARTICLES. :CASES.QTE ) ).Then after.EMP. it is easy to manage the detail records with the ON-xxx triggers of the CASES block: ON-INSERT: -.CODE .Insert the row in the collection -INSERT INTO TABLE ( SELECT cases FROM articles WHERE code = :ARTICLES.CODE ) Values ( TYP_CASE( :CASES. EMP .) cases WHERE cases. . etc.emp = :CASES. (see the JANVIER. we can see how to base a block on several tables that share an identical structure. FEVRIER and MARS tables created by the install.FMB I this sample dialog.2.4 Block based on multiple data sources TEST_DATA_SOURCES.3.sql script) The list item is populated with the name of three tables that share the same structure: . CHOIX ). QUERY_DATA_SOURCE_NAME.choix . clear_form .CHOIX is not null Then :global. the source table of the block is changed dynamically in the When-List-Changed trigger: If :CTRL. -.Then. :global. go_block('TEST2'). execute_query.choix . :ctrl.choix := :ctrl.choix := :global.change the Query Data Source -Set_Block_Property('TEST2'. . End if . This sample is based on the object table (ARTICLE_OBJ) that contains a collection of references: create or replace TYPE REF_TYP_EMP AS OBJECT ( ref_emp REF TYP_EMP ) create or replace TYPE TAB_REF_TYP_EMP AS TABLE OF REF_TYP_EMP create or replace TYPE TYP_ARTICLES AS OBJECT .3.2.FMB Let¶s see how to manage an object table that contains a collection of references.5 Block based on an object table that contains a collection of references TEST_OBJETS. change the Query Data Source Name -Set_Block_Property( 'CASES'. NUMBER (8.ref_emp.collection The tip is the same that the one used to manage the relational table with nested table: . TAB_REF_TYP_EMP -.2).CODE || ''')' .ref_emp.CODE Is not null Then -.Dynamic query of secondary block -Varchar2(256) .populate the block -- .A when-New-Record-Instance trigger on the master block to populate the detail block (the collection of references): Declare LC$Req Begin If :ARTICLES. -. LC$Req ) .CODE || ''') emp WHERE emp. -. VARCHAR2 (20). emp.art = ''' || :ARTICLES. Clear_Block . NUMBER (8).emp EMP. QUERY_DATA_SOURCE_NAME. Go_Block('CASES' ). LC$Req := '(SELECT emp.ref_emp.qte QTE FROM TABLE( SELECT REMP FROM articles_obj WHERE CODE = ''' || :ARTICLES. VARCHAR2 (100).( CODE LIBELLE PRIX QTETOT REMP ) CREATE TABLE ARTICLES_OBJ OF TYP_ARTICLES NESTED TABLE REMP STORE AS REMP_NT RETURN AS VALUE. Execute_Query . Else Go_Block('CASES' ).QTETOT. Clear_Block .An ON-INSERT trigger to insert a new record with an empty collection: --------------------------------------------------------We are doing an implicit insert because the new record cannot contain a NULL collection --- ------------------------------------------------------INSERT INTO ARTICLES_OBJ VALUES ( TYP_ARTICLES ( :ARTICLES. :ARTICLES. :ARTICLES. End if . :ARTICLES. The collection of references is managed with the corresponding ON-xxx trigger of the detail block: ON-INSERT: . . Go_Block('ARTICLES') . Go_Block('ARTICLES') .CODE.LIBELLE. TAB_REF_TYP_EMP() ) ) .PRIX. End . emp = :CASES. || Forms_Ddl( LC$Req ) .ref_emp.CODE || ''' AND a.CODE And emp.art = :ARTICLES.EMP || ''') ) )' . .EMP .EMP = ''' || :CASES.ref_emp.-.ART = ''' || :ARTICLES. Begin LC$Req := 'INSERT INTO TABLE ( SELECT remp FROM ARTICLES_OBJ WHERE code = ''' || :ARTICLES. ON-DELETE: -.Insert a row (REF) in the collection -Declare LC$Req Varchar2(256) .CODE ''') VALUES ( REF_TYP_EMP ( (SELECT REF(a) FROM EMP_OBJ a WHERE a.CODE ) emp WHERE emp. End .Delete the row (REF) of the collection -DELETE FROM TABLE ( SELECT remp FROM ARTICLES_OBJ WHERE code = :ARTICLES. Click everywhere on each item to see some information messages and some particular behaviours.2.1 Principal items TEST_ITEMS. .4.FMB Here is a description of the main items.4 Items 2. 'RG_SEMAINES' ).4.2. CLEAR_LIST('BLOC2.Select the first value -:BLOC2. POPULATE_LIST('BLOC2. CLEAR_LIST('BLOC2.2 List items TEST_LISTES.List 1 -errcode := Populate_Group( 'RG_MOIS' ).FMB Let¶s study and handle the three sorts of list item and also the different ways to populate them.LISTE1'). the corresponding value and label are displayed. 'RG_MOIS' ). POPULATE_LIST('BLOC2. a) The first list item is populated with the RG_MOIS record group: -. b) Then init the second list item -. the three list items are synchronized.LISTE2'). Change the value of the first list and it will adapt the content of the second then the content of the third.LISTE2'.LISTE1'. For each new list value. 1 ) . . In this sample.LISTE1 := Get_List_Element_Value('BLOC2.LISTE1'. -.Update the weeks list -errcode := Populate_Group( 'RG_SEMAINES' ). -.LISTE3'.Select the first value -:BLOC2. 1 ) . BEGIN -. End loop . Clear_List( 'BLOC2. 1 ) .LISTE2)1) * 7)).Update the days list -LC$D := '01/01/2005' .LISTE3' ). LC$Day. For i IN 0.-. 'FMDay DD Month' ) Into LC$Day FROM dual . Add_List_Element('BLOC2.LISTE3 := Get_List_Element_Value('BLOC2. LC$Day ) .LISTE2 := Get_List_Element_Value('BLOC2. i + 1.Select the first value -:BLOC2.LISTE2'. . c) That finally init the third list item: PROCEDURE Init_Liste3 IS LC$D Varchar2(12) .. 'DD/MM/YYYY' ) + (i + ((To_number(:BLOC2.6 Loop SELECT to_char( To_date(LC$D.LISTE3'. LC$Day Varchar2(20) . END.Exception When Others then Null . . 3 Image items ALBUM_PHOTO. VARCHAR2(100 BYTE).2. CONSTRAINT PHOTO_PK PRIMARY KEY (IDENTIFIANT) ENABLE .4. You can build a photo album based on a one image¶s column table.0) NOT NULL ENABLE. CREATE TABLE PHOTOS ( LEGENDE PHOTO FORMAT CREDIT LIEN IDENTIFIANT NOM VARCHAR2(100 BYTE). BLOB NOT NULL ENABLE. NUMBER(5. VARCHAR2(50 BYTE) NOT NULL ENABLE.FMB This dialog is the main part of the ensemble that allows to search. attach and display images. VARCHAR2(50 BYTE) NOT NULL ENABLE. VARCHAR2(50 BYTE). It shows two ways to search a filename on the local machine with and without Webutil. By clicking on a picture.) . you can navigate on another canvas to display the detail of the picture: . because it is so easy to pick-up a file with the File_Open_Dialog() Webutil function.FMB The get_file_name sample dialog is only a ³pure exercice of style´ . This sample is interesting to see how to use the HOST() and TEXT_IO() functions to get the list of the local machine drives and their content.CHARGE_PHOTO. . CHARGE_PHOTO_WEBUTIL.FMB Another dialog to store the picture and its properties. . 4 Java Bean component TEST_GRAPH. This dialog use the Oracle FormsGraph Java Bean that is part of the Oracle Forms demos.jar file on the OTN page http://www.oracle.FMB Here is a sample to demonstrate how to handle a bean area.4. You can download the FormsGraph.com/technology/sample_code/products/forms/files/formsgraph_patch2005.zip .2. The first calculated item use the Summary calculation mode: The third one use a Formula calculation mode .4.2.FMB Let¶s see how to use the calculated items.5 Calculated items TESTS_CALCUL. . VARCHAR2(256) NOT NULL ENABLE. VARCHAR2(100). CREATE TABLE ( CODE TEXTE TITRE MESSAGES NUMBER(5. The message texts are read from the database then displayed via Alert boxes. To reduce the number of messages needed in the application.5 Alerts TEST_ALERTES_MESSAGES. some of them can take from 1 up to 3 parmeters (%1. %2 and %3).FMB This dialog shows how to use the Alert boxes to build the messaging engine of your Forms application. A pipe (|) character allows to split the message on several lines.text of the message -.Shall we stop the process ? (raise form_trigger_failure) ALERTE VARCHAR2(15).unique identifiant -.2.title of the alert STOP VARCHAR2(1) DEFAULT 'N' NOT NULL ENABLE.name of the alert box . -.0) NOT NULL ENABLE. The main block is based on the MESSAGES table. -. -. CONSTRAINT MSG_PK PRIMARY KEY (CODE) ENABLE ) This sample use the Affiche_Message() procedure of the TUTO_FORMS pl/sql library to display the messages.    AL_ERREUR wich is the simple ³OK´ alert box. AL_MSG_OUI_NON wich is a yes/no alert box (default yes) AL_MSG_NON_OUI wich is a yes/no alert box (default no) . These messages can be displayed through the 3 alert boxes available in every dialog of this demo. item.olb object library. . current record.2.). etc.FMB Let¶s see some ways to use the property classes and the visual attributes to colorize and highlight dynamically different objects of the form (alert. Property classes and visual attributes are located in the OBJ_TUTO_FORMS.6 Property classes and visual attributes TEST_CLASSES_PROP. 2. This zip file contains 2 sub directories: /config that contains the configuration files.7 Forms internal triggering events TEST_CYCLES. 3.FMB This dialog allows you to understand what trigger fire and in what order when you use the application.zip file shipped with the article. Before each particular action. Installation steps This sample dialog need database objects to run. /scripts that contains the Sql script files to create the database objects. you can clear the list of triggers window. All the necessary objects are provided in the tutoforms10g.zip file .  Download the tutoforms10g. This window show you what trigger is firing in what order and from what block and what item. env to the /forms/server directory . run the /scripts/install.%ORACLE_HOME%\forms\tutoforms\ myIcons. Create a new user in your database With Sql*plus or SqlDeveloper.jar. lookAndFeel=Oracle colorScheme=blaf logo=no #don't forget to put your own database connexion userid=tutoforms10g/tutoforms10g@XE  Copy the /tutoforms/config/tutforms10g.sql script note : because this demo use the Webutil functions. e.jar.bat file located in the same directory to compile all objects at once.%ORACLE_HOME%\jlib\debugger.env file to indicate your own settings (in blue in this example) #oracle home adapt this value to your own setting ORACLE_HOME=D:\Dev10gR2 FORMS_PATH=%ORACLE_HOME%\forms\tutoforms ORACLE_PATH=%ORACLE_HOME%\forms\tutoforms FORMS_TRACE_PATH=%ORACLE_HOME%\forms\tutoforms CLASSPATH=D:\Dev10gR2\forms\java\frmwebutil.jar. the Oracle user where you have created these objects must have the WEBUTIL_DB package compiled or a grant EXECUTE to this package if it is present in another schema.g. Under the /tutoforms/ directory compile all the source modules You can use the compile_all.   Unzip the tutoforms10g.jar.zip file under your <DEVSUITE_HOME>/forms/ directory. compile_all user/password@instance Edit the /tutoforms/config/tutforms10g..cfg    Edit the /tutoforms/config/ add_to_formsweb. # webutil config file path WEBUTIL_CONFIG=D:\Dev10gR2\forms\server\webutil. %ORACLE_HOME%\forms\tutoforms\FormsGraph.cfg file to set your own database connect string (in blue in this example) .. you can start the demo by indicating the new [tutoforms10g] formsweb.  Handle hierarchical trees Home page 1.cfg file Then. add the /tutoforms/config/ add_to_formsweb. .cfg section.cfg at the end of your /forms/server/formsweb. Purpose This is an article to show how to handle a hierachical tree in an Oracle Forms application. Initial status of the node -.Unique identifiant -. ICON VARCHAR2(40 BYTE). The table that contains the menu options : MENU CREATE TABLE MENU ( ID NUMBER(5).Dialog name to call LABEL VARCHAR2(128 BYTE). 2.Tree label -. MASTER NUMBER(5). STATUS NUMBER(1) VALUE VARCHAR2(128 BYTE) ) / ICON contains the icon name (without extension) attached to the node. There are 2 ways to populate a hierarchical tree in Forms:   Using a record group / query Building the tree with the Add_Tree_Node() built-in Because we want to handle a database stored menu. -.Parent ID DEFAULT 1. This table contains the corresponding menu options.The goal is to build a tree menu with the possibility of enabling the database roles. -. The database objects This example needs 2 tables to handle the menu options and their corresponding roles: 1. STATUS can take one of the three possible values:   0 normal (Not expandable) 1 expanded . this sample use the first option with a record group populated by a database table.Icon name -. . The table that contains the corresponding roles : MENU_ROLES CREATE TABLE MENU_ROLES ( ID NUMBER(5). -1 collapsed 2. This sample needs the ROLE_MENU1 and ROLE_MENU2 roles enabled.Role name ROLE VARCHAR2(30 BYTE) ) / If you want to enable the database roles in the tree menu.Menu identifiant -. -.. Here is the content of the tables after the provided script is executed: Table : MENU ID LABEL 1 2 Menu1 Menu1 Option 1 ICON MASTER STATUS VALUE mainmenu optionmenu 1 1 1 Dialog11 .. you have to execute the following steps :  Create the necessary roles in the database CREATE ROLE ROLE_MENU1 CREATE ROLE ROLE_MENU2 .  Grant the roles to the users GRANT ROLE_MENU1 to user1 GRANT ROLE_MENU1 to user2 .. ICON. LEVEL. LABEL. How to populate the hierarchical tree The Forms tree needs five column to work correctly: SELECT STATUS.3 4 5 6 7 Menu1 Option 2 Menu1 Option 3 Menu1 Opt 3 Sub Opt 3 Menu2 Menu2 Option1 optionmenu optionmenu suboptionmenu mainmenu optionmenu 1 1 4 1 1 1 -1 Dialog12 Dialog131 6 1 Dialog21 Table MENU_ROLES : ID ROLE 1 2 3 4 5 6 7 ROLE_MENU1 ROLE_MENU1 ROLE_MENU1 ROLE_MENU1 ROLE_MENU1 ROLE_MENU2 ROLE_MENU2 3. VALUE FROM MENU Four of them come from the table: STATUS that indicate the initiate status of the node LABEL that is the visible label of the node ICON that contains the (16x16 pixels) icon name of the node (can be NULL) VALUE that contains the value of the node . SET_TREE_PROPERTY(HTREE. HTREE := FIND_ITEM('BL_TREE. VALUE FROM MENU CONNECT BY PRIOR ID = MASTER START WITH MASTER IS NULL Two buttons are added to show how to expand or collapse all the nodes of the tree: .. . FTREE. FTREE. V_IGNORE := POPULATE_GROUP('RG_TREE').LEVEL. The tree is populated with a record group.. SELECT STATUS.. .RECORD_GROUP.. wich is a ³CONNECT BY´ specific pseudo-column specifies the depth at which the individual node appears. itself populated with a CONNECT BY query. LEVEL.MENU'). ICON.'RG_TREE'). LABEL. A single click populate the ³Node selected´ display item. A double click populate the ³Node activated´ display item and call the corresponding screen: . LABEL. SELECT m.ICON. For this purpose. m. LEVEL.A radio button allows to take into account the database roles.STATUS. the tree use another record group (RG_TREE_ROLES) that filters the query. m.VALUE FROM MENU m WHERE EXISTS ( Select ROLE From MENU_ROLES . m. fmb module (Oracle Forms 10.ID And ROLE IN (Select granted_role From user_role_privs) ) CONNECT BY PRIOR ID = MASTER START WITH MASTER IS NULL 4. The sample dialog  Download the tree.2)  Compile all and run the module Avoid duplicated records in a block Home page The purpose is to reject two records that contain duplicated values.Where ID = m.  Create the 2 roles ROLE_MENU1 and ROLE_MENU2.1.  Assign ROLE_MENU1 to one user and both roles to another user.zip file  Unzip the tree.sql script under Sql*Plus or Sql Developer.zip file  Run the tree_install. .  Copy the 4 icons of the /icons directory in your icons directory  Open the tree. The technique used to solve this problem comes from the Kevin D Clarke¶s calculated item famous solution. . It uses two calculated items. one in the data bock and another in a control block. Function COMPARAISON (val1 varchar2.deptno||:dept. end if. End.that we want to avoid duplicates on both DEPTNO and DNAME values. val2 varchar2) Return number Is answer number := 0. .MATCH_FOUND) is added to the DEPT block.charsave.dname) Notice in this case. :dept. It contains the formula as follow: Comparaison(:ctrl.The first calculated item (:DEPT. return(answer). Begin if val1 = val2 then answer := 1. It summarize the values contained in all the rows of the DEPT block (dept.COMPARAISON is a program unit stored in the Forms module.charsave) contains the bakup value of the current record. we have two duplicated data. then the function returns 1 (a value greatest than 0) if both the values are identical. The first value (:ctrl. If the total is greater than 1.match_found). The two values are compared to each other.MATCH_FOUND) is added to the CTRL block. The sample dialog . The DEPT block must have the following properties setting: Query all records YES The CTRL block must have the following properties setting: Query all records Single record Database data block YES YES NO The second calculated item (:CTRL.
Copyright © 2024 DOKUMEN.SITE Inc.