Oracle 8i PLSQL Guide
معرفی کتاب «Oracle 8i PLSQL Guide». این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Oracle 8i PLSQL Guide» در دستهٔ بدون دستهبندی قرار دارد.
PDF Directory......Page 0 Contents......Page 3 Send Us Your Comments......Page 17 Preface......Page 19 1 Overview......Page 25 Block Structure......Page 26 Variables and Constants......Page 27 Cursors......Page 29 Cursor Variables......Page 30 Attributes......Page 31 Control Structures......Page 33 Modularity......Page 35 Data Abstraction......Page 37 Information Hiding......Page 39 Error Handling......Page 40 Architecture......Page 41 In the Oracle Server......Page 42 In Oracle Tools......Page 43 Support for SQL......Page 44 Better Performance......Page 45 Higher Productivity......Page 46 Tight Security......Page 47 2 Fundamentals......Page 49 Lexical Units......Page 50 Delimiters......Page 51 Identifiers......Page 52 Literals......Page 55 Comments......Page 58 Datatypes......Page 59 Number Types......Page 60 Character Types......Page 63 National Character Types......Page 68 LOB Types......Page 70 Other Types......Page 71 Defining Subtypes......Page 73 Using Subtypes......Page 74 Implicit Conversion......Page 76 DATE Values......Page 77 Declarations......Page 78 Using DEFAULT......Page 79 Using %TYPE......Page 80 Using %ROWTYPE......Page 81 Naming Conventions......Page 84 Name Resolution......Page 85 Scope and Visibility......Page 86 Boolean Values......Page 89 Expressions and Comparisons......Page 90 Operator Precedence......Page 91 Logical Operators......Page 92 Comparison Operators......Page 93 Boolean Expressions......Page 95 Handling Nulls......Page 97 Built-In Functions......Page 100 3 Control Structures......Page 103 Conditional Control: IF Statements......Page 104 IF-THEN-ELSE......Page 105 IF-THEN-ELSIF......Page 106 Guidelines......Page 107 LOOP......Page 108 WHILE-LOOP......Page 111 FOR-LOOP......Page 112 GOTO Statement......Page 117 NULL Statement......Page 121 4 Collections and Records......Page 123 Understanding Nested Tables......Page 124 Nested Tables versus Index-by Tables......Page 125 Varrays versus Nested Tables......Page 126 Defining and Declaring Collections......Page 127 Declaring Collections......Page 129 Initializing and Referencing Collections......Page 130 Referencing Collection Elements......Page 132 Assigning and Comparing Collections......Page 133 Some Nested Table Examples......Page 135 Some Varray Examples......Page 138 Manipulating Individual Elements......Page 140 Manipulating Local Collections......Page 142 Using Collection Methods......Page 143 Using LIMIT......Page 144 Using PRIOR and NEXT......Page 145 Using EXTEND......Page 146 Using TRIM......Page 147 Using DELETE......Page 148 Avoiding Collection Exceptions......Page 149 Taking Advantage of Bulk Binds......Page 151 How Do Bulk Binds Improve Performance?......Page 152 Using the FORALL Statement......Page 154 Rollback Behavior of FORALL......Page 155 Using %BULK_ROWCOUNT......Page 156 Restrictions on FORALL......Page 157 Using the BULK COLLECT Clause......Page 159 Bulk Fetches......Page 160 Bulk Returns......Page 161 Restrictions on BULK COLLECT......Page 162 Using Host Arrays......Page 163 Defining and Declaring Records......Page 164 Declaring Records......Page 165 Initializing and Referencing Records......Page 166 Referencing Records......Page 167 Assigning and Comparing Records......Page 169 Manipulating Records......Page 171 5 Interaction with Oracle......Page 175 Transaction Control......Page 176 SQL Pseudocolumns......Page 177 SQL Operators......Page 179 Explicit Cursors......Page 180 Implicit Cursors......Page 185 Packaging Cursors......Page 186 Using Cursor FOR Loops......Page 187 Using Aliases......Page 188 Using Cursor Variables......Page 189 Why Use Cursor Variables?......Page 190 Declaring Cursor Variables......Page 191 Controlling Cursor Variables......Page 193 Example 1......Page 199 Example 3......Page 200 Example 4......Page 203 Reducing Network Traffic......Page 205 Avoiding Errors......Page 206 Restrictions on Cursor Variables......Page 208 Explicit Cursor Attributes......Page 209 Implicit Cursor Attributes......Page 213 Processing Transactions......Page 215 How Transactions Guard Your Database......Page 216 Using COMMIT......Page 217 Using ROLLBACK......Page 218 Using SAVEPOINT......Page 219 Ending Transactions......Page 220 Using SET TRANSACTION......Page 221 Overriding Default Locking......Page 222 Advantages of Autonomous Transactions......Page 226 Defining Autonomous Transactions......Page 227 Controlling Autonomous Transactions......Page 230 Using Autonomous Triggers......Page 232 Calling Autonomous Functions from SQL......Page 234 Use Object Types and Collections......Page 235 Use Bulk Binds......Page 236 Use External Routines......Page 237 Use the RETURNING Clause......Page 238 Use Serially Reusable Packages......Page 239 Use the PLS_INTEGER Datatype......Page 240 Rephrase Conditional Control Statements......Page 241 Avoid Implicit Datatype Conversions......Page 242 Ensuring Backward Compatibility......Page 243 6 Error Handling......Page 245 Overview......Page 246 Advantages of Exceptions......Page 247 Predefined Exceptions......Page 248 Scope Rules......Page 251 Using EXCEPTION_INIT......Page 252 Using raise_application_error......Page 253 Redeclaring Predefined Exceptions......Page 254 Using the RAISE Statement......Page 255 How Exceptions Propagate......Page 256 Reraising an Exception......Page 258 Handling Raised Exceptions......Page 259 Exceptions Raised in Declarations......Page 260 Branching to or from an Exception Handler......Page 261 Using SQLCODE and SQLERRM......Page 262 Unhandled Exceptions......Page 263 Continuing after an Exception Is Raised......Page 264 Retrying a Transaction......Page 265 Using Locator Variables......Page 266 7 Subprograms......Page 267 What Are Subprograms?......Page 268 Understanding Procedures......Page 269 Understanding Functions......Page 272 Using the RETURN Statement......Page 274 Controlling Sides Effects......Page 275 Declaring Subprograms......Page 276 Packaging Subprograms......Page 277 Actual versus Formal Parameters......Page 278 Using Mixed Notation......Page 279 Using the OUT Mode......Page 280 Summary of Parameter Modes......Page 282 Using the NOCOPY Compiler Hint......Page 283 The Trade-Off for Better Performance......Page 284 Restrictions on NOCOPY......Page 285 Using Parameter Defaults......Page 286 Understanding Parameter Aliasing......Page 288 Using Overloading......Page 290 Restrictions on Overloading......Page 291 How Calls Are Resolved......Page 293 Invoker Rights versus Definer Rights......Page 295 Advantages of Invoker Rights......Page 296 Using the AUTHID Clause......Page 297 How External References Are Resolved......Page 298 Overriding Default Name Resolution......Page 300 Granting Privileges......Page 301 Using Views and Database Triggers......Page 302 Using Object Types......Page 303 What Is a Recursive Subprogram?......Page 305 Using Mutual Recursion......Page 308 Recursion versus Iteration......Page 309 Calling External Routines......Page 310 Using PL/SQL Server Pages......Page 311 8 Packages......Page 313 What Is a Package?......Page 314 Advantages of Packages......Page 317 The Package Spec......Page 318 Referencing Package Contents......Page 319 The Package Body......Page 320 Some Examples......Page 321 Overloading Packaged Subprograms......Page 327 Package STANDARD......Page 328 DBMS_OUTPUT......Page 329 Guidelines......Page 330 9 Object Types......Page 333 The Role of Abstraction......Page 334 What Is an Object Type?......Page 335 Structure of an Object Type......Page 337 Attributes......Page 339 Methods......Page 340 Defining Object Types......Page 344 Object Type Stack......Page 345 Object Type Ticket_Booth......Page 348 Object Type Bank_Account......Page 350 Object Type Rational......Page 352 Declaring Objects......Page 354 Initializing Objects......Page 355 Accessing Attributes......Page 356 Calling Constructors......Page 357 Calling Methods......Page 358 Sharing Objects......Page 359 Using Refs......Page 360 Forward Type Definitions......Page 361 Manipulating Objects......Page 362 Selecting Objects......Page 363 Inserting Objects......Page 367 Deleting Objects......Page 369 10 Native Dynamic SQL......Page 371 The Need for Dynamic SQL......Page 372 Using the EXECUTE IMMEDIATE Statement......Page 373 Some Examples......Page 374 Backward Compatibility......Page 375 Specifying Parameter Modes......Page 376 Opening the Cursor Variable......Page 377 Closing the Cursor Variable......Page 378 Some Examples......Page 379 Passing the Names of Schema Objects......Page 381 Using Duplicate Placeholders......Page 382 Passing Nulls......Page 383 Using Invoker Rights......Page 384 Avoiding Deadlocks......Page 385 11 Language Elements......Page 387 Assignment Statement......Page 389 AUTONOMOUS_TRANSACTION Pragma......Page 393 Blocks......Page 396 CLOSE Statement......Page 403 Collection Methods......Page 405 Collections......Page 410 Comments......Page 416 COMMIT Statement......Page 417 Constants and Variables......Page 419 Cursor Attributes......Page 423 Cursor Variables......Page 428 Cursors......Page 434 DELETE Statement......Page 438 EXCEPTION_INIT Pragma......Page 442 Exceptions......Page 444 EXECUTE IMMEDIATE Statement......Page 447 EXIT Statement......Page 451 Expressions......Page 453 FETCH Statement......Page 463 FORALL Statement......Page 468 Functions......Page 470 GOTO Statement......Page 475 IF Statement......Page 477 INSERT Statement......Page 480 Literals......Page 483 LOCK TABLE Statement......Page 486 LOOP Statements......Page 488 NULL Statement......Page 495 Object Types......Page 496 OPEN Statement......Page 505 OPEN-FOR Statement......Page 507 OPEN-FOR-USING Statement......Page 510 Packages......Page 513 Procedures......Page 519 RAISE Statement......Page 524 Records......Page 526 RESTRICT_REFERENCES Pragma......Page 530 RETURN Statement......Page 533 ROLLBACK Statement......Page 535 %ROWTYPE Attribute......Page 537 SAVEPOINT Statement......Page 539 SELECT INTO Statement......Page 540 SERIALLY_REUSABLE Pragma......Page 545 SET TRANSACTION Statement......Page 547 SQL Cursor......Page 549 SQLCODE Function......Page 552 SQLERRM Function......Page 554 %TYPE Attribute......Page 556 UPDATE Statement......Page 558 A Sample Programs......Page 563 Running the Programs......Page 564 PL/SQL Block......Page 565 Input Table......Page 566 Output Table......Page 567 PL/SQL Block......Page 568 Sample 4. Batch Transaction Processing......Page 569 PL/SQL Block......Page 570 Output Tables......Page 572 PL/SQL Block in a C Program......Page 573 Interactive Session......Page 575 Output Tables......Page 576 Stored Procedure......Page 577 Interactive Session......Page 580 B CHAR versus VARCHAR2 Semantics......Page 581 Comparing Character Values......Page 582 Selecting Character Values......Page 584 C Wrap Utility......Page 587 Running the Wrap Utility......Page 588 Input and Output Files......Page 589 Version Compatibility......Page 590 Guidelines......Page 591 D Name Resolution......Page 593 What Is Name Resolution?......Page 594 Various Forms of References......Page 595 Name-Resolution Algorithm......Page 596 Finding the Basis......Page 597 Inner Capture......Page 599 Same-Scope Capture......Page 600 Accessing Attributes and Methods......Page 601 Calling Subprograms and Methods......Page 602 SQL versus PL/SQL......Page 604 E PL/SQL Program Limits......Page 605 Dealing with Size Limits......Page 606 F Reserved Words......Page 609 Index......Page 611
دانلود کتاب Oracle 8i PLSQL Guide