Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 180 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
180
Dung lượng
849,04 KB
Nội dung
[...]... descriptions PL/SQLLanguage Fundamentals This section summarizes the fundamental components of the PL/SQL language: characters, identifiers, literals, delimiters, use of comments and pragmas, and construction of statements and blocks PL/SQL Character Set The PL/SQLlanguage is constructed from letters, digits, symbols, and whitespace, as defined in the following table: 2 | OraclePL/SQLLanguage Pocket. .. 3.14159265 3.14159 NUMBER(12,-5) 8675309 8700000 Oracle provides a variety of datatypes to store 32-bit whole numbers: BINARY_INTEGER, INTEGER, INT, SMALLINT, NATURAL, NATURALN, POSITIVE, POSITIVEN, 12 | OraclePL/SQLLanguagePocket Reference SIGNTYPE, and PLS_INTEGER Prior to Oracle Database 10g, all of these except PLS_INTEGER were manipulated using the same C -language arithmetic library as the NUMBER... the date DBMS_OUTPUT.PUT_LINE ('Today is ' || today); END show_the_date; The following table summarizes the sections of a PL/SQL block: 10 | OraclePL/SQLLanguagePocket Reference Section Description Header Required for named blocks Specifies the way the program is called by other PL/SQL blocks Anonymous blocks do not have a header They start with the DECLARE keyword if there is a declaration section,... instructions to the compiler There are five types of pragmas in PL/SQL: AUTONOMOUS_TRANSACTION Tells the compiler that the function, procedure, top-level anonymous PL/SQL block, object method, or database trigger executes in its own transaction space See the “Database Interaction” section for more information on this pragma 8 | OraclePL/SQLLanguagePocket Reference EXCEPTION_INIT Tells the compiler to associate... locators that point to large Unicode character objects inside the database 18 | OraclePL/SQLLanguagePocket Reference Implicit Datatype Conversions Whenever PL/SQL detects that a datatype conversion is necessary, it attempts to change the values as required to perform the operation Figure 2 shows what types of implicit conversions PL/SQL can perform Note that not all values in each datatype can be converted... latest revision as well as the third edition Thanks as well to first -edition reviewers Eric J Givler and Stephen Nelson and to second- and third -edition reviewer Jonathan Gennick In addition, we appreciate all the good work by the O’Reilly crew in editing and producing this book Conventions UPPERCASE indicates PL/SQL keywords, as well as certain identifiers used by Oracle Corporation as built-in function... special meaning, such as := (assignment operator), || (concatenation operator), and ; (statement delimiter) The following table lists the PL/SQL delimiters: Delimiter Description ; Terminator (for statements and declarations) + Addition operator 6 | OraclePL/SQLLanguagePocket Reference Delimiter Description - Subtraction operator * Multiplication operator / Division operator ** Exponentiation operator... for an anchored declaration can be different from that for the base declaration: tot_sales monthly_sales 22 | NUMBER(20,2) NOT NULL DEFAULT 0; tot_sales%TYPE DEFAULT 10; OraclePL/SQLLanguagePocket Reference Programmer-Defined Subtypes PL/SQL allows you to define unconstrained scalar subtypes An unconstrained subtype provides an alias to the original underlying datatype; for example: CREATE OR REPLACE... BINARY_DOUBLE Oracle Database 10g introduced several special named constants: BINARY_FLOAT_NAN (Not a Number) BINARY_FLOAT_INFINITY BINARY_FLOAT_MAX_NORMAL BINARY_FLOAT_MIN_NORMAL PL/SQLLanguage Fundamentals | 5 BINARY_FLOAT_MAX_SUBNORMAL BINARY_FLOAT_MIN_SUBNORMAL as well as the BINARY_DOUBLE versions of these constants Datetime Interval Literals The datetime interval datatypes, introduced in Oracle9 i... LONG Variable-length alphanumeric strings Valid sizes are 1 to 32760 bytes LONG is included primarily for backward compatibility CLOB is the preferred datatype for large character strings 14 | OraclePL/SQLLanguagePocket Reference Family Description RAW Variable-length binary strings Valid sizes are 1 to 32767 bytes (which is larger than the database limit of 2000) RAW data does not undergo character .
1
Chapter 1
Oracle PL/SQL Language
Pocket Reference
Introduction
The Oracle PL/SQL Language Pocket Reference is a quick ref-
erence guide to the PL/SQL programming. books:
Oracle PL/SQL Programming, Fourth Edition, by Steven
Feuerstein with Bill Pribyl
Learning Oracle PL/SQL, by Bill Pribyl with Steven Feuerstein
Oracle PL/SQL