Please Visit Our New Website for Further Communication

Amazon

Showing posts with label D2K. Show all posts
Showing posts with label D2K. Show all posts

1 Apr 2013

System Variables

System Variables:
System variables are oracle form variables that is used to control the way an application behaves.

List of system Variables:

1)      System.Form_Status
2)      System.Block_Status
3)      System.Record_Status
4)      System.Coordination_Operation
5)      System.Master_Block
6)      System.Current_Block
7)      System.Current_Form
8)      System.Current_Item
9)      System.Current_Value
10)  System.Cursor_Block
11)  System.Cursor_Record
12)  System.Cursor_Item
13)  System.Cursor_Value
14)  System.Last_Form
15)  System.Last_Record
16)  System.Last_Query
17)  System.Message_Level
18)  System.Suppress_Working
19)  System.Mode

Synchronize Built-in

SYNCHRONIZE built-in:
SYNCHRONIZE built-in is used to synchronize the Terminal Screen with the internal state of the form.
SYNCHRONIZE update the screen display to reflect the information that Form Bulder has its internal representation of the screen.
Example:
                        BEGIN
FOR J IN 1..1000 LOOP
:Control.Id:=J;
SYNCHRONIZE;
Process_Element(J);
END LOOP;
END;

29 Mar 2013

Open_Form, Call_Form and New_Form

Multiple Forms can be invoked in an application through three built-in:

1)      OPEN_FORM
2)      CALL_FORM
3)      NEW_FORM

OPEN_FORM:

OPEN_FORM opens another form in a modeless window. The user can work on Multiple forms concurrently. The user can navigate within multiple forms.
With the OPEN_FORM the user can call another form in a different database session.
Syntax: OPEN_FORM (‘form_name’, active_mode, session_mode, data_mode, paramlist);   Default:   activate and no session mode.
OPEN_FORM is a restricted procedure and cannot be called in the Enter-Query mode.


CALL_FORM:

CALL_FORM calls another form in a Modal window. The user cannot navigate within different Forms. Requires to exit the called form before navigating back to the calling form. Forms are called in the same session.

NEW_FORM:

NEW_FORM exits the current form and opens the new form as a parent window.
NEW_FORM releases the memory by exiting the current form.

Benefits of Multiple form Applications are:

Easier to debug small form.
Flexibility between forms.
Easy to maintain.
Modularity.
Data can be exchanged between forms.

LOV (List Of Values)

LOV (List of Values):
An LOV is a scrollable popup window with either single or multi-column selection list.

Types of LOV:
Static LOV: Contains the predetermined values.
Dynamic LOV: Contains values that come at runtime.

LOV for Validation property of an item:
When LOV for validation is set to true, Oracle forms compares the current value of the text item to the values in the first column displayed in the LOV whenever the validation event occurs. If the value in the text item matches one of the values in the first column of LOV, validation succeeds, the LOV is not displayed and the processing continues normally. If the value in the text item does not match one of the values in the first column of the LOV, Oracle forms displays the LOV and uses the text item value as the search criteria to automatically reduce the list.

Built-in used to display the LOV are:
SHOW_LOV (Function)
LIST_VALUES (Procedure)


Built-in that are used for setting the LOV properties:
SET_LOV_PROPERTY
GET_LOV_PROPERTY

27 Mar 2013

Page Break vs Page Protect

Page Break Before:

The Page Break Before property indicates that you want the object to be formatted on the page after the page on which it is initially triggered to print.  Note that this does not necessarily mean that all the objects below the object with Page Break Before will move to the next page.
Suppose that you want each instance of a repeating frame to be on a logical page by itself.  First, set Maximum Records Per Page to 1 for the repeating frame so that only one instance appears on each logical page.  Then, specify Page Break Before and Page Break After, to make sure that the first instance of the repeating frame starts on a new logical page.

Page Break After

The Page Break After property indicates that you want all children of the object to be moved to the next page.  In other words, any object that is a child object of an anchor (implicit or explicit) to this object will be treated as if it has Page Break Before set to Yes.  Note that this does not necessarily mean that all the objects below the object with Page Break After will move to the next page.
Suppose that you want each instance of a repeating frame to be on a logical page by itself.  First, set Maximum Records Per Page to 1 for the repeating frame so that only one instance appears on each logical page.  Then, specify Page Break Before and Page Break After, to make sure that the first instance of the repeating frame starts on a new logical page.

Page Protect:

The Page Protect property indicates whether to try to keep the entire object and its contents on the same logical page.  Setting Page Protect to Yes means that if the contents of the object cannot fit on the current logical page, the object and all of its contents will be moved to the next logical page.
Suppose that you have a group report.  If at all possible, you would like to have all of the details and the master appearing on the same page.  To do this, you specify Page Protect for the master repeating frame (the outermost repeating frame).  If the details and the master cannot fit on the first page on which they are triggered to print, they will be triggered to print on the next page instead.

Lexical Parameter

Lexical Parameters:
Lexical Parameters performs dynamic SQL query.
Use to change the data definition at runtime.
Use Lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH.
Denoted by ‘&’.
You cannot make lexical references in a PL/SQL statement. However, use a bind Reference in PL/SQL to set the value of a parameter that is then referenced lexically in SQL.
Code is written in AFTER PARAMETER FORM Trigger.


Example:
     DATA MODEL QUERY:
     Select * from emp where dept_id=10 &status-----lexical parameter

    CODING AT AFTER PARAMETER FORM
    Function AfterPForm return Boolean is
    BEGIN
    IF :status=’ALL’ Then
    :status:=’AND (STATUS IN (“P”,”N”) OR STATUS IS NULL)’;
    ELSIF :status=’P’ Then
    :status:=’AND STATUS=”P” ‘;
    ELSE
    Null;
    END IF;
    END;

25 Feb 2013

Report Builder Columns


Different Columns contained in Report Builder are:
1)      Data Columns
2)      Formula Columns
3)      Summary Columns
4)      Placeholder Columns

Data Columns:
Data Columns contain the data values for a report.
Data Columns are corresponding to the table columns included in the select list of a query.
Each column is placed in the group associated with the query.

Formula Columns:
Formula Columns performs user-defined computations.
Formula Columns executes a PL/SQL function and must return a value.
Formula Columns can be placed at the Report or Query level.
Formula Columns should not be used to set a parameter’s value.
Formula Columns is denoted by CF_

Summary Columns:
Summary Columns are used for calculating summary information like
1)      Sum
2)      Average
3)      Minimum
4)      Maximum
5)      Count
6)      First
7)      Last
8)      % of Total
9)      Std Deviation
10)  Variance
Summary Columns can be placed at the Report or Query level.
Summary Columns is denoted by CS_

Placeholder Columns:
Placeholder Columns are storage areas in the Data Model.
Used for Temporary storage of data for future reference.
Placeholder Columns value can be set in the following places:
1)      Before Report Trigger
2)      Report-Level Formula Columns
Placeholder Columns can be populated by a Before Report Trigger but are generally populated by a Formula.
Although Placeholders allow PL/SQL to be written within them, they cannot be self-populated, their value must be set by an external program Unit, any attempts at self-population will result in a runtime compilation error. However the Formula assigned to the Placeholder must return a value.
Placeholder Columns is denoted by CP_
Example: At Formula column:
     Function CF_1formula return Number is
     Begin
             If :no_in_stock<10 then
                 :CP_1:=’Only’||:no_in_stock||’Items left in stock!!’;
             End if;
               Return 1;
     End;
Example at Placeholder column:
     Function CP_1formula return Char is
     Begin
               Return null;
     End;