SlideShare a Scribd company logo
Dimitri Gielis
Oracle APEX
Cheat Sheet
www.apexRnD.be
dgielis.blogspot.com
@dgielis
dgielis@apexRnD.be
Dimitri Gielis
❖ Founder & CEO of APEX R&D
❖ 20+ years of Oracle Experience 

(OCP & APEX Certified)
❖ Oracle ACE Director
❖ “APEX Developer of the year 2009” by Oracle Magazine
❖ “Oracle Developer Choice award (ORDS)” in 2015
❖ Author Expert Oracle APEX
❖ Presenter at Conferences
www.apexofficeprint.comwww.apexRnD.be
http://dgielis.blogspot.com @dgielis
Agenda
❖ Things I always have to look up in following domains:
❖ Database
❖ SQL
❖ PL/SQL
❖ APEX
Database
CREATE TABLE
Quick SQL
Demo
SQL
Get (comma) delimited string
https://docs.oracle.com/cloud/latest/db112/SQLRF/functions089.htm#SQLRF30030
Analytical functions
LAG - Before
LEAD - After
ROW_NUMBER
Oracle SQL Function Cheat Sheet
http://www.databasestar.com/oracle-sql-functions
Aggregate Functions
AVG ( [DISTINCT|ALL] expression ) [OVER (
analytic_clause )]
COUNT ( [ * | [ DISTINCT | ALL ] expression) [OVER
(analytic_clause)]
MAX ( [DISTINCT|ALL] expression ) [OVER
(analytic_clause)]
MIN ( [DISTINCT|ALL] expression ) [OVER (
analytic_clause )]
SUM ( [DISTINCT|ALL] expression ) [OVER
(analytic_clause)]
Conversion Functions
BIN_TO_NUM ( expression_list )
CAST ( expression AS type_name )
CAST ( MULTISET (subquery) AS type_name )
COALESCE ( expr1, expr2, [expr…] )
CHARTOROWID ( input_char )
FROM_TZ ( timestamp_value, timezone_value )
HEXTORAW ( charvalue )
NUMTODSINTERVAL ( number, interval_unit )
NUMTOYMINTERVAL ( number, interval_unit )
RAWTOHEX ( charvalue )
RAWTONHEX ( raw )
ROWIDTOCHAR ( rowid )
ROWIDTONCHAR ( rowid )
SCN_TO_TIMESTAMP ( number )
TIMESTAMP_TO_SCN ( timestamp )
TO_BINARY_DOUBLE ( expression [, format [,
nlsparam ] ] )
TO_CHAR( input_value, [format_mask],
[nls_parameter] )
TO_CLOB ( input_string )
TO_DATE( charvalue, [format_mask],
[nls_date_language] )
TO_DSINTERVAL ( input_string [, nlsparam] )
TO_LOB ( long_value )
TO_MULTI_BYTE ( string )
TO_NCHAR ( input_string )
TO_NCHAR ( input_datetime [, format [,nlsparam ] ] )
TO_NCHAR ( number [, format [, nlsparam ] ] )
TO_NCLOB ( lob_value )
TO_NUMBER ( input_value, [format_mask],
[nls_parameter] )
TO_SINGLE_BYTE ( input_string )
TO_TIMESTAMP ( input_string, [format_mask],
[‘nlsparam’] )
TO_TIMESTAMP_TZ ( input_string [, format_mask] [,
nls_param] )
TO_YMINTERVAL ( input_string )
UNISTR ( string )
Date and Time Functions
ADD_MONTHS ( input_date, number_months )
CURRENT_DATE
CURRENT_TIMESTAMP ( [precision] )
DBTIMEZONE
LAST_DAY ( input_date )
LOCALTIMESTAMP ( timestamp_precision )
MONTHS_BETWEEN ( date1, date2 )
NEW_TIME ( input_date, timezone1, timezone2 )
NEXT_DAY ( input_date, weekday )
SESSIONTIMEZONE
SYS_EXTRACT_UTC (
datetime_with_timezone_value )
SYSDATE
SYSTIMESTAMP
TZ_OFFSET ( timezone_name | time_value |
SESSIONTIMEZONE | DBTIMEZONE )
Environment Functions
CON_DBID_TO_ID ( container_dbid )
CON_GUID_TO_ID ( container_guid )
CON_NAME_TO_ID ( container_name )
CON_UID_TO_ID ( container_uid )
ORA_INVOKING_USER
ORA_INVOKING_USERID ( )
SYS_CONTEXT (namespace, parameter [, length] )
SYS_GUID()
SYS_TYPEID ( object_type_value )
UID
USER
USERENV ( parameter )
SQLCODE
SQLERRM ( error_number )
NLS Functions
NLS_CHARSET_DECL_LEN ( byte_count,
char_set_id )
NLS_CHARSET_ID ( string_value )
NLS_CHARSET_NAME ( number )
Numeric and Maths Functions
ABS ( number )
ACOS ( number )
ASIN ( number )
ATAN2 ( number1 [/|,] number2 )
BITAND ( expr1, expr2 )
CEIL ( input_val )
CORR ( expression1, expression2 )
COS ( number )
COSH (number)
COVAR_POP ( expression1, expression2 ) [OVER
(analytic_clause)]
COVAR_SAMP ( expression1, expression2 ) [OVER
(analytic_clause)]
CUME_DIST (expression1, … expression_n) WITHIN
GROUP (ORDER BY expression_order1, …
expression_order_n)
CUME_DIST() OVER ( [query_partition_clause]
ORDER BY order_clause )
DENSE_RANK ( expr, [expr(n)] ) WITHIN GROUP (
ORDER BY (order_expr [ASC|DESC] [NULLS
FIRST|LAST] )
DENSE_RANK() OVER ( [query_partition_clause]
order_by_clause)
EXP ( number )
EXTRACT ( date_component FROM expression )
FLOOR ( input_number )
GREATEST ( expr1, [expr_n] )
LEAST ( expr1, [expr_n] )
LN ( number )
LOG ( [base, ] expression )
MEDIAN ( expr ) [OVER (query_partition_clause)]
MOD ( numerator, denominator )
ORA_HASH ( expression [, max_bucket [,
seed_value ] ] )
PERCENT_RANK ( expression ) WITHIN GROUP (
ORDER BY (expression_n [. DESC | ASC ] [NULLS
FIRST|LAST] )
PERCENT_RANK () OVER ( [query_partition_clause]
order_by_clause )
PERCENTILE_CONT ( expression) WITHIN GROUP
( ORDER BY expression [ ASC | DESC ] [OVER (
query_partition_clause )
PERCENTILE_DISC ( expression) WITHIN GROUP (
ORDER BY expression [ ASC | DESC ] [OVER (
query_partition_clause )
POWER ( n2, n1 )
RANK ( expr ) WITHIN GROUP ( ORDER BY (
order_expr [NULLS FIRST/LAST] ) )
RANK () OVER ( [query_partition_clause]
order_by_clause )
REMAINDER ( n2, n1 )
ROUND ( input, roundto )
ROWNUM
ROW_NUMBER () OVER ( [ query_partition_clause]
order_by_clause )
SIGN ( number )
SIN ( number )
SINH ( number )
SQRT ( number )
STANDARD_HASH ( expression [, method ] )
STDDEV ( [DISTINCT | ALL] expression ) [OVER
(analytical_clause) ]
STDDEV_POP ( expression) [ OVER (
analytic_clause ) ]
STDDEV_SAMP ( expression) [ OVER (
analytic_clause ) ]
TAN ( number )
TANH ( number )
TRUNC ( date, fmt )
TRUNC ( number, decimals )
VAR_POP ( expression) [OVER ( analytic_clause )]
VAR_SAMP ( expression) [OVER ( analytic_clause )]
VARIANCE ( [ DISTINCT | ALL ] expression) [ OVER
( analytic_clause ) ]
WIDTH_BUCKET ( expression, min_value,
max_value, num_buckets )
String and Character Functions
ASCII ( charvalue )
ASCIISTR ( charvalue )
CHR ( number_code [USING NCHAR_CS] )
COMPOSE ( input_value )
CONCAT( string1, string2 )
CONVERT ( input_char, dest_char_set,
[source_char_set] )
DECODE ( expression, search, result [, search,
result]… [,default] )
DECOMPOSE ( input_string
[CANONICAL|COMPATIBILITY] )
DUMP ( expression [, return_format] [, start_position]
[, length] )
INITCAP ( input_string )
INSTR ( string, substring, [start_position],
[occurrence] )
INSTR2 ( string, substring, [start_position],
[occurrence] )
INSTR4 ( string, substring, [start_position],
[occurrence] )
INSTRB ( string, substring, [start_position],
[occurrence] )
INSTRC ( string, substring, [start_position],
[occurrence] )
LISTAGG ( measure_expr [, delimiter]) WITHIN
GROUP (order_by_clause) [OVER
query_partition_clause]
LENGTH ( string_value )
LENGTH2 ( string_value )
LENGTH4 ( string_value )
LENGTHB ( string_value )
LENGTHC ( string_value )
LOWER ( input_string )
LPAD( expr, length [, pad_expr] )
LTRIM( input_string, [trim_string] )
LNNVL ( condition )
NCHR ( number_code )
NLS_INITCAP ( input_char [, nlsparam ] )
NLS_LOWER ( input_char [, nlsparam ] )
NLS_UPPER ( input_char [, nlsparam ] )
NLSSORT ( input_char [, nlsparam ] )
NANVL ( check_value, replace_value )
NVL ( check_value, replace_value )
NVL2 ( value_to_check, value_if_not_null,
value_if_null )
NULLIF ( expr1, expr2 )
REGEXP_COUNT ( source_char, pattern [, position [,
match_pattern [, subexpression ] ] ] )
REGEXP_INSTR ( source_char, pattern [, position [,
occurrence [, return_option [, match_pattern [,
subexpression ] ] ] ] ] )
REGEXP_REPLACE ( source_char, pattern [,
replace_string [, position [, occurrence [,
match_parameter ] ] ] ] )
REGEXP_SUBSTR ( source_char, pattern [, position
[, occurrence [, match_parameter ] ] ] ] )
REPLACE ( whole_string, string_to_replace,
[replacement_string])
RPAD ( expr, length [, pad_expr] )
RTRIM ( input_string, [trim_character])
SOUNDEX ( string )
SUBSTR ( string, start_position, [length] )
TRANSLATE ( source, from_string, to_string )
TRANSLATE ( charvalue USING
{CHAR_CS|NCHAR_CS} )
TREAT ( expression AS [ REF ] [ schema. ] type )
TRIM ( [ [ LEADING | TRAILING | BOTH ]
trim_character FROM ] trim_source )
UPPER ( input_string )
VSIZE ( expression )
Analytic Functions
FIRST_VALUE ( expression [ IGNORE NULLS ] )
OVER ( analytic_clause )
LAST_VALUE ( expression [ IGNORE NULLS ] )
OVER ( analytic_clause )
LAG ( expression [, offset [, default] ] ) OVER ( [
query_partition_clause ] order_by_clause )
LEAD ( expression [, offset [, default] ] ) OVER ( [
query_partition_clause ] order_by_clause )
NTILE ( expression ) OVER (
[query_partition_clause] order_by_clause )
RATIO_TO_REPORT( expression ) OVER (
[query_partition_clause] )
Other Functions
CASE [expression]
WHEN condition_1 THEN result_1
WHEN condition_n THEN result_n
ELSE result
END case_name
SYS_CONNECT_BY_PATH ( column,
character_separator )
Grouping Functions
GROUP_ID ( )
GROUPING ( expression )
GROUPING_ID ( expression1 [, expression_n ] )
Large Object Functions
BFILENAME ( directory, filename )
EMPTY_BLOB ()
EMPTY_CLOB ()
Oracle SQL Function Cheat Sheet
http://www.databasestar.com/oracle-sql-functions
Aggregate Functions
AVG ( [DISTINCT|ALL] expression ) [OVER (
analytic_clause )]
COUNT ( [ * | [ DISTINCT | ALL ] expression) [OVER
(analytic_clause)]
MAX ( [DISTINCT|ALL] expression ) [OVER
(analytic_clause)]
MIN ( [DISTINCT|ALL] expression ) [OVER (
analytic_clause )]
SUM ( [DISTINCT|ALL] expression ) [OVER
(analytic_clause)]
Conversion Functions
BIN_TO_NUM ( expression_list )
CAST ( expression AS type_name )
CAST ( MULTISET (subquery) AS type_name )
COALESCE ( expr1, expr2, [expr…] )
CHARTOROWID ( input_char )
FROM_TZ ( timestamp_value, timezone_value )
HEXTORAW ( charvalue )
NUMTODSINTERVAL ( number, interval_unit )
NUMTOYMINTERVAL ( number, interval_unit )
RAWTOHEX ( charvalue )
RAWTONHEX ( raw )
ROWIDTOCHAR ( rowid )
ROWIDTONCHAR ( rowid )
SCN_TO_TIMESTAMP ( number )
TIMESTAMP_TO_SCN ( timestamp )
TO_BINARY_DOUBLE ( expression [, format [,
nlsparam ] ] )
TO_CHAR( input_value, [format_mask],
[nls_parameter] )
TO_CLOB ( input_string )
TO_DATE( charvalue, [format_mask],
[nls_date_language] )
TO_DSINTERVAL ( input_string [, nlsparam] )
TO_LOB ( long_value )
TO_MULTI_BYTE ( string )
TO_NCHAR ( input_string )
TO_NCHAR ( input_datetime [, format [,nlsparam ] ] )
TO_NCHAR ( number [, format [, nlsparam ] ] )
TO_NCLOB ( lob_value )
TO_NUMBER ( input_value, [format_mask],
[nls_parameter] )
Numeric and Maths Functions
ABS ( number )
ACOS ( number )
ASIN ( number )
ATAN2 ( number1 [/|,] number2 )
BITAND ( expr1, expr2 )
CEIL ( input_val )
CORR ( expression1, expression2 )
COS ( number )
COSH (number)
COVAR_POP ( expression1, expression2 ) [OVER
(analytic_clause)]
COVAR_SAMP ( expression1, expression2 ) [OVER
(analytic_clause)]
CUME_DIST (expression1, … expression_n) WITHIN
GROUP (ORDER BY expression_order1, …
expression_order_n)
CUME_DIST() OVER ( [query_partition_clause]
ORDER BY order_clause )
DENSE_RANK ( expr, [expr(n)] ) WITHIN GROUP (
ORDER BY (order_expr [ASC|DESC] [NULLS
FIRST|LAST] )
DENSE_RANK() OVER ( [query_partition_clause]
order_by_clause)
EXP ( number )
EXTRACT ( date_component FROM expression )
FLOOR ( input_number )
GREATEST ( expr1, [expr_n] )
LEAST ( expr1, [expr_n] )
LN ( number )
LOG ( [base, ] expression )
MEDIAN ( expr ) [OVER (query_partition_clause)]
MOD ( numerator, denominator )
ORA_HASH ( expression [, max_bucket [,
seed_value ] ] )
PERCENT_RANK ( expression ) WITHIN GROUP (
ORDER BY (expression_n [. DESC | ASC ] [NULLS
FIRST|LAST] )
PERCENT_RANK () OVER ( [query_partition_clause]
order_by_clause )
PERCENTILE_CONT ( expression) WITHIN GROUP
( ORDER BY expression [ ASC | DESC ] [OVER (
query_partition_clause )
PERCENTILE_DISC ( expression) WITHIN GROUP (
INITCAP ( input_string )
INSTR ( string, substring, [start_position],
[occurrence] )
INSTR2 ( string, substring, [start_position],
[occurrence] )
INSTR4 ( string, substring, [start_position],
[occurrence] )
INSTRB ( string, substring, [start_position],
[occurrence] )
INSTRC ( string, substring, [start_position],
[occurrence] )
LISTAGG ( measure_expr [, delimiter]) WITHIN
GROUP (order_by_clause) [OVER
query_partition_clause]
LENGTH ( string_value )
LENGTH2 ( string_value )
LENGTH4 ( string_value )
LENGTHB ( string_value )
LENGTHC ( string_value )
LOWER ( input_string )
LPAD( expr, length [, pad_expr] )
LTRIM( input_string, [trim_string] )
LNNVL ( condition )
NCHR ( number_code )
NLS_INITCAP ( input_char [, nlsparam ] )
NLS_LOWER ( input_char [, nlsparam ] )
NLS_UPPER ( input_char [, nlsparam ] )
NLSSORT ( input_char [, nlsparam ] )
NANVL ( check_value, replace_value )
NVL ( check_value, replace_value )
NVL2 ( value_to_check, value_if_not_null,
value_if_null )
NULLIF ( expr1, expr2 )
REGEXP_COUNT ( source_char, pattern [, position [,
match_pattern [, subexpression ] ] ] )
REGEXP_INSTR ( source_char, pattern [, position [,
occurrence [, return_option [, match_pattern [,
subexpression ] ] ] ] ] )
REGEXP_REPLACE ( source_char, pattern [,
replace_string [, position [, occurrence [,
match_parameter ] ] ] ] )
REGEXP_SUBSTR ( source_char, pattern [, position
[, occurrence [, match_parameter ] ] ] ] )
REPLACE ( whole_string, string_to_replace,
[replacement_string])
Grouping set: ROLLUP
ROLLUP
https://oracle-base.com/articles/misc/rollup-cube-grouping-functions-and-grouping-sets
Regular Expressions
select regexp_replace(column_name, '[^[:digit:]]', '')
from mytable;
Get number out of string - replace non numeric by nothing
Lookahead assertion +
Negative lookahead +
Lookbehind assertion +
Negative lookbehind +
Once-only Subexpression
Condition [if then]
Condition [if then else]
Comment
Assertions
?=
?!
?<=
?!= or ?<!
?>
?()
?()|
?#
Letters, numbers and hyphens
Date (e.g. 21/3/2006)
jpg, gif or png image
Any number from 1 to 50 inclusive
Valid hexadecimal colour code
8 to 15 character string with at least one
upper case letter, one lower case letter,
and one digit (useful for passwords).
Email addresses
HTML Tags
0 or more +
0 or more, ungreedy +
1 or more +
1 or more, ungreedy +
0 or 1 +
0 or 1, ungreedy +
Exactly 3 +
3 or more +
3, 4 or 5 +
3, 4 or 5, ungreedy +
Quantifiers
*
*?
+
+?
?
??
{3}
{3,}
{3,5}
{3,5}?
Any character except
new line (n) +
a or b +
Group +
Passive Group +
Range (a or b or c) +
Not a or b or c +
Letter between a and q +
Upper case letter +
between A and Q +
Digit between 0 and 7 +
nth group/subpattern +
Ranges
.
(a|b)
(...)
(?:...)
[abc]
[^abc]
[a-q]
[A-Q]
[0-7]
n
Global match
Case-insensitive
Multiple lines
Treat string as single line
Allow comments and
white space in pattern
Evaluate replacement
Ungreedy pattern
Pattern Modifiers
g
i
m
s
x
e
U
nth non-passive group
"xyz" in /^(abc(xyz))$/
"xyz" in /^(?:abc)(xyz)$/
Before matched string
After matched string
Last matched string
Entire matched string
Entire input string
Literal "$"
String Replacement (Backreferences)
$n
$2
$1
$`
$'
$+
$&
$_
$$
Escape Character +
New line +
Carriage return +
Tab +
Vertical tab +
Form feed +
Alarm
Backspace
Escape
Named Character
Special Characters

n
r
t
v
f
a
[b]
e
N{name}
Metacharacters (must be escaped)
[
{

|
>
^
$
(
)
<
.
*
+
?
Items marked + should work in most
regular expression implementations.Note
Ranges are inclusive.Note
These patterns are intended for reference purposes and have not been extensively tested.
Please use with caution and test thoroughly before use.Note
Control character
White space
Not white space
Digit
Not digit
Word
Not word
Hexadecimal character hh
Octal character xxx
Character Classes
c
s
S
d
D
w
W
xhh
Oxxx
Upper case letters
Lower case letters
All letters
Digits and letters
Digits
Hexadecimal digits
Punctuation
Space and tab
Blank characters
Control characters
Printed characters
Printed characters and
spaces
Digits, letters and
underscore
POSIX Character Classes
[:upper:]
[:lower:]
[:alpha:]
[:alnum:]
[:digit:]
[:xdigit:]
[:punct:]
[:blank:]
[:space:]
[:cntrl:]
[:graph:]
[:print:]
[:word:]
Start of line +
Start of string +
End of line +
End of string +
Word boundary +
Not word boundary +
Start of word
End of word
Anchors
^
A
$
Z
b
B
<
>
Sample Patterns
([A-Za-z0-9-]+)
(d{1,2}/d{1,2}/d{4})
([^s]+(?=.(jpg|gif|png)).2)
(^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^50$)
(#?([A-Fa-f0-9]){3}(([A-Fa-f0-9]){3})?)
((?=.*d)(?=.*[a-z])(?=.*[A-Z]).{8,15})
(w+@[a-zA-Z_]+?.[a-zA-Z]{2,6})
(<(/?[^>]+)>)
Available free from
AddedBytes.com
http://www.cbs.dtu.dk/courses/27610/regular-expressions-cheat-sheet-v2.pdf
Want to learn more about Regular Expressions?
Demo
PL/SQL
Documentation
https://github.com/OraOpenSource/plsql-md-doc/blob/master/docs/demo.md
Documentation generation
❖ Use snippets
❖ Use extension e.g. PL/SQL in Visual Studio Code
Error Package
Create reusable components !!
Demo
APEX
APEX Dictionary
❖ SELECT * FROM APEX_DICTIONARY
Substitution Strings
❖ Bind variable: :ITEM
❖ Substitution String: &ITEM.
❖ PL/SQL: v(‘ITEM’)
❖ Template: #ITEM#
Substitution Strings
❖ HTML escapes reserved HTML characters
❖ &ITEM!HTML.
❖ #REPORT_COLUMN!HTML#
❖ ATTR escapes reserved characters in a HTML attribute
❖ #REPORT_COLUMN!ATTR#
❖ removes HTML tags from the output and escapes reserved
HTML characters
❖ &ITEM!STRIPHTML.
❖ #REPORT_COLUMN!STRIPHTML#
APEX_ESCAPE.HTML
APEX_ESCAPE.HTML_ATTRIBUTE
wwv_flow_utilities.striphtml
Substitution Strings
❖ JS escapes reserved characters in a JavaScript
❖ &ITEM!JS.
❖ #REPORT_COLUMN!JS#
APEX_ESCAPE.JS_LITERAL
Built-in Substitution Strings
❖ APEX$ROW_NUM
❖ APEX$ROW_SELECTOR
❖ APEX$ROW_STATUS
❖ APP_ID
❖ APP_ALIAS
❖ APP_AJAX_X01, ... APP_AJAX_X10
❖ APP_DATE_TIME_FORMAT
❖ APP_IMAGES
❖ APP_NLS_DATE_FORMAT
❖ APP_NLS_TIMESTAMP_FORMAT
❖ APP_NLS_TIMESTAMP_TZ_FORMAT
❖ APP_PAGE_ALIAS
❖ APP_PAGE_ID
❖ APP_REQUEST_DATA_HASH
❖ APP_SESSION
❖ APP_SESSION_VISIBLE
❖ APP_TITLE
❖ APP_UNIQUE_PAGE_ID
❖ APP_USER
❖ AUTHENTICATED_URL_PREFIX
❖ BROWSER_LANGUAGE
❖ CURRENT_PARENT_TAB_TEXT
❖ DEBUG
❖ HOME_LINK
❖ IMAGE_PREFIX
❖ JET_BASE_DIRECTORY
❖ JET_CSS_DIRECTORY
❖ JET_JS_DIRECTORY
❖ LOGIN_URL
❖ LOGOUT_URL
❖ PRINTER_FRIENDLY
❖ PROXY_SERVER
❖ PUBLIC_URL_PREFIX
❖ REQUEST
❖ Using REQUEST
❖ SCHEMA OWNER
❖ SQLERRM
❖ SYSDATE_YYYYMMDD
❖ THEME_DB_IMAGES
❖ THEME_IMAGES
❖ WORKSPACE_IMAGES
❖ WORKSPACE_ID
Environment variables
owa_util.print_cgi_env
owa_util.get_cgi_env(‘VARIABLE_NAME’)
APEX URL
f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
APEX URL
f?p=APP:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
- Application Id: 1

- Application Id: &APP_ID.
- Application Alias: MY_APP

- Application Alias: &APP_ALIAS.
- Application in a specific Workspace: &c=WORKSPACE
APEX URL
f?p=App:PAGE:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
- Page Id: 1

- Page Id: &APP_PAGE_ID.
- Unique Page View Id: &APP_UNIQUE_PAGE_ID.

(use in request or debug - you can not use it to navigate as it’s unique for the view)
- Page Alias: MY_PAGE

- Page Alias: &APP_PAGE_ALIAS.
APEX URL
f?p=App:Page:SESSION:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
- Session Id: &SESSION.

- Session Id: &APP_SESSION_ID.
- Session 0: 0

- Session 0: &APP_SESSION_VISIBLE.
APEX URL
f?p=App:Page:Session:REQUEST:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
- Application Button
- Request: APPLICATION_PROCESS=XYZ
- Interactive Report: IR[static id]_SAVED_REPORT
- Clone an APEX session: APEX_CLONE_SESSION
APEX URL
f?p=App:Page:Session:Request:DEBUG:ClearCache:itemNames:itemValues:PrinterFriendly
- YES
- NO
- Leveln (n between 1 and 9)
- &DEBUG.
APEX URL
f?p=App:Page:Session:Request:Debug:CLEARCACHE:itemNames:itemValues:PrinterFriendly
- Page Number(s): comma separated
- Collection Names
- RP: Reset Region Pagination
- APP: All Pages, All Application Items, Remove User Sort
- SESSION: All used apps in that session
APEX URL
f?p=App:Page:Session:Request:Debug:Clearcache:ITEMNAMES:ITEMVALUES:PrinterFriendly
- Items comma separated
- Values comma separated; not allowed to have “:”

when using comma use backslash /12,34/
- IR columns: IREQ_CUST_FIRST_NAME
APEX URL
f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
- YES
- NO
APEX URL
f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly

&p_lang=en
- Choose language
APEX URL
f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly

&p_trace=YES
- Enable tracing: generates a trace file
- YES
- NO
Generate an APEX URL
❖ apex_util.prepare_url(

‘f?p=&APP_ID.:HOME:&APP_SESSION.::::P1_X:’ || :P1_X

);
Generate an APEX URL
❖ apex_page.get_url(

p_page => 1,

p_items => 'P1_X,P1_Y',

p_values => 'somevalue,othervalue' 

);
PL/SQL APIs for URLs
❖ APEX_UTIL.URL_ENCODE
❖ APEX_UTIL.HOST_URL
❖ APEX_UTIL.REDIRECT_URL
❖ APEX_MAIL.GET_INSTANCE_URL
❖ APEX_MAIL.GET_IMAGES_URL
❖ API to generate URLs for use in APEX: 

https://livesql.oracle.com/apex/livesql/file/content_CPSSPPZRWVADCX4KAMR6ZZB62.html
JavaScript and URLs
❖ apex.navigation.dialog
❖ apex.navigation.openInNewWindow
❖ apex.navigation.popup
❖ apex.navigation.redirect
❖ show inline dialog -> openModal(‘dialog_auto')
https://docs.oracle.com/database/apex-5.1/AEAPI/apex-navigation-namespace.htm#AEAPI29504
JavaScript and URLs
❖ apex.server.url ({

p_request: "DELETE",

x01: "test",

pageItems: "#P1_DEPTNO,#P1_EMPNO" });

❖ apex.server.process ( "MY_PROCESS", {

x01: "test",

pageItems: "#P1_DEPTNO,#P1_EMPNO"

},{

success: function( pData )

// do something here

}

} );
=> APEX_APPLICATION.G_X01
Referencing Custom Items
❖ If you need to create your own items, you can access
them after a page is submitted by referencing
APEX_APPLICATION.G_FXX (01-50)
APEX_MAIL
Download document
sys.htp.flush;
sys.htp.init;
owa_util.mime_header(‘application/octet-stream',false);
sys.htp.p(‘Content-length:'||dbms_lob.getlength(l_blob));
sys.htp.p(‘Content-Disposition:attachment;filename=“output.pdf”’);
owa_util.http_header_close;
wpg_docload.download_file(l_blob);
apex_application.stop_apex_engine;
APEX Builder

Built-in Help
Oracle APEX Cheat Sheet
Universal Theme 

Cheat Sheet
https://apex.oracle.com/ut
APEX Builder Keyboard
Cheat Sheet
Oracle APEX 5 Keyboard Shortcuts Keyboard Shortcuts
by Scott (sspendol) via cheatography.com/24422/cs/6036/
Actions
Func​tion Mac PC
Save Ctrl+O​ption+S Ctrl+Alt+S
Save and Run Page Ctrl+O​ption+R Ctrl+Alt+R
Undo Ctrl+Z Ctrl+Z
Redo Ctrl+Y Ctrl+Y
Region Actions
Display From Here Ctrl+O​ption+D Ctrl+Alt+D
Display From Page Ctrl+O​ption+T Ctrl+Alt+T
Restor​e/E​xpand Option+F11 Alt+F11
Toggle Empty Region Positions Ctrl+O​ption+E Ctrl+Alt+E
Miscel​laneous
Help Option+F1 Alt+F1
Messages Ctrl+F1 Ctrl+F1
Page Search Ctrl+O​ption+F Ctrl+Alt+F
Keyboard Shortcuts Option​+Sh​ift+F Alt+Sh​ift+F1
Regions
Func​tion Mac PC
Rendering Option+1 Alt+1
Dynamic Actions Option+2 Alt+2
Processing Option+3 Alt+3
Page Shared Components Option+4 Alt+4
Grid Layout Option+5 Alt+5
Property Editor Option+6 Alt+6
Gallery Regions Option+7 Alt+7
Gallery Items Option+8 Alt+8
Gallery Buttons Option+9 Alt+9
By Scott (sspendol)
cheatography.com/sspendol/
spendolini.blogspot.com
Published 10th November, 2015.
Last updated 10th November, 2015.
Page 1 of 1.
Sponsored by Readability-Score.com
Measure your website readability!
https://readability-score.com
APEX Plug-in Cheat Sheet
type t_page_item is record (
id number,
name varchar2(255),
label varchar2(4000),
plain_label varchar2(4000),
format_mask varchar2(255),
is_required boolean,
lov_definition varchar2(4000),
lov_display_extra boolean,
lov_display_null boolean,
lov_null_text varchar2(255),
lov_null_value varchar2(255),
lov_cascade_parent_items varchar2(255),
ajax_items_to_submit varchar2(255),
ajax_optimize_refresh boolean,
element_width number,
element_max_length number,
element_height number,
element_attributes varchar2(2000),
element_option_attributes varchar2(4000),
escape_output boolean,
attribute_01 varchar2(32767), … );
type t_page_item_render_result is record (
is_navigable boolean default false,
navigable_dom_id varchar2(255) );
type t_page_item_validation_result is record (
message varchar2(32767),
display_location varchar2(40), /* if not set the app default is used */
page_item_name varchar2(255) ); /* if not set the validated page item
name is used */
Render function
function <name of function> (
p_item in apex_plugin.t_page_item,
p_plugin in apex_plugin.t_plugin,
p_value in varchar2,
p_is_readonly in boolean,
p_is_printer_friendly in boolean )
return apex_plugin.t_page_item_render_result;
apex_plugin: item
type t_region is record (
id number,
static_id varchar2(255),
name varchar2(255),
type varchar2(255),
source varchar2(32767),
error_message varchar2(32767),
attribute_01 varchar2(32767), … );
Render function
function <name of function> (
p_region in apex_plugin.t_region,
p_plugin in apex_plugin.t_plugin,
p_is_printer_friendly in boolean )
return apex_plugin.t_region_render_result;
apex_plugin: region
type t_dynamic_action is record (
id number,
action varchar2(50),
attribute_01 varchar2(32767), … );
type t_dynamic_action_render_result is record (
javascript_function varchar2(32767),
ajax_identifier varchar2(255),
attribute_01 varchar2(32767), … );
Render function
function <name of function> (
p_dynamic_action in apex_plugin.t_dynamic_action,
p_plugin in apex_plugin.t_plugin )
return apex_plugin.t_dynamic_action_render_result;
apex_plugin: DA
type t_process is record (
id number,
name varchar2(255),
success_message varchar2(32767),
attribute_01 varchar2(32767), … );
type t_process_exec_result is record (
success_message varchar2(32767) );
Execute function
function <name of function> (
p_process in apex_plugin.t_process,
p_plugin in apex_plugin.t_plugin )
return apex_plugin.t_process_exec_result;
apex_plugin: process
Returns the name attribute which has to be used for a HTML input element
if you want that the value of the element is stored in session state when the
page is submitted. If you have a HTML input element which returns multiple
values (eg. select list with multiple="multiple") you have to set p_is_multi_value.
Note: This function has to be called before you write something to the HTTP buffer
with HTP.P(RN)
function get_input_name_for_page_item (
p_is_multi_value in boolean )
return varchar2;
function escape (
p_value in varchar2,
p_escape in boolean ) return varchar2;
Note: if both values are null, TRUE will be returned as well.
function is_equal (
p_value1 in varchar2,
p_value2 in varchar2 ) return boolean;
Returns the position in the list where p_value is stored. If it's not found
null will be returned.
function get_position_in_list (
p_list in wwv_flow_global.vc_arr2,
p_value in varchar2 ) return number;
Outputs the value in an escaped form. It's also taking care of chunking big strings into smaller outputs.
procedure print_escaped_value (
p_value in varchar2 );
Outputs a hidden field to store the page item value if the
page item is rendered readonly but not printer friendly
procedure print_hidden_if_readonly (
p_item_name in varchar2,
p_value in varchar2,
p_is_readonly in boolean,
p_is_printer_friendly in boolean,
p_id_postfix in varchar2 default null );
Outputs a hidden protected field to store the page item value.
procedure print_hidden_protected (
p_item_name in varchar2,
p_value in varchar2,
p_id_postfix in varchar2 default null );
Outputs a SPAN tag for a display only field.
procedure print_display_only (
p_item_name in varchar2,
p_display_value in varchar2,
p_show_line_breaks in boolean,
p_escape in boolean,
p_attributes in varchar2,
p_id_postfix in varchar2 default '_DISPLAY' );
Outputs an OPTION tag. The values are always escaped.
procedure print_option (
p_display_value in varchar2,
p_return_value in varchar2,
p_is_selected in boolean,
p_attributes in varchar2,
p_escape in boolean default true );
Outputs a JSON response based on the result of a two column LOV in the format:
[{"d":"display","r":"return"},{"d":...,"r":...},...]
p_component_name is the name of the page item or report column, ... which is used in case an error has to be displayed.
Note: The HTTP header is initialized with mime type "application/json"
procedure print_lov_as_json (
p_sql_statement in varchar2,
p_component_name in varchar2,
p_escape in boolean,
p_support_legacy_lov in boolean default false /*internal use only! */);
Returns a Javascript array with all the page items which are really on the
current and on page 0. p_bind_variable_list are the bind variables returned by wwv_flow_utilities.get_binds
function get_depending_fields (
p_bind_variable_list in wwv_flow_global.vc_arr2 )
return varchar2;
apex_plugin_util
type t_plugin is record (
name varchar2(45),
file_prefix varchar2(4000),
attribute_01 varchar2(32767), … );
apex_plugin: plugin
apex_plugin: functions
* For a complete refererence check the apex_plugin and apex_plugin_util packages
Returns the AJAX identifier which has to be used for the on-demand
call of a plug-in. Note: if the plug-in doesn't have an AJAX callback
configured, null will be returned!
function get_ajax_identifier return varchar2;
apex_plugin_util
Executes the query and returns the values for each column.
Note: All column values are returned as a string
p_sql_statement: SQL statement which should be executed.
p_min_columns and p_max_columns: Used to check if the
SQL statement complies to the number of required columns.
p_component_name: The name of the page item or report
column which is used in case an error has to be displayed.
p_search_type: Use one of the c_search_* constants.
p_search_column_no: Column which should be used to restrict
the SQL statement. Has to be in range of p_min_column and p_max_column.
p_search_string: Value which should be used to restrict the query.
p_first_row: Skips all rows before the specified row. Can be used for pagination.
p_max_rows: Limits the number of returned rows.
function get_data (
p_sql_statement in varchar2,
p_min_columns in number,
p_max_columns in number,
p_component_name in varchar2,
p_search_type in varchar2 default null,
p_search_column_no in varchar2 default 2,
p_search_string in varchar2 default null,
p_first_row in number default null,
p_max_rows in number default null,
p_support_legacy_lov in boolean default false /* internal use only! */ )
return t_column_value_list;
Advanced version of get_data, returns the column values with original data types.
p_data_type_list: If provided checks that the data type for each column matches to
the specified data type in the array. Use the constants c_data_type_* for available data types.
function get_data2 (
p_sql_statement in varchar2,
p_min_columns in number,
p_max_columns in number,
p_data_type_list in wwv_flow_global.vc_arr2 default c_empty_data_type_list,
p_component_name in varchar2,
p_search_type in varchar2 default null,
p_search_column_no in varchar2 default 2,
p_search_string in varchar2 default null,
p_first_row in number default null,
p_max_rows in number default null )
return t_column_value_list2;
Gets the display value for the value specified in p_search_string.
p_component_name: The name of the page item or report column, ... which
is used in case an error has to be displayed.
p_display_column_no: Column which should be returned from the SQL statement.
Has to be in range of p_min_column and p_max_column.
p_search_column_no: Column which should be used to restrict the SQL statement.
Has to be in range of p_min_column and p_max_column.
p_search_string: Value which should be looked up.
p_display_extra: If set to TRUE and a value isn't found, the search value will be
added to the result instead.
Note: In the case multiple rows are returned by the query, just the first one is returned.
function get_display_data (
p_sql_statement in varchar2,
p_min_columns in number,
p_max_columns in number,
p_component_name in varchar2,
p_display_column_no in binary_integer default 1,
p_search_column_no in binary_integer default 2,
p_search_string in varchar2,
p_display_extra in boolean default true,
p_support_legacy_lov in boolean default false /* for internal use only! */ )
return varchar2;
Gets the display values for the values specified in p_search_value_list.
function get_display_data (
p_sql_statement in varchar2,
p_min_columns in number,
p_max_columns in number,
p_component_name in varchar2,
p_display_column_no in binary_integer default 1,
p_search_column_no in binary_integer default 2,
p_search_value_list in wwv_flow_global.vc_arr2,
p_display_extra in boolean default true,
p_support_legacy_lov in boolean default false /* for internal use only! */ )
return wwv_flow_global.vc_arr2;
Returns a jQuery selector based on a comma delimited string of page item names.
function page_item_names_to_jquery (
p_page_item_names in varchar2 )
return varchar2;
Returns a cleaned up version of a comma delimited string of page item names
where all spaces are removed, colons are replaced with a comma and the page item
names are converted to uppercase. This is important for JavaScript code, because page
item names are case sensitive in the browser.
function cleanup_page_item_names (
p_page_item_names in varchar2 )
return varchar2;
apex_javascript
Adds the script tag to load a javascript library.
p_name: has to be specified without .js
p_directory: has to have a trailing slash
p_version: version identifier which should be added to the library name
p_skip_extension: if true the extension .js is NOT added
procedure add_library(
p_name in varchar2,
p_directory in varchar2 default wwv_flow.g_image_prefix||'javascript/',
p_version in varchar2 default c_apex_version,
p_skip_extension in boolean default false );
Adds a javascript code snippets to the HTML output which is executed at the onload event.
If an entry with the same key exists it will be ignored.
If p_key is null the snippet will always be added.
p_code: javascript code snippet. eg: $s('P1_TEST', 'abc');
p_key: name of the key. eg: APEX_WIDGET
procedure add_onload_code(
p_code in varchar2,
p_key in varchar2 default null);
Adds a code snippet which is included inline into the HTML output
eg. You can use this procedure to add new functions or global variable declarations.
Note: if you want to execute code, you should use add_onload_code
If an entry with the same key exists it will be ignored.
If p_key is null the snippet will always be added.
p_code: javascript code snippet. eg: $s('P1_TEST', 123);
p_key: identifier for the code snippet. If specified and a code snippet with the same name has
already been added the new code snippet will be ignored.
procedure add_inline_code(
p_code in varchar2,
p_key in varchar2 default null);
Escapes a text so that it can be used in JavaScript without problems.
Replaces  with , / with /, " with u0022, ' with u0027, tab with t,chr(10) with n.
function escape (
p_text in varchar2 ) return varchar2;
apex_css
Adds the style tag to load a css library.
p_name: has to be specified without .js
p_directory: has to have a trailing slash
p_version: version identifier which should be added to the library name
p_skip_extension: if true the extension .css is NOT added
procedure add_file (
p_name in varchar2,
p_directory in varchar2 default wwv_flow.g_image_prefix||'css/',
p_version in varchar2 default c_apex_version,
p_skip_extension in boolean default false );
Adds a CSS style snippet which is included inline into the HTML output
eg. You can use this procedure to add new css style declarations.
If an entry with the same key exists it will be ignored.
If p_key is null the snippet will always be added.
p_style: CSS style snippet. eg: #test { color:#fff }
p_key: identifier for the style snippet. If specified and a style snippet with the same name has
already been added the new style snippet will be ignored.
procedure add (
p_css in varchar2,
p_key in varchar2 default null );
Writes the data of the page item meta data into the HTTP buffer.
procedure debug_page_item (
p_plugin in wwv_flow_plugin.t_plugin,
p_page_item in wwv_flow_plugin.t_page_item );
procedure debug_page_item (
p_plugin in wwv_flow_plugin.t_plugin,
p_page_item in wwv_flow_plugin.t_page_item,
p_value in varchar2,
p_is_readonly in boolean,
p_is_printer_friendly in boolean );
Writes the data of the region meta data into the HTTP buffer.
procedure debug_region (
p_plugin in wwv_flow_plugin.t_plugin,
p_region in wwv_flow_plugin.t_region );
procedure debug_region (
p_plugin in wwv_flow_plugin.t_plugin,
p_region in wwv_flow_plugin.t_region,
p_is_printer_friendly in boolean );
Writes the data of the dynamic action meta data into the HTTP buffer.
procedure debug_dynamic_action (
p_plugin in wwv_flow_plugin.t_plugin,
p_dynamic_action in wwv_flow_plugin.t_dynamic_action );
Writes the data of the process meta data into the HTTP buffer.
procedure debug_process (
p_plugin in wwv_flow_plugin.t_plugin,
p_process in wwv_flow_plugin.t_process );
Demo
Recap
❖ Things I always have to look up in following domains:
❖ Database
❖ SQL
❖ PL/SQL
❖ APEX
Q&A
www.apexRnD.be
dgielis.blogspot.com
@dgielis
dgielis@apexRnD.be
❖ Looking for consulting, training and development in
Oracle Application Express (APEX)?
❖ Contact : www.apexRnD.be
❖ Mail : info@apexRnD.be
Consulting, Development, Training

More Related Content

What's hot (20)

PDF
Query Worker Contracts Details Oracle Fusion Cloud
Feras Ahmad
 
PPT
MYSQL - PHP Database Connectivity
V.V.Vanniaperumal College for Women
 
PDF
Uploading Data Using Oracle Web ADI
RapidValue
 
PDF
Oracle Apps Technical – Short notes on RICE Components.
Boopathy CS
 
PPTX
Procedure and Functions in pl/sql
Ñirmal Tatiwal
 
PPTX
Oracle Database View
Eryk Budi Pratama
 
DOC
Oracle report from ppt
kingshuk_goswami
 
PPTX
Aggregate function
Rayhan Chowdhury
 
PDF
Technical architecture for order management
Mohit kumar Gupta
 
PPTX
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Oracle Fusion Custom Role Guide
Mostafa Ahmed Ghaly
 
PPT
Build Your Own CMS with Apache Sling
Bob Paulin
 
PPT
PL/SQL Introduction and Concepts
Bharat Kalia
 
PDF
Take a load off! Load testing your Oracle APEX or JDeveloper web applications
Sage Computing Services
 
DOC
How to create payslip through self service
Feras Ahmad
 
ODP
Ms sql-server
Md.Mojibul Hoque
 
PPTX
What is SQL Server?
CPD INDIA
 
PPTX
Sql Objects And PL/SQL
Gary Myers
 
PPTX
Data structure and algorithm using java
Narayan Sau
 
PPT
MYSQL Aggregate Functions
Leroy Blair
 
Query Worker Contracts Details Oracle Fusion Cloud
Feras Ahmad
 
MYSQL - PHP Database Connectivity
V.V.Vanniaperumal College for Women
 
Uploading Data Using Oracle Web ADI
RapidValue
 
Oracle Apps Technical – Short notes on RICE Components.
Boopathy CS
 
Procedure and Functions in pl/sql
Ñirmal Tatiwal
 
Oracle Database View
Eryk Budi Pratama
 
Oracle report from ppt
kingshuk_goswami
 
Aggregate function
Rayhan Chowdhury
 
Technical architecture for order management
Mohit kumar Gupta
 
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Oracle Fusion Custom Role Guide
Mostafa Ahmed Ghaly
 
Build Your Own CMS with Apache Sling
Bob Paulin
 
PL/SQL Introduction and Concepts
Bharat Kalia
 
Take a load off! Load testing your Oracle APEX or JDeveloper web applications
Sage Computing Services
 
How to create payslip through self service
Feras Ahmad
 
Ms sql-server
Md.Mojibul Hoque
 
What is SQL Server?
CPD INDIA
 
Sql Objects And PL/SQL
Gary Myers
 
Data structure and algorithm using java
Narayan Sau
 
MYSQL Aggregate Functions
Leroy Blair
 

Similar to Oracle APEX Cheat Sheet (20)

PPTX
Advanced functions in PL SQL
Hosein Zare
 
DOCX
It6312 dbms lab-ex2
MNM Jain Engineering College
 
PPTX
Functions
Ankit Dubey
 
PPT
Olap Functions Suport in Informix
Bingjie Miao
 
PPTX
How to tune a query - ODTUG 2012
Connor McDonald
 
PPTX
The Five Best Things To Happen To SQL
Connor McDonald
 
DOC
ORACLE NOTES
Sachin Shukla
 
PPT
Advanced Sql Training
bixxman
 
PPT
Enabling Applications with Informix' new OLAP functionality
Ajay Gupte
 
PDF
Structured Query Language (SQL) - An Introduction
Rajeev Srivastava
 
PPT
Index
Sudharsan S
 
PDF
Oracle12c For Developers
Alex Nuijten
 
PDF
Oracle12 for Developers - Oracle OpenWorld Preview AMIS
Getting value from IoT, Integration and Data Analytics
 
PDF
OOW19 - Ten Amazing SQL features
Connor McDonald
 
DOC
Most useful queries
Sam Depp
 
PPTX
Sangam 18 - Great Applications with Great SQL
Connor McDonald
 
PDF
dbms.pdf
walter brand
 
PPTX
SQL techniques for faster applications
Connor McDonald
 
PPTX
SQL techniques for faster applications
Connor McDonald
 
PDF
UKOUG 2019 - SQL features
Connor McDonald
 
Advanced functions in PL SQL
Hosein Zare
 
It6312 dbms lab-ex2
MNM Jain Engineering College
 
Functions
Ankit Dubey
 
Olap Functions Suport in Informix
Bingjie Miao
 
How to tune a query - ODTUG 2012
Connor McDonald
 
The Five Best Things To Happen To SQL
Connor McDonald
 
ORACLE NOTES
Sachin Shukla
 
Advanced Sql Training
bixxman
 
Enabling Applications with Informix' new OLAP functionality
Ajay Gupte
 
Structured Query Language (SQL) - An Introduction
Rajeev Srivastava
 
Oracle12c For Developers
Alex Nuijten
 
Oracle12 for Developers - Oracle OpenWorld Preview AMIS
Getting value from IoT, Integration and Data Analytics
 
OOW19 - Ten Amazing SQL features
Connor McDonald
 
Most useful queries
Sam Depp
 
Sangam 18 - Great Applications with Great SQL
Connor McDonald
 
dbms.pdf
walter brand
 
SQL techniques for faster applications
Connor McDonald
 
SQL techniques for faster applications
Connor McDonald
 
UKOUG 2019 - SQL features
Connor McDonald
 
Ad

More from Dimitri Gielis (19)

PDF
Bring the light in your Always FREE Oracle Cloud
Dimitri Gielis
 
PPTX
APEX Office Print (AOP)
Dimitri Gielis
 
PDF
REST Web Service? No, GraphQL please!
Dimitri Gielis
 
PDF
Can You Do That with APEX? Building Not So Straightforward Pages
Dimitri Gielis
 
PDF
Bringing Virtual Reality (VR) and Augmented Reality (AR) to APEX
Dimitri Gielis
 
PDF
Reporting with Oracle Application Express (APEX)
Dimitri Gielis
 
PDF
Moving your APEX app to the Oracle Exadata Express Cloud
Dimitri Gielis
 
PDF
Oracle APEX for Beginners
Dimitri Gielis
 
PDF
JavaScript straight from the Oracle Database
Dimitri Gielis
 
PDF
Service Workers and APEX
Dimitri Gielis
 
PDF
APEX Office Print
Dimitri Gielis
 
PDF
Real Application Security (RAS) and Oracle Application Express (APEX)
Dimitri Gielis
 
PDF
Moving to the APEX Listener
Dimitri Gielis
 
PDF
APEX Wearables
Dimitri Gielis
 
PDF
APEX Security 101
Dimitri Gielis
 
PDF
APEX 5 Demo and Best Practices
Dimitri Gielis
 
PDF
A Primer on Web Components in APEX
Dimitri Gielis
 
PDF
How to make APEX print through Node.js
Dimitri Gielis
 
PDF
Oracle Application Express (APEX) and Microsoft Sharepoint integration
Dimitri Gielis
 
Bring the light in your Always FREE Oracle Cloud
Dimitri Gielis
 
APEX Office Print (AOP)
Dimitri Gielis
 
REST Web Service? No, GraphQL please!
Dimitri Gielis
 
Can You Do That with APEX? Building Not So Straightforward Pages
Dimitri Gielis
 
Bringing Virtual Reality (VR) and Augmented Reality (AR) to APEX
Dimitri Gielis
 
Reporting with Oracle Application Express (APEX)
Dimitri Gielis
 
Moving your APEX app to the Oracle Exadata Express Cloud
Dimitri Gielis
 
Oracle APEX for Beginners
Dimitri Gielis
 
JavaScript straight from the Oracle Database
Dimitri Gielis
 
Service Workers and APEX
Dimitri Gielis
 
APEX Office Print
Dimitri Gielis
 
Real Application Security (RAS) and Oracle Application Express (APEX)
Dimitri Gielis
 
Moving to the APEX Listener
Dimitri Gielis
 
APEX Wearables
Dimitri Gielis
 
APEX Security 101
Dimitri Gielis
 
APEX 5 Demo and Best Practices
Dimitri Gielis
 
A Primer on Web Components in APEX
Dimitri Gielis
 
How to make APEX print through Node.js
Dimitri Gielis
 
Oracle Application Express (APEX) and Microsoft Sharepoint integration
Dimitri Gielis
 
Ad

Recently uploaded (20)

PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 

Oracle APEX Cheat Sheet

  • 1. Dimitri Gielis Oracle APEX Cheat Sheet www.apexRnD.be dgielis.blogspot.com @dgielis [email protected]
  • 2. Dimitri Gielis ❖ Founder & CEO of APEX R&D ❖ 20+ years of Oracle Experience 
 (OCP & APEX Certified) ❖ Oracle ACE Director ❖ “APEX Developer of the year 2009” by Oracle Magazine ❖ “Oracle Developer Choice award (ORDS)” in 2015 ❖ Author Expert Oracle APEX ❖ Presenter at Conferences
  • 5. Agenda ❖ Things I always have to look up in following domains: ❖ Database ❖ SQL ❖ PL/SQL ❖ APEX
  • 10. SQL
  • 11. Get (comma) delimited string https://docs.oracle.com/cloud/latest/db112/SQLRF/functions089.htm#SQLRF30030
  • 16. Oracle SQL Function Cheat Sheet http://www.databasestar.com/oracle-sql-functions Aggregate Functions AVG ( [DISTINCT|ALL] expression ) [OVER ( analytic_clause )] COUNT ( [ * | [ DISTINCT | ALL ] expression) [OVER (analytic_clause)] MAX ( [DISTINCT|ALL] expression ) [OVER (analytic_clause)] MIN ( [DISTINCT|ALL] expression ) [OVER ( analytic_clause )] SUM ( [DISTINCT|ALL] expression ) [OVER (analytic_clause)] Conversion Functions BIN_TO_NUM ( expression_list ) CAST ( expression AS type_name ) CAST ( MULTISET (subquery) AS type_name ) COALESCE ( expr1, expr2, [expr…] ) CHARTOROWID ( input_char ) FROM_TZ ( timestamp_value, timezone_value ) HEXTORAW ( charvalue ) NUMTODSINTERVAL ( number, interval_unit ) NUMTOYMINTERVAL ( number, interval_unit ) RAWTOHEX ( charvalue ) RAWTONHEX ( raw ) ROWIDTOCHAR ( rowid ) ROWIDTONCHAR ( rowid ) SCN_TO_TIMESTAMP ( number ) TIMESTAMP_TO_SCN ( timestamp ) TO_BINARY_DOUBLE ( expression [, format [, nlsparam ] ] ) TO_CHAR( input_value, [format_mask], [nls_parameter] ) TO_CLOB ( input_string ) TO_DATE( charvalue, [format_mask], [nls_date_language] ) TO_DSINTERVAL ( input_string [, nlsparam] ) TO_LOB ( long_value ) TO_MULTI_BYTE ( string ) TO_NCHAR ( input_string ) TO_NCHAR ( input_datetime [, format [,nlsparam ] ] ) TO_NCHAR ( number [, format [, nlsparam ] ] ) TO_NCLOB ( lob_value ) TO_NUMBER ( input_value, [format_mask], [nls_parameter] ) TO_SINGLE_BYTE ( input_string ) TO_TIMESTAMP ( input_string, [format_mask], [‘nlsparam’] ) TO_TIMESTAMP_TZ ( input_string [, format_mask] [, nls_param] ) TO_YMINTERVAL ( input_string ) UNISTR ( string ) Date and Time Functions ADD_MONTHS ( input_date, number_months ) CURRENT_DATE CURRENT_TIMESTAMP ( [precision] ) DBTIMEZONE LAST_DAY ( input_date ) LOCALTIMESTAMP ( timestamp_precision ) MONTHS_BETWEEN ( date1, date2 ) NEW_TIME ( input_date, timezone1, timezone2 ) NEXT_DAY ( input_date, weekday ) SESSIONTIMEZONE SYS_EXTRACT_UTC ( datetime_with_timezone_value ) SYSDATE SYSTIMESTAMP TZ_OFFSET ( timezone_name | time_value | SESSIONTIMEZONE | DBTIMEZONE ) Environment Functions CON_DBID_TO_ID ( container_dbid ) CON_GUID_TO_ID ( container_guid ) CON_NAME_TO_ID ( container_name ) CON_UID_TO_ID ( container_uid ) ORA_INVOKING_USER ORA_INVOKING_USERID ( ) SYS_CONTEXT (namespace, parameter [, length] ) SYS_GUID() SYS_TYPEID ( object_type_value ) UID USER USERENV ( parameter ) SQLCODE SQLERRM ( error_number ) NLS Functions NLS_CHARSET_DECL_LEN ( byte_count, char_set_id ) NLS_CHARSET_ID ( string_value ) NLS_CHARSET_NAME ( number ) Numeric and Maths Functions ABS ( number ) ACOS ( number ) ASIN ( number ) ATAN2 ( number1 [/|,] number2 ) BITAND ( expr1, expr2 ) CEIL ( input_val ) CORR ( expression1, expression2 ) COS ( number ) COSH (number) COVAR_POP ( expression1, expression2 ) [OVER (analytic_clause)] COVAR_SAMP ( expression1, expression2 ) [OVER (analytic_clause)] CUME_DIST (expression1, … expression_n) WITHIN GROUP (ORDER BY expression_order1, … expression_order_n) CUME_DIST() OVER ( [query_partition_clause] ORDER BY order_clause ) DENSE_RANK ( expr, [expr(n)] ) WITHIN GROUP ( ORDER BY (order_expr [ASC|DESC] [NULLS FIRST|LAST] ) DENSE_RANK() OVER ( [query_partition_clause] order_by_clause) EXP ( number ) EXTRACT ( date_component FROM expression ) FLOOR ( input_number ) GREATEST ( expr1, [expr_n] ) LEAST ( expr1, [expr_n] ) LN ( number ) LOG ( [base, ] expression ) MEDIAN ( expr ) [OVER (query_partition_clause)] MOD ( numerator, denominator ) ORA_HASH ( expression [, max_bucket [, seed_value ] ] ) PERCENT_RANK ( expression ) WITHIN GROUP ( ORDER BY (expression_n [. DESC | ASC ] [NULLS FIRST|LAST] ) PERCENT_RANK () OVER ( [query_partition_clause] order_by_clause ) PERCENTILE_CONT ( expression) WITHIN GROUP ( ORDER BY expression [ ASC | DESC ] [OVER ( query_partition_clause ) PERCENTILE_DISC ( expression) WITHIN GROUP ( ORDER BY expression [ ASC | DESC ] [OVER ( query_partition_clause ) POWER ( n2, n1 ) RANK ( expr ) WITHIN GROUP ( ORDER BY ( order_expr [NULLS FIRST/LAST] ) ) RANK () OVER ( [query_partition_clause] order_by_clause ) REMAINDER ( n2, n1 ) ROUND ( input, roundto ) ROWNUM ROW_NUMBER () OVER ( [ query_partition_clause] order_by_clause ) SIGN ( number ) SIN ( number ) SINH ( number ) SQRT ( number ) STANDARD_HASH ( expression [, method ] ) STDDEV ( [DISTINCT | ALL] expression ) [OVER (analytical_clause) ] STDDEV_POP ( expression) [ OVER ( analytic_clause ) ] STDDEV_SAMP ( expression) [ OVER ( analytic_clause ) ] TAN ( number ) TANH ( number ) TRUNC ( date, fmt ) TRUNC ( number, decimals ) VAR_POP ( expression) [OVER ( analytic_clause )] VAR_SAMP ( expression) [OVER ( analytic_clause )] VARIANCE ( [ DISTINCT | ALL ] expression) [ OVER ( analytic_clause ) ] WIDTH_BUCKET ( expression, min_value, max_value, num_buckets ) String and Character Functions ASCII ( charvalue ) ASCIISTR ( charvalue ) CHR ( number_code [USING NCHAR_CS] ) COMPOSE ( input_value ) CONCAT( string1, string2 ) CONVERT ( input_char, dest_char_set, [source_char_set] ) DECODE ( expression, search, result [, search, result]… [,default] ) DECOMPOSE ( input_string [CANONICAL|COMPATIBILITY] ) DUMP ( expression [, return_format] [, start_position] [, length] ) INITCAP ( input_string ) INSTR ( string, substring, [start_position], [occurrence] ) INSTR2 ( string, substring, [start_position], [occurrence] ) INSTR4 ( string, substring, [start_position], [occurrence] ) INSTRB ( string, substring, [start_position], [occurrence] ) INSTRC ( string, substring, [start_position], [occurrence] ) LISTAGG ( measure_expr [, delimiter]) WITHIN GROUP (order_by_clause) [OVER query_partition_clause] LENGTH ( string_value ) LENGTH2 ( string_value ) LENGTH4 ( string_value ) LENGTHB ( string_value ) LENGTHC ( string_value ) LOWER ( input_string ) LPAD( expr, length [, pad_expr] ) LTRIM( input_string, [trim_string] ) LNNVL ( condition ) NCHR ( number_code ) NLS_INITCAP ( input_char [, nlsparam ] ) NLS_LOWER ( input_char [, nlsparam ] ) NLS_UPPER ( input_char [, nlsparam ] ) NLSSORT ( input_char [, nlsparam ] ) NANVL ( check_value, replace_value ) NVL ( check_value, replace_value ) NVL2 ( value_to_check, value_if_not_null, value_if_null ) NULLIF ( expr1, expr2 ) REGEXP_COUNT ( source_char, pattern [, position [, match_pattern [, subexpression ] ] ] ) REGEXP_INSTR ( source_char, pattern [, position [, occurrence [, return_option [, match_pattern [, subexpression ] ] ] ] ] ) REGEXP_REPLACE ( source_char, pattern [, replace_string [, position [, occurrence [, match_parameter ] ] ] ] ) REGEXP_SUBSTR ( source_char, pattern [, position [, occurrence [, match_parameter ] ] ] ] ) REPLACE ( whole_string, string_to_replace, [replacement_string]) RPAD ( expr, length [, pad_expr] ) RTRIM ( input_string, [trim_character]) SOUNDEX ( string ) SUBSTR ( string, start_position, [length] ) TRANSLATE ( source, from_string, to_string ) TRANSLATE ( charvalue USING {CHAR_CS|NCHAR_CS} ) TREAT ( expression AS [ REF ] [ schema. ] type ) TRIM ( [ [ LEADING | TRAILING | BOTH ] trim_character FROM ] trim_source ) UPPER ( input_string ) VSIZE ( expression ) Analytic Functions FIRST_VALUE ( expression [ IGNORE NULLS ] ) OVER ( analytic_clause ) LAST_VALUE ( expression [ IGNORE NULLS ] ) OVER ( analytic_clause ) LAG ( expression [, offset [, default] ] ) OVER ( [ query_partition_clause ] order_by_clause ) LEAD ( expression [, offset [, default] ] ) OVER ( [ query_partition_clause ] order_by_clause ) NTILE ( expression ) OVER ( [query_partition_clause] order_by_clause ) RATIO_TO_REPORT( expression ) OVER ( [query_partition_clause] ) Other Functions CASE [expression] WHEN condition_1 THEN result_1 WHEN condition_n THEN result_n ELSE result END case_name SYS_CONNECT_BY_PATH ( column, character_separator ) Grouping Functions GROUP_ID ( ) GROUPING ( expression ) GROUPING_ID ( expression1 [, expression_n ] ) Large Object Functions BFILENAME ( directory, filename ) EMPTY_BLOB () EMPTY_CLOB ()
  • 17. Oracle SQL Function Cheat Sheet http://www.databasestar.com/oracle-sql-functions Aggregate Functions AVG ( [DISTINCT|ALL] expression ) [OVER ( analytic_clause )] COUNT ( [ * | [ DISTINCT | ALL ] expression) [OVER (analytic_clause)] MAX ( [DISTINCT|ALL] expression ) [OVER (analytic_clause)] MIN ( [DISTINCT|ALL] expression ) [OVER ( analytic_clause )] SUM ( [DISTINCT|ALL] expression ) [OVER (analytic_clause)] Conversion Functions BIN_TO_NUM ( expression_list ) CAST ( expression AS type_name ) CAST ( MULTISET (subquery) AS type_name ) COALESCE ( expr1, expr2, [expr…] ) CHARTOROWID ( input_char ) FROM_TZ ( timestamp_value, timezone_value ) HEXTORAW ( charvalue ) NUMTODSINTERVAL ( number, interval_unit ) NUMTOYMINTERVAL ( number, interval_unit ) RAWTOHEX ( charvalue ) RAWTONHEX ( raw ) ROWIDTOCHAR ( rowid ) ROWIDTONCHAR ( rowid ) SCN_TO_TIMESTAMP ( number ) TIMESTAMP_TO_SCN ( timestamp ) TO_BINARY_DOUBLE ( expression [, format [, nlsparam ] ] ) TO_CHAR( input_value, [format_mask], [nls_parameter] ) TO_CLOB ( input_string ) TO_DATE( charvalue, [format_mask], [nls_date_language] ) TO_DSINTERVAL ( input_string [, nlsparam] ) TO_LOB ( long_value ) TO_MULTI_BYTE ( string ) TO_NCHAR ( input_string ) TO_NCHAR ( input_datetime [, format [,nlsparam ] ] ) TO_NCHAR ( number [, format [, nlsparam ] ] ) TO_NCLOB ( lob_value ) TO_NUMBER ( input_value, [format_mask], [nls_parameter] ) Numeric and Maths Functions ABS ( number ) ACOS ( number ) ASIN ( number ) ATAN2 ( number1 [/|,] number2 ) BITAND ( expr1, expr2 ) CEIL ( input_val ) CORR ( expression1, expression2 ) COS ( number ) COSH (number) COVAR_POP ( expression1, expression2 ) [OVER (analytic_clause)] COVAR_SAMP ( expression1, expression2 ) [OVER (analytic_clause)] CUME_DIST (expression1, … expression_n) WITHIN GROUP (ORDER BY expression_order1, … expression_order_n) CUME_DIST() OVER ( [query_partition_clause] ORDER BY order_clause ) DENSE_RANK ( expr, [expr(n)] ) WITHIN GROUP ( ORDER BY (order_expr [ASC|DESC] [NULLS FIRST|LAST] ) DENSE_RANK() OVER ( [query_partition_clause] order_by_clause) EXP ( number ) EXTRACT ( date_component FROM expression ) FLOOR ( input_number ) GREATEST ( expr1, [expr_n] ) LEAST ( expr1, [expr_n] ) LN ( number ) LOG ( [base, ] expression ) MEDIAN ( expr ) [OVER (query_partition_clause)] MOD ( numerator, denominator ) ORA_HASH ( expression [, max_bucket [, seed_value ] ] ) PERCENT_RANK ( expression ) WITHIN GROUP ( ORDER BY (expression_n [. DESC | ASC ] [NULLS FIRST|LAST] ) PERCENT_RANK () OVER ( [query_partition_clause] order_by_clause ) PERCENTILE_CONT ( expression) WITHIN GROUP ( ORDER BY expression [ ASC | DESC ] [OVER ( query_partition_clause ) PERCENTILE_DISC ( expression) WITHIN GROUP ( INITCAP ( input_string ) INSTR ( string, substring, [start_position], [occurrence] ) INSTR2 ( string, substring, [start_position], [occurrence] ) INSTR4 ( string, substring, [start_position], [occurrence] ) INSTRB ( string, substring, [start_position], [occurrence] ) INSTRC ( string, substring, [start_position], [occurrence] ) LISTAGG ( measure_expr [, delimiter]) WITHIN GROUP (order_by_clause) [OVER query_partition_clause] LENGTH ( string_value ) LENGTH2 ( string_value ) LENGTH4 ( string_value ) LENGTHB ( string_value ) LENGTHC ( string_value ) LOWER ( input_string ) LPAD( expr, length [, pad_expr] ) LTRIM( input_string, [trim_string] ) LNNVL ( condition ) NCHR ( number_code ) NLS_INITCAP ( input_char [, nlsparam ] ) NLS_LOWER ( input_char [, nlsparam ] ) NLS_UPPER ( input_char [, nlsparam ] ) NLSSORT ( input_char [, nlsparam ] ) NANVL ( check_value, replace_value ) NVL ( check_value, replace_value ) NVL2 ( value_to_check, value_if_not_null, value_if_null ) NULLIF ( expr1, expr2 ) REGEXP_COUNT ( source_char, pattern [, position [, match_pattern [, subexpression ] ] ] ) REGEXP_INSTR ( source_char, pattern [, position [, occurrence [, return_option [, match_pattern [, subexpression ] ] ] ] ] ) REGEXP_REPLACE ( source_char, pattern [, replace_string [, position [, occurrence [, match_parameter ] ] ] ] ) REGEXP_SUBSTR ( source_char, pattern [, position [, occurrence [, match_parameter ] ] ] ] ) REPLACE ( whole_string, string_to_replace, [replacement_string])
  • 20. Regular Expressions select regexp_replace(column_name, '[^[:digit:]]', '') from mytable; Get number out of string - replace non numeric by nothing
  • 21. Lookahead assertion + Negative lookahead + Lookbehind assertion + Negative lookbehind + Once-only Subexpression Condition [if then] Condition [if then else] Comment Assertions ?= ?! ?<= ?!= or ?<! ?> ?() ?()| ?# Letters, numbers and hyphens Date (e.g. 21/3/2006) jpg, gif or png image Any number from 1 to 50 inclusive Valid hexadecimal colour code 8 to 15 character string with at least one upper case letter, one lower case letter, and one digit (useful for passwords). Email addresses HTML Tags 0 or more + 0 or more, ungreedy + 1 or more + 1 or more, ungreedy + 0 or 1 + 0 or 1, ungreedy + Exactly 3 + 3 or more + 3, 4 or 5 + 3, 4 or 5, ungreedy + Quantifiers * *? + +? ? ?? {3} {3,} {3,5} {3,5}? Any character except new line (n) + a or b + Group + Passive Group + Range (a or b or c) + Not a or b or c + Letter between a and q + Upper case letter + between A and Q + Digit between 0 and 7 + nth group/subpattern + Ranges . (a|b) (...) (?:...) [abc] [^abc] [a-q] [A-Q] [0-7] n Global match Case-insensitive Multiple lines Treat string as single line Allow comments and white space in pattern Evaluate replacement Ungreedy pattern Pattern Modifiers g i m s x e U nth non-passive group "xyz" in /^(abc(xyz))$/ "xyz" in /^(?:abc)(xyz)$/ Before matched string After matched string Last matched string Entire matched string Entire input string Literal "$" String Replacement (Backreferences) $n $2 $1 $` $' $+ $& $_ $$ Escape Character + New line + Carriage return + Tab + Vertical tab + Form feed + Alarm Backspace Escape Named Character Special Characters n r t v f a [b] e N{name} Metacharacters (must be escaped) [ { | > ^ $ ( ) < . * + ? Items marked + should work in most regular expression implementations.Note Ranges are inclusive.Note These patterns are intended for reference purposes and have not been extensively tested. Please use with caution and test thoroughly before use.Note Control character White space Not white space Digit Not digit Word Not word Hexadecimal character hh Octal character xxx Character Classes c s S d D w W xhh Oxxx Upper case letters Lower case letters All letters Digits and letters Digits Hexadecimal digits Punctuation Space and tab Blank characters Control characters Printed characters Printed characters and spaces Digits, letters and underscore POSIX Character Classes [:upper:] [:lower:] [:alpha:] [:alnum:] [:digit:] [:xdigit:] [:punct:] [:blank:] [:space:] [:cntrl:] [:graph:] [:print:] [:word:] Start of line + Start of string + End of line + End of string + Word boundary + Not word boundary + Start of word End of word Anchors ^ A $ Z b B < > Sample Patterns ([A-Za-z0-9-]+) (d{1,2}/d{1,2}/d{4}) ([^s]+(?=.(jpg|gif|png)).2) (^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^50$) (#?([A-Fa-f0-9]){3}(([A-Fa-f0-9]){3})?) ((?=.*d)(?=.*[a-z])(?=.*[A-Z]).{8,15}) (w+@[a-zA-Z_]+?.[a-zA-Z]{2,6}) (<(/?[^>]+)>) Available free from AddedBytes.com http://www.cbs.dtu.dk/courses/27610/regular-expressions-cheat-sheet-v2.pdf
  • 22. Want to learn more about Regular Expressions?
  • 23. Demo
  • 26. Documentation generation ❖ Use snippets ❖ Use extension e.g. PL/SQL in Visual Studio Code
  • 28. Demo
  • 29. APEX
  • 30. APEX Dictionary ❖ SELECT * FROM APEX_DICTIONARY
  • 31. Substitution Strings ❖ Bind variable: :ITEM ❖ Substitution String: &ITEM. ❖ PL/SQL: v(‘ITEM’) ❖ Template: #ITEM#
  • 32. Substitution Strings ❖ HTML escapes reserved HTML characters ❖ &ITEM!HTML. ❖ #REPORT_COLUMN!HTML# ❖ ATTR escapes reserved characters in a HTML attribute ❖ #REPORT_COLUMN!ATTR# ❖ removes HTML tags from the output and escapes reserved HTML characters ❖ &ITEM!STRIPHTML. ❖ #REPORT_COLUMN!STRIPHTML# APEX_ESCAPE.HTML APEX_ESCAPE.HTML_ATTRIBUTE wwv_flow_utilities.striphtml
  • 33. Substitution Strings ❖ JS escapes reserved characters in a JavaScript ❖ &ITEM!JS. ❖ #REPORT_COLUMN!JS# APEX_ESCAPE.JS_LITERAL
  • 34. Built-in Substitution Strings ❖ APEX$ROW_NUM ❖ APEX$ROW_SELECTOR ❖ APEX$ROW_STATUS ❖ APP_ID ❖ APP_ALIAS ❖ APP_AJAX_X01, ... APP_AJAX_X10 ❖ APP_DATE_TIME_FORMAT ❖ APP_IMAGES ❖ APP_NLS_DATE_FORMAT ❖ APP_NLS_TIMESTAMP_FORMAT ❖ APP_NLS_TIMESTAMP_TZ_FORMAT ❖ APP_PAGE_ALIAS ❖ APP_PAGE_ID ❖ APP_REQUEST_DATA_HASH ❖ APP_SESSION ❖ APP_SESSION_VISIBLE ❖ APP_TITLE ❖ APP_UNIQUE_PAGE_ID ❖ APP_USER ❖ AUTHENTICATED_URL_PREFIX ❖ BROWSER_LANGUAGE ❖ CURRENT_PARENT_TAB_TEXT ❖ DEBUG ❖ HOME_LINK ❖ IMAGE_PREFIX ❖ JET_BASE_DIRECTORY ❖ JET_CSS_DIRECTORY ❖ JET_JS_DIRECTORY ❖ LOGIN_URL ❖ LOGOUT_URL ❖ PRINTER_FRIENDLY ❖ PROXY_SERVER ❖ PUBLIC_URL_PREFIX ❖ REQUEST ❖ Using REQUEST ❖ SCHEMA OWNER ❖ SQLERRM ❖ SYSDATE_YYYYMMDD ❖ THEME_DB_IMAGES ❖ THEME_IMAGES ❖ WORKSPACE_IMAGES ❖ WORKSPACE_ID
  • 37. APEX URL f?p=APP:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly - Application Id: 1
 - Application Id: &APP_ID. - Application Alias: MY_APP
 - Application Alias: &APP_ALIAS. - Application in a specific Workspace: &c=WORKSPACE
  • 38. APEX URL f?p=App:PAGE:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly - Page Id: 1
 - Page Id: &APP_PAGE_ID. - Unique Page View Id: &APP_UNIQUE_PAGE_ID.
 (use in request or debug - you can not use it to navigate as it’s unique for the view) - Page Alias: MY_PAGE
 - Page Alias: &APP_PAGE_ALIAS.
  • 39. APEX URL f?p=App:Page:SESSION:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly - Session Id: &SESSION.
 - Session Id: &APP_SESSION_ID. - Session 0: 0
 - Session 0: &APP_SESSION_VISIBLE.
  • 40. APEX URL f?p=App:Page:Session:REQUEST:Debug:ClearCache:itemNames:itemValues:PrinterFriendly - Application Button - Request: APPLICATION_PROCESS=XYZ - Interactive Report: IR[static id]_SAVED_REPORT - Clone an APEX session: APEX_CLONE_SESSION
  • 42. APEX URL f?p=App:Page:Session:Request:Debug:CLEARCACHE:itemNames:itemValues:PrinterFriendly - Page Number(s): comma separated - Collection Names - RP: Reset Region Pagination - APP: All Pages, All Application Items, Remove User Sort - SESSION: All used apps in that session
  • 43. APEX URL f?p=App:Page:Session:Request:Debug:Clearcache:ITEMNAMES:ITEMVALUES:PrinterFriendly - Items comma separated - Values comma separated; not allowed to have “:”
 when using comma use backslash /12,34/ - IR columns: IREQ_CUST_FIRST_NAME
  • 47. Generate an APEX URL ❖ apex_util.prepare_url(
 ‘f?p=&APP_ID.:HOME:&APP_SESSION.::::P1_X:’ || :P1_X
 );
  • 48. Generate an APEX URL ❖ apex_page.get_url(
 p_page => 1,
 p_items => 'P1_X,P1_Y',
 p_values => 'somevalue,othervalue' 
 );
  • 49. PL/SQL APIs for URLs ❖ APEX_UTIL.URL_ENCODE ❖ APEX_UTIL.HOST_URL ❖ APEX_UTIL.REDIRECT_URL ❖ APEX_MAIL.GET_INSTANCE_URL ❖ APEX_MAIL.GET_IMAGES_URL ❖ API to generate URLs for use in APEX: 
 https://livesql.oracle.com/apex/livesql/file/content_CPSSPPZRWVADCX4KAMR6ZZB62.html
  • 50. JavaScript and URLs ❖ apex.navigation.dialog ❖ apex.navigation.openInNewWindow ❖ apex.navigation.popup ❖ apex.navigation.redirect ❖ show inline dialog -> openModal(‘dialog_auto') https://docs.oracle.com/database/apex-5.1/AEAPI/apex-navigation-namespace.htm#AEAPI29504
  • 51. JavaScript and URLs ❖ apex.server.url ({
 p_request: "DELETE",
 x01: "test",
 pageItems: "#P1_DEPTNO,#P1_EMPNO" });
 ❖ apex.server.process ( "MY_PROCESS", {
 x01: "test",
 pageItems: "#P1_DEPTNO,#P1_EMPNO"
 },{
 success: function( pData )
 // do something here
 }
 } ); => APEX_APPLICATION.G_X01
  • 52. Referencing Custom Items ❖ If you need to create your own items, you can access them after a page is submitted by referencing APEX_APPLICATION.G_FXX (01-50)
  • 60. Oracle APEX 5 Keyboard Shortcuts Keyboard Shortcuts by Scott (sspendol) via cheatography.com/24422/cs/6036/ Actions Func​tion Mac PC Save Ctrl+O​ption+S Ctrl+Alt+S Save and Run Page Ctrl+O​ption+R Ctrl+Alt+R Undo Ctrl+Z Ctrl+Z Redo Ctrl+Y Ctrl+Y Region Actions Display From Here Ctrl+O​ption+D Ctrl+Alt+D Display From Page Ctrl+O​ption+T Ctrl+Alt+T Restor​e/E​xpand Option+F11 Alt+F11 Toggle Empty Region Positions Ctrl+O​ption+E Ctrl+Alt+E Miscel​laneous Help Option+F1 Alt+F1 Messages Ctrl+F1 Ctrl+F1 Page Search Ctrl+O​ption+F Ctrl+Alt+F Keyboard Shortcuts Option​+Sh​ift+F Alt+Sh​ift+F1 Regions Func​tion Mac PC Rendering Option+1 Alt+1 Dynamic Actions Option+2 Alt+2 Processing Option+3 Alt+3 Page Shared Components Option+4 Alt+4 Grid Layout Option+5 Alt+5 Property Editor Option+6 Alt+6 Gallery Regions Option+7 Alt+7 Gallery Items Option+8 Alt+8 Gallery Buttons Option+9 Alt+9 By Scott (sspendol) cheatography.com/sspendol/ spendolini.blogspot.com Published 10th November, 2015. Last updated 10th November, 2015. Page 1 of 1. Sponsored by Readability-Score.com Measure your website readability! https://readability-score.com
  • 62. type t_page_item is record ( id number, name varchar2(255), label varchar2(4000), plain_label varchar2(4000), format_mask varchar2(255), is_required boolean, lov_definition varchar2(4000), lov_display_extra boolean, lov_display_null boolean, lov_null_text varchar2(255), lov_null_value varchar2(255), lov_cascade_parent_items varchar2(255), ajax_items_to_submit varchar2(255), ajax_optimize_refresh boolean, element_width number, element_max_length number, element_height number, element_attributes varchar2(2000), element_option_attributes varchar2(4000), escape_output boolean, attribute_01 varchar2(32767), … ); type t_page_item_render_result is record ( is_navigable boolean default false, navigable_dom_id varchar2(255) ); type t_page_item_validation_result is record ( message varchar2(32767), display_location varchar2(40), /* if not set the app default is used */ page_item_name varchar2(255) ); /* if not set the validated page item name is used */ Render function function <name of function> ( p_item in apex_plugin.t_page_item, p_plugin in apex_plugin.t_plugin, p_value in varchar2, p_is_readonly in boolean, p_is_printer_friendly in boolean ) return apex_plugin.t_page_item_render_result; apex_plugin: item type t_region is record ( id number, static_id varchar2(255), name varchar2(255), type varchar2(255), source varchar2(32767), error_message varchar2(32767), attribute_01 varchar2(32767), … ); Render function function <name of function> ( p_region in apex_plugin.t_region, p_plugin in apex_plugin.t_plugin, p_is_printer_friendly in boolean ) return apex_plugin.t_region_render_result; apex_plugin: region type t_dynamic_action is record ( id number, action varchar2(50), attribute_01 varchar2(32767), … ); type t_dynamic_action_render_result is record ( javascript_function varchar2(32767), ajax_identifier varchar2(255), attribute_01 varchar2(32767), … ); Render function function <name of function> ( p_dynamic_action in apex_plugin.t_dynamic_action, p_plugin in apex_plugin.t_plugin ) return apex_plugin.t_dynamic_action_render_result; apex_plugin: DA type t_process is record ( id number, name varchar2(255), success_message varchar2(32767), attribute_01 varchar2(32767), … ); type t_process_exec_result is record ( success_message varchar2(32767) ); Execute function function <name of function> ( p_process in apex_plugin.t_process, p_plugin in apex_plugin.t_plugin ) return apex_plugin.t_process_exec_result; apex_plugin: process Returns the name attribute which has to be used for a HTML input element if you want that the value of the element is stored in session state when the page is submitted. If you have a HTML input element which returns multiple values (eg. select list with multiple="multiple") you have to set p_is_multi_value. Note: This function has to be called before you write something to the HTTP buffer with HTP.P(RN) function get_input_name_for_page_item ( p_is_multi_value in boolean ) return varchar2; function escape ( p_value in varchar2, p_escape in boolean ) return varchar2; Note: if both values are null, TRUE will be returned as well. function is_equal ( p_value1 in varchar2, p_value2 in varchar2 ) return boolean; Returns the position in the list where p_value is stored. If it's not found null will be returned. function get_position_in_list ( p_list in wwv_flow_global.vc_arr2, p_value in varchar2 ) return number; Outputs the value in an escaped form. It's also taking care of chunking big strings into smaller outputs. procedure print_escaped_value ( p_value in varchar2 ); Outputs a hidden field to store the page item value if the page item is rendered readonly but not printer friendly procedure print_hidden_if_readonly ( p_item_name in varchar2, p_value in varchar2, p_is_readonly in boolean, p_is_printer_friendly in boolean, p_id_postfix in varchar2 default null ); Outputs a hidden protected field to store the page item value. procedure print_hidden_protected ( p_item_name in varchar2, p_value in varchar2, p_id_postfix in varchar2 default null ); Outputs a SPAN tag for a display only field. procedure print_display_only ( p_item_name in varchar2, p_display_value in varchar2, p_show_line_breaks in boolean, p_escape in boolean, p_attributes in varchar2, p_id_postfix in varchar2 default '_DISPLAY' ); Outputs an OPTION tag. The values are always escaped. procedure print_option ( p_display_value in varchar2, p_return_value in varchar2, p_is_selected in boolean, p_attributes in varchar2, p_escape in boolean default true ); Outputs a JSON response based on the result of a two column LOV in the format: [{"d":"display","r":"return"},{"d":...,"r":...},...] p_component_name is the name of the page item or report column, ... which is used in case an error has to be displayed. Note: The HTTP header is initialized with mime type "application/json" procedure print_lov_as_json ( p_sql_statement in varchar2, p_component_name in varchar2, p_escape in boolean, p_support_legacy_lov in boolean default false /*internal use only! */); Returns a Javascript array with all the page items which are really on the current and on page 0. p_bind_variable_list are the bind variables returned by wwv_flow_utilities.get_binds function get_depending_fields ( p_bind_variable_list in wwv_flow_global.vc_arr2 ) return varchar2; apex_plugin_util type t_plugin is record ( name varchar2(45), file_prefix varchar2(4000), attribute_01 varchar2(32767), … ); apex_plugin: plugin apex_plugin: functions * For a complete refererence check the apex_plugin and apex_plugin_util packages Returns the AJAX identifier which has to be used for the on-demand call of a plug-in. Note: if the plug-in doesn't have an AJAX callback configured, null will be returned! function get_ajax_identifier return varchar2;
  • 63. apex_plugin_util Executes the query and returns the values for each column. Note: All column values are returned as a string p_sql_statement: SQL statement which should be executed. p_min_columns and p_max_columns: Used to check if the SQL statement complies to the number of required columns. p_component_name: The name of the page item or report column which is used in case an error has to be displayed. p_search_type: Use one of the c_search_* constants. p_search_column_no: Column which should be used to restrict the SQL statement. Has to be in range of p_min_column and p_max_column. p_search_string: Value which should be used to restrict the query. p_first_row: Skips all rows before the specified row. Can be used for pagination. p_max_rows: Limits the number of returned rows. function get_data ( p_sql_statement in varchar2, p_min_columns in number, p_max_columns in number, p_component_name in varchar2, p_search_type in varchar2 default null, p_search_column_no in varchar2 default 2, p_search_string in varchar2 default null, p_first_row in number default null, p_max_rows in number default null, p_support_legacy_lov in boolean default false /* internal use only! */ ) return t_column_value_list; Advanced version of get_data, returns the column values with original data types. p_data_type_list: If provided checks that the data type for each column matches to the specified data type in the array. Use the constants c_data_type_* for available data types. function get_data2 ( p_sql_statement in varchar2, p_min_columns in number, p_max_columns in number, p_data_type_list in wwv_flow_global.vc_arr2 default c_empty_data_type_list, p_component_name in varchar2, p_search_type in varchar2 default null, p_search_column_no in varchar2 default 2, p_search_string in varchar2 default null, p_first_row in number default null, p_max_rows in number default null ) return t_column_value_list2; Gets the display value for the value specified in p_search_string. p_component_name: The name of the page item or report column, ... which is used in case an error has to be displayed. p_display_column_no: Column which should be returned from the SQL statement. Has to be in range of p_min_column and p_max_column. p_search_column_no: Column which should be used to restrict the SQL statement. Has to be in range of p_min_column and p_max_column. p_search_string: Value which should be looked up. p_display_extra: If set to TRUE and a value isn't found, the search value will be added to the result instead. Note: In the case multiple rows are returned by the query, just the first one is returned. function get_display_data ( p_sql_statement in varchar2, p_min_columns in number, p_max_columns in number, p_component_name in varchar2, p_display_column_no in binary_integer default 1, p_search_column_no in binary_integer default 2, p_search_string in varchar2, p_display_extra in boolean default true, p_support_legacy_lov in boolean default false /* for internal use only! */ ) return varchar2; Gets the display values for the values specified in p_search_value_list. function get_display_data ( p_sql_statement in varchar2, p_min_columns in number, p_max_columns in number, p_component_name in varchar2, p_display_column_no in binary_integer default 1, p_search_column_no in binary_integer default 2, p_search_value_list in wwv_flow_global.vc_arr2, p_display_extra in boolean default true, p_support_legacy_lov in boolean default false /* for internal use only! */ ) return wwv_flow_global.vc_arr2; Returns a jQuery selector based on a comma delimited string of page item names. function page_item_names_to_jquery ( p_page_item_names in varchar2 ) return varchar2; Returns a cleaned up version of a comma delimited string of page item names where all spaces are removed, colons are replaced with a comma and the page item names are converted to uppercase. This is important for JavaScript code, because page item names are case sensitive in the browser. function cleanup_page_item_names ( p_page_item_names in varchar2 ) return varchar2; apex_javascript Adds the script tag to load a javascript library. p_name: has to be specified without .js p_directory: has to have a trailing slash p_version: version identifier which should be added to the library name p_skip_extension: if true the extension .js is NOT added procedure add_library( p_name in varchar2, p_directory in varchar2 default wwv_flow.g_image_prefix||'javascript/', p_version in varchar2 default c_apex_version, p_skip_extension in boolean default false ); Adds a javascript code snippets to the HTML output which is executed at the onload event. If an entry with the same key exists it will be ignored. If p_key is null the snippet will always be added. p_code: javascript code snippet. eg: $s('P1_TEST', 'abc'); p_key: name of the key. eg: APEX_WIDGET procedure add_onload_code( p_code in varchar2, p_key in varchar2 default null); Adds a code snippet which is included inline into the HTML output eg. You can use this procedure to add new functions or global variable declarations. Note: if you want to execute code, you should use add_onload_code If an entry with the same key exists it will be ignored. If p_key is null the snippet will always be added. p_code: javascript code snippet. eg: $s('P1_TEST', 123); p_key: identifier for the code snippet. If specified and a code snippet with the same name has already been added the new code snippet will be ignored. procedure add_inline_code( p_code in varchar2, p_key in varchar2 default null); Escapes a text so that it can be used in JavaScript without problems. Replaces with , / with /, " with u0022, ' with u0027, tab with t,chr(10) with n. function escape ( p_text in varchar2 ) return varchar2; apex_css Adds the style tag to load a css library. p_name: has to be specified without .js p_directory: has to have a trailing slash p_version: version identifier which should be added to the library name p_skip_extension: if true the extension .css is NOT added procedure add_file ( p_name in varchar2, p_directory in varchar2 default wwv_flow.g_image_prefix||'css/', p_version in varchar2 default c_apex_version, p_skip_extension in boolean default false ); Adds a CSS style snippet which is included inline into the HTML output eg. You can use this procedure to add new css style declarations. If an entry with the same key exists it will be ignored. If p_key is null the snippet will always be added. p_style: CSS style snippet. eg: #test { color:#fff } p_key: identifier for the style snippet. If specified and a style snippet with the same name has already been added the new style snippet will be ignored. procedure add ( p_css in varchar2, p_key in varchar2 default null ); Writes the data of the page item meta data into the HTTP buffer. procedure debug_page_item ( p_plugin in wwv_flow_plugin.t_plugin, p_page_item in wwv_flow_plugin.t_page_item ); procedure debug_page_item ( p_plugin in wwv_flow_plugin.t_plugin, p_page_item in wwv_flow_plugin.t_page_item, p_value in varchar2, p_is_readonly in boolean, p_is_printer_friendly in boolean ); Writes the data of the region meta data into the HTTP buffer. procedure debug_region ( p_plugin in wwv_flow_plugin.t_plugin, p_region in wwv_flow_plugin.t_region ); procedure debug_region ( p_plugin in wwv_flow_plugin.t_plugin, p_region in wwv_flow_plugin.t_region, p_is_printer_friendly in boolean ); Writes the data of the dynamic action meta data into the HTTP buffer. procedure debug_dynamic_action ( p_plugin in wwv_flow_plugin.t_plugin, p_dynamic_action in wwv_flow_plugin.t_dynamic_action ); Writes the data of the process meta data into the HTTP buffer. procedure debug_process ( p_plugin in wwv_flow_plugin.t_plugin, p_process in wwv_flow_plugin.t_process );
  • 64. Demo
  • 65. Recap ❖ Things I always have to look up in following domains: ❖ Database ❖ SQL ❖ PL/SQL ❖ APEX
  • 67. ❖ Looking for consulting, training and development in Oracle Application Express (APEX)? ❖ Contact : www.apexRnD.be ❖ Mail : [email protected] Consulting, Development, Training