ORACLE Application Experience (1)

Source: Internet
Author: User

The ORACLE tutorial is: ORACLE Application Experience (1 ). JAN-1 (January) FEB-2 (February) MAR-3 (March)
APR-4 (Jun L) MAY-5 (May) JUN-6 (June)
JUL-7 (July) AUG-8 (August) SEP-9 (September)
OCT-10 (October) NOV-11 (November) DEC-12 (December)
**************************************** ****************************
********** **********************
--- On-log trigger writing example
Declare
Flag varchar2 (80): = null;
Cou number: = 1;
N number;
Begin
Loop
Logon (USERNAME, PASSWORD | @ | CONNECT, PROPERTY_FALSE ....);
Flag: = Get_Application_Property (DATASOURCE );
Exit when cou> 8 or flag = ORACLE;
Cou: = cou + 1;
End Loop;
If flag <> ORACLE then
Set_alert_property (a_1, alert_message_text,
Login Failed. Please return and try again );
N: = show_alert (a_1 );
Raise form_trigger_failure; -- interrupt FORM
End if;
End;
--- Query the base table (only for the base table)
Set_Block_Property (Block_Name, Default_Where, where ......);
Go_Block (Block_Name );
Execute_Query;
**************************************** ***********
Variable:
Local variables;
Global variable ------------ 1.: block. item
2.: parameter. v_name
3.: global. V_name

**************************************** ***********
--- Synchronous Display
Synchronize;
--- TRIGGER implementation
EXECUTE_TRIGGER (TRIGGER_NAME );
--- Clear Module
Clear_block (NO_VALIDATE); NO_VALIDATE does not take effect
-- Create a warning column and select it from the warning Column
Declare
N number;
Begin
Set_Alert_Property (Alert_Name, Alert_Message_Text, message );
N: = Show_Alert (Alert_Name );
If n = Alert_Button1 then
...;
ElsIf n = Alert_Button2 then
...;
End if;
End;
--- WINDOW settings
-- Maximize and minimize Runtime
Set_Window_Property (FORMS_MDI_WINDOW, WINDOW_STATE, MAXIMIZE | MINIMIZE );
-- WINDOW title
Set_Window_Property (FORMS_MDI_WINDOW, title, TEXT );
-- True for exit
Set_Window_Property (FORMS_MDI_WINDOW, REMOVE_ON_EXIT, PROPERTY_FALSE | TRUE );
--- Set the level of system prompt information
: System. Message_Level: = 5 | 10 | 15 | 20;
--- Set ITEM attributes
-- ENABLED
Set_Item_Property (Block_name.Item_name, ENABLED, PROPERTY_TRUE | FALSE );
-- Set the ITEM property NAVIGABLE
Set_Item_Property (Block_name.Item_name, NAVIGABLE, PROPERTY_TRUE | FALSE );
-- Sets the ITEM attribute VISUAL_ATTRIBUTE.
Set_Item_Property (Block_name.Item_name, visual_attribute, vname );
-- Vname is defined by (VISUAL_ATTRIBUTES) in the navigator.
-- Set the ITEM attribute DISPLAYED
Set_Item_Property (Block_name.Item_name, displayed, TRUE | FALSE );
-- Set the POSITION attribute of ITEM
Set_Item_Property (Block_name.Item_name, position, x, y );
-- Set ITEM_SIZE
Set_Item_Property (Block_name.Item_name, item_size, x, y );
-- Set the ITEM attribute LABLE
Set_Item_Property (Block_name.Item_name, LABEL, MESSAGE)
--- Set list item demonstration
Declare
N number;
Begin
Clear_list (b1.fkfs );
M: = populate_group (fkfs );
Populate_list (b1.fkfs, fkfs );
/*
FKFS is a record group;
*/
End;
--- Add LIST ITEM
Add_List_Element (list_name, list_index, list_label, list_value );
Add_List_Element (list_id, list_index, list_label, list_value );
--- Delete LIST ITEM
Delete_List_Element (list_name, list_index );
Delete_List_Element (list_id, list_index );
Example:
BEGIN
Delete_List_Element (years, 1 );
Add_List_Element (years, 1, 1994,199 4 );
END;
--- Obtain the composition of list item items
1. Get the total of LIST items
GET_LIST_ELEMENT_COUNT (list_id );
GET_LIST_ELEMENT_COUNT (list_name );
2. Obtain the list item tag.
GET_LIST_ELEMENT_LABEL (list_id, list_name, list_index );
GET_LIST_ELEMENT_LABEL (list_name, list_index );

3. Get the value of LIST ITEM
GET_LIST_ELEMENT_VALUE (list_id, list_index );
GET_LIST_ELEMENT_VALUE (list_name, list_index );

--- Set the time
DECLARE
Timer_id Timer;
One

[1] [2] [3] Next page

The ORACLE tutorial is: ORACLE Application Experience (1 ). _ Minute NUMBER (5): = 60000;
BEGIN
Timer_id: = CREATE_TIMER (emp_timer, one_minute, REPEAT | NO_REPEAT );
END;
--- Generate an EDITER box
DECLARE
Ed_id Editor;
Status BOOLEAN;
BEGIN
Ed_id: = Find_Editor (edit_name); --- defined by the edit_name Navigator

If not Id_Null (ed_id) THEN
Show_Editor (ed_id, NULL,: block_name.item_name, status );
ELSE
Message (Editor "Happy_Edit_Window" not found );
RAISE Form_Trigger_Failure;
End if;
END;
---- Generate a LOV box
DECLARE
Lv_id LOV;
Status BOOLEAN;
BEGIN
Lv_id: = Find_LOV (lov_name); --- lov_name is defined by the Navigator
-- IF Id_Null (lv_id) THEN
-- Lv_id: = Find_LOV (lov_name1); --- lov_name1 is defined by the navigator.
-- End if;
Status: = Show_LOV (lv_id, 10, 20 );
END;
--- Define an EXCEPTION
Declare
Err_1 exception;
Begin
If... then
Raise err-1;
End if;
Exception
When err_1 then
....
END;
--- Set application features (cursor type)
SET_APPLICATION_PROPERTY (CURSOR_STYLE,
CROSSHAIR | BUSY | HELP | DEFAULT | INSERTION );

**************************************** *******************************
***** ****************************
--- Convert the character string to all uppercase (UPPER) All lowercase (LOWER) the first letter in uppercase (INITCAP)
UPPER | LOWER | INITCAP (STRING)
--- Paste characters on the left (LPAD) and right (RPAD) of the file
LPAD | RPAD (STRING, LENGTH, SET) "LENGTH" indicates the total LENGTH of characters. "SET" indicates the pasting character.
--- Delete characters from the left (LTRIM) and right (RTRIM) of the file
LTRIM | RTRIM (SRTING, SET) "SET" is the character to be deleted
--- Locate the position of the character set in the string
INSTR (STRING, SET, N, M) from the STRING to find the SET starting from the nth position of the M
--- Absolute value of a number
ABS (VALUE)
--- MOD Mode
MOD (VALUE, divisor) returns the remainder of the divisor VALUE. It is often used to determine whether the VALUE is an integer.
--- Rounding VALUE from N bits into ROUND or TRUNC from N bits
ROUND | TRUNC (VALUE, N)
--- Return the VALUE symbol
SIGN (VALUE)

--- Maximum value of the List
GREATEST (N1, N1 ...);
Minimum value of the List
LEAST (N1, N1 ...);
--- Return the maximum integer smaller than or equal to the number.
FLOOR (VALUE) floor (1.3) = 1 floor (-1.3) =-2
--- Return the smallest integer greater than or equal to the number
CEIL (VALUE) cell (1.3) = 2 cell (-1.3) =-1

--- Obtain the string length
Substr (string, start, number) number is the string length, and start is the string start point.

--- DECODE function, multiple (if, then, else)
Decode (value, if1, then1, if2, then2,..., else)
--- Determine whether the VALUE is null (Null VALUE Replacement)
NVL (UALUE, WKFHZ) WKFHZ is a NULL return value. If it is not null, it is the original value.
--- Field Length
Length (: block_name.item_id)
--- Returns the ascII value of the first (leftmost) character of the string.
AscII (string)
--- Multiline VALUE (acting on multiple rows)
AVG (VALUE) Average
COUNT (VALUE) rows
MAX (VALUE) Maximum
MIN (VALUE) Minimum
SUM (VALUE) and
--- Character conversion
TRANSLATE (STRING, to be converted, conversion character );
For example, TEANSLATE (AAABBB, AB, BA) returns BBBAAA

--- Compare the values of multiple columns in a single row to obtain the maximum (greatest least (LEAST)
GREATEST | LEAST (column name, column name ,...)
--- Sort by expression or position
Order by expression OR location ASC | desc asc litre, DESC drop default ASC
**************************************** *******************************
**************************************** *******************************
--- Cursor attributes
(1) % ISOPEN open attribute Boolean open TRUE
Determines whether the cursor is opened. If not, the cursor is opened.
If not (CORSOR_NAME % ISOPEN) THEN
OPEN CORSOR_NAME;
End if;
FETCH CORSOR_NAME...
(2) % NOTFOUND: TRUE If no result is returned for the last FETCH.
OPEN CORSOR_NAME;
LOOP
FETCH CORSOR_NAME...
Exit when CORSOR_NAEM % NOTFOUND;
End loop;
(3) % FOUND: FALSE If no result is returned for the last FETCH.
OPEN CORSOR_NAME;

WHILE CORSOR_NAME % FOUND LOOP
......
FETCH CORSOR_NAME...
End loop;
CLOSE CORSOR_NAME;
(4) % rowcount numver indicates the number of rows retrieved by the cursor.
OPEN CORSOR_NAME;
LOOP
FETCH CORSOR_NAME...
Exit when CORSOR_NAME % ROWCOUNT> 5;
......
End loop;
CLOSE CORSOR_NAME;

--- Loop statement
(1) Basic cycle
LOOP
.....
Exit while; for example, (exit when x> 100)
End loop;
(2) WHILE Loop
WHILE such as (when x> 100) LOOP

Previous Page [1] [2] [3] Next page

The ORACLE tutorial is: ORACLE Application Experience (1 ). .....
End loop;
(3) numeric FOR loop X is a counter
For x in (impairment) Y. Z LOOP
.....
End loop;
(4) cursor FOR Loop


--- Exception (Exception) is between the nearest BEGIN and END
Exception
Syntax 1 when no data is found
When no_data_found then
Syntax 2 when any errors occur
When others then
Syntax 3 when multiple rows are found
WHEN TOO_MANY_ROWS THEN
Syntax 4: When conversion from a character to a number fails
WHEN INVALID_NUMBER THEN
Syntax 5: When Division by zero
WHEN ZERO_DIVIDE THEN
Syntax 6: when duplicate data is inserted into a unique index
WHEN DUP_VAL_ON_INDEX THEN
Syntax 7: When the cursor operation is invalid
WHEN INVALID_CURSOR THEN
Syntax 8: When a number, data conversion, string truncation, or mandatory error occurs
WHEN VALUE_ERROR THEN
**************************************** **********************************
**************************************** **********************************
-- Commonly used TEXT_IO
Delcare
Out_file text_io.file_type;
Begin
Out_file: = text_io.fopen (prn, w );
Text_io.new_line (out_file ,);
Text_io.put_line (out_file ,)
Text_io.fclose (out_file );
End;
--- Text input and output
TEXT_IO
TEXT_IO PACKAGE
TEXT_IO FCLOSE
TEXT_IO.FILE_TYPE
TEXT_IO.FOPEN
TEXT_IO.IS_OPEN
TEXT_IO.GET_LINE
TEXT_IO.NEW_LINE
TEXT_IO.PUT
TEXT_IO.PUTF
TEXT_IO.PUT_LINE
USING TEXT_IO CONSTRUCTS
----------------------------
Declare
Out_file Text_io.file_type;
L Varchar2 (100 );
L1 Varchar2 (100 );
L2 Varchar2 (100 );
Begin
Out_file: = text_io.fopen (c: \ ll \ login.txt, r );
If text_io.is_open (Out_file) then
Text_io.get_line (Out_file, L );
Text_io.get_line (Out_file, L1 );
Text_io.get_line (Out_file, L2 );
Else
Null;
End if;
End;
--- Clear global variables
Erase (global. var_name );
--- Hide windows, views, and menus
HIDE_WINDOW | VIEW | MENU (WINDOW | VIEW | MENU_name );
--- Add the parameter add_parameter.
Declare
Pl_id ParamList;
BEGIN
Pl_id: = Get_Parameter_List (tempdata );
If not Id_Null (pl_id) THEN
Destroy_Parameter_List (pl_id );
End if;
Pl_id: = Create_Parameter_List (tempdata );
Add_Parameter (pl_id, EMP_QUERY, DATA_PARAMETER, EMP_RECS );
Run_Product (REPORTS, empreport, SYNCHRONOUS, RUNTIME,
FILESYSTEM, pl_id, NULL );
END;
---
DECLARE
LArgs OLE2.LIST _ TYPE;
BEGIN
Word. hApp: = OLE2.CREATE _ OBJ (Word. Basic );
LArgs: = OLE2.CREATE _ ARGLIST;
OLE2.ADD _ ARG (lArgs,: ole. word_doc );
OLE2.INVOKE (Word. hApp, fileopen, lArgs );
OLE2.DESTROY _ ARGLIST (lArgs );
END;
**************
Delete from emp e
Where e. rowid>
(Select min (f. rowid) from emp f
4 where f. empno = e. empno );

Previous Page [1] [2] [3]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.