Oracle Application Experience (1) _oracle

Source: Internet
Author: User
Tags character set prev rowcount rtrim
The Oracle tutorial you are looking at is: Oracle Application Experience (1). JAN-1 (January) FEB-2 (February) MAR-3 (March)
APR-4 (April) MAY-5 (May) JUN-6 (June)
JUL-7 (July) AUG-8 (August) SEP-9 (September)
OCT-10 (October) NOV-11 (November) DEC-12 (December)
********************************************************************
Common Settings ********************************
---on-log Trigger writing Demo
Declare
Flag varchar2: =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 to retry ');
N:=show_alert (' a_1 ');
Raise Form_trigger_failure; --Break FORM
End If;
End;
---Execute a query against the base table (base tables only)
Set_block_property (' Block_name ', Default_where, ' Where ... ');
Go_block (' Block_name ');
Execute_query;
***************************************************
Variable:
local variables;
Global variable--------------1.:block.item
2.:p Arameter.v_name
3.:global. V_name

***************************************************
---sync occurrence display
Synchronize
---implement ' TRIGGER ' trigger
Execute_trigger (trigger_name);
---clear module
Clear_block (no_validate); ' No_validate ' does not take effect
--Creates a warning bar and is selected by the warning bar
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 running time, minimize
Set_window_property (Forms_mdi_window, Window_state, maximize| MINIMIZE);
--window Title
Set_window_property (Forms_mdi_window, title, ' TEXT ');
-whether the exit is true
Set_window_property (Forms_mdi_window, remove_on_exit,property_false| TRUE);
---Set the system hint information level
: system.message_level:= ' 5|10|15|20 ';
---Set Item property
--Set Item property enabled
Set_item_property (' Block_name. Item_name ', enabled,property_true| FALSE);
--Set Item property navigable
Set_item_property (' Block_name. Item_name ', navigable,property_true| FALSE);
--Set Item property Visual_attribute
Set_item_property (' Block_name. Item_name ', Visual_attribute, ' vname ');
--' vname ' is defined by the Navigator (visual_attributes)
--Set Item property displayed
Set_item_property (' Block_name. Item_name ', displayed,true| FALSE);
--Set Item property position
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 Item property lable
Set_item_property (' Block_name. Item_name ', LABEL, ' message ')
---set list item demo
Declare
&nbs

[1] [2] [3] [4] [5] Next page

The Oracle tutorial you are looking at is: Oracle Application Experience (1). P n number;
Begin
Clear_list (' B1.fkfs ');
M:=populate_group (' Fkfs ');
Populate_list (' B1.fkfs ', ' fkfs ');
/*
Where Fkfs is the 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 the ' LIST item ' item
Delete_list_element (List_name, List_index);
Delete_list_element (list_id, List_index);
Cases:
BEGIN
Delete_list_element (' Years ', 1);
Add_list_element (' Years ', 1, ' 1994 ', ' 1994 ');
End;
---Get the ' LIST item ' component
1. Get the sum of ' LIST ITEM '
Get_list_element_count (list_id);
Get_list_element_count (List_name);
2. Get the ' LIST ITEM ' label
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);

---setting ' time '
DECLARE
TIMER_ID Timer;
One_minute Number (5): = 60000;
BEGIN
timer_id: = Create_timer (' Emp_timer ', One_minute, repeat|no_repeat);
End;
---produce a ' 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;
----produce 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 a ' EXCEPTION ' exception
Declare
Err_1 exception;
Begin
If ... then
Raise err-1;
End If;
Exception
When Err_1 Then
....
End;
---settings apply attributes (cursor type)
Set_application_property (Cursor_style,
' Crosshair ' | BUSY ' | ' Help ' | ' DEFAULT ' | ' Insertion ');

***********************************************************************
function *********************************
---to turn the character of a string into all uppercase (UPPER) all lowercase (LOWER) The first letter of uppercase (INITCAP)
upper| lower| Initcap (STRING)
---paste characters on the left (' Lpad ') Right (' Rpad ') of the file
lpad| Rpad (String,length, ' Set ') "LENGTH" is the total character "set" for the pasted character
---Delete characters on the left (' LTRIM ') Right (' RTRIM ') of the file
ltrim| RTRIM (srting, ' Set ') ' Set ' for deleted characters
---Find the position of ' character set ' in the string
INSTR (' String ', ' Set ', n,m) from ' string ' to find ' SET ' from ' N ' bit to ' M '
Absolute value of---number
ABS (VALUE)
---' MOD ' mode
MOD (VALUE, divisor) returns ' divisor ' except ' value '

prev [1] [2] [3] [4] [5] Next page

The Oracle tutorial you are looking at is: Oracle Application Experience (1). ' The remainder is often used to determine whether ' VALUE ' is an integer
---Rounding ' VALUE ' from ' n ' bit ' ROUND ' or truncating ' TRUNC ' from ' n ' bit
round| TRUNC (Value,n)
---return the symbol ' VALUE '
SIGN (VALUE)

---The maximum value of a list
Greatest (n1,n1 ...);
Minimum value for list
Least (N1,n1 ...);
---Returns the largest integer less than or equal to the number
FLOOR (VALUE) FLOOR (1.3) =1 FLOOR (-1.3) =-2
---Returns the smallest integer greater than or equal to the number
Ceil (VALUE) cell (1.3) =2 cell (-1.3) =-1

---fetch string length
SUBSTR (string,start,number) number is string length, start is string start


---decode function, multiple (if,then,else)
Decode (value,if1,then1,if2,then2,....., else)
---Determine if ' value ' is empty (null value substitution)
NVL (Ualue, ' wkfhz ') ' wkfhz ' is null return value, NOT NULL is the original value
---field length
Length (: block_name.item_id)
---Returns the ASCII value of the first (leftmost) character of a string
AscII (String)
---Multiple lines of ' VALUE ' (acting on multiple ' lines ')
AVG (value) average
Count (VALUE) Number of rows
Max (value) max
Min (value) minimum
SUM (VALUE) and
---character conversion
TRANSLATE (STRING, ' pending characters ', ' convert character ');
such as Teanslate (' aaabbb ', ' AB ', ' BA ') return to ' BBBAAA '

---to compare the values of multiple columns in a single row to get the maximum (' greatest ' minimum (' least ')
Greatest| Least (column name, column name,...)
---Sort by expression or position
Order BY ' expression ' OR ' position ' asc| DESC ASC ' l ', DESC ' drop ' default ' ASC '
***********************************************************************
***********************************************************************
---the properties of a cursor
(1)%isopen Open attribute Boolean open to True
To determine if the ' cursor ' is turned on and open ' cursor ' if not open
IF not (Corsor_name%isopen) THEN
OPEN Corsor_name;
End IF;
FETCH corsor_name into ...
(2) The most recent ' FETCH ' of%notfound Boolean returns no result is true
OPEN Corsor_name;
LOOP
FETCH corsor_name into ...
EXIT when Corsor_naem%notfound;
End LOOP;
(3)%found Boolean last ' FETCH ' returns no results false
OPEN Corsor_name;

While Corsor_name%found loop
......
FETCH corsor_name into ...
End LOOP;
Close Corsor_name;
(4) Number of rows taken by the%rowcount numver type for the cursor
OPEN Corsor_name;
LOOP
FETCH corsor_name into ...
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 like (when x>100) loop
.....

prev [1] [2] [3] [4] [5] Next page

The Oracle tutorial you are looking at is: Oracle Application Experience (1).; End LOOP;
(3) numeric for loop ' X ' as counter
For X in (value minus) Y.. Z LOOP
.....
End LOOP;
(4) Cursor for loop


---Exception (exception) between the nearest ' BEGIN ' and ' End '
Exception
Syntax 1 when ' no data found '
When No_data_found Then
Syntax 2 when ' any error occurs '
When others then
Syntax 3 when ' discovering multiple lines '
When Too_many_rows THEN
Syntax 4 when ' character to number conversion failed '
When Invalid_number THEN
Syntax 5 when ' 0 is removed '
When Zero_divide THEN
Syntax 6 when ' inserting duplicate data into a unique index '
When Dup_val_on_index THEN
Syntax 7 when ' illegal cursor operation '
When Invalid_cursor THEN
Syntax 8 when ' digital, data conversion, truncated string or mandatory error '
When Value_error THEN
**************************************************************************
**************************************************************************
--Common 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:lllogin.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 ' WINDOW ', ' VIEW ', ' MENU '
hide_window| view| MENU (window| view| Menu_name);
---add 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 duplicate records **************
Delete from EMP E
where E.rowid >

prev [1] [2] [3] [4] [5] Next page

The Oracle tutorial you are looking at is: Oracle Application Experience (1).; (select min (f.rowid) from EMP F
4 where f.empno=e.empno);

prev [1] [2] [3] [4] [5]

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.