ORACLE PL/SQL Instance fine Solutions Chapter II General programming language basics

Source: Internet
Author: User
Tags arithmetic character classes null null

General Programming Language Basics

2.1pl/sql Programming Basics

1. Character type: Supports four types of characters: letters, numbers, symbols and spaces, combining one or more characters creates a lexical unit

2. Vocabulary unit

A. Identifiers must begin with a character

B. Reserved words are PL/SQL special words

C. Delimiters only characters with special meaning to PL/SQL (arithmetic operations and quotation marks)

D. Annotation line (--) multiline (/**/)

2.1.1 Using language components

Character classes and lexical units are equivalent to letters and spelling words

2.1.2 using PL/SQL variables

A v_a and v_a are the same variable names, and PL/SQL is case insensitive

B. You can use the coalesce function to compare each expression in an expression list to null and return a value of a non-null expression

2.1.3 Do not use keywords

2.1.4 using identifiers in PL/SQL

When the declared data type is VARCHAT2, you need to add single quotes when assigning constants

2.1.5 using the anchored data type

Setting a data type to a variable can be based on a database object, called a anchored declaration

Data types for Orache

VARCHAR2: Stores variable-length characters. Parameters must be set to the maximum length of the character data, up to 32767. Do not use constants or variables to make the maximum length: you must use the literal value of the integer type. Database column has a maximum width of 4000 bytes

CHAR: Stores the field characters, parameters are optional. Do not use constants or variables to make the maximum length: you must use the literal value of the integer type. Database column has a maximum width of 2000 bytes

Number (Precision,scale): Stores any size of fixed-point or floating-point numbers, precision is the number of digits, the scale determines whether rounding, you can set the precision ellipsis, if the scale is 0, and only allow the use of integers

Boolean: Store true,false or NULL to assign only true,false or NULL NULL to the Boolean variable, the value True and false cannot be inserted into the database column

Long: Storing variable-length strings

LOB: Large data can be stored in binary object, example or video, up to 4GB

2.1.6 declaring and initializing variables

The variable must be declared so that it is referenced.

Operator

Arithmetic operator (**,*,/,+,-)

comparison operator (=,<>,!=,<,>,<=,>=,like,in,between,is null, is isn't null, not in)

Logical operator (And,or,not).

String operator (| |,like)

ORACLE PL/SQL Instance fine Solutions Chapter II General programming language basics

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.