【PL/SQL】expression & common function

Lexical units:
-Are building blocks of any PL/SQL block
-Are sequences of characters including letters, numerals, tabs, spaces, returns, and symbols
-Can be classified as:
Identifiers: v_fname, c_percent
Delimiters: ; , +, -
Literals: John, 428, True
Comments: --, /* */

valid in PL/SQL expressions:
single-row number and character functions,
data type conversion functions,
and date and time-stamp functions) are valid in PL/SQL expressions

not available in procedural statements:
DECODE
Group functions: AVG, MIN, MAX, COUNT, SUM, STDDEV, and VARIANCE

nested block:
-An executable section (BEGIN … END) can contain nested blocks.
-An exception section can contain nested blocks.

Nulls
Comparisons involving nulls always yield NULL.
Applying the logical operator NOT to a null yields NULL.
In conditional control statements, if the condition yields NULL, its associated sequence of statements is not executed.

Make code maintenance easier by:
-Documenting code with comments
-Developing a case convention for the code
-Developing naming conventions for identifiers and other objects
-Enhancing readability by indenting

Common function:
LENGTH();
MONTHS_BETWEEN(1,2);
CAST(1 AS TIMESTAMP);

Type Conversion:
– Implicit conversion (char/num | char/date)
– Explicit conversion

– TO_CHAR
– TO_DATE
– TO_NUMBER
– TO_TIMESTAMP

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值