... PL/SQL Subprograms 8-5 Passing Parameters to PL/SQL Subprograms 8-6 Actual Versus Formal SubprogramParameters 8-6 Using Positional, Named, orMixedNotationforSubprogram ... (LOBs), see Oracle Database Application Developer's Guide - Large Objects For SQL information, see the Oracle Database SQL Reference and Oracle Database Administrator's Guide For basic Oracle concepts, ... additional information The following sections describe the new features in PL/SQL: ■ New Features in PL/SQL for Oracle Database 10g ■ New Features in PL/SQL for Oracle9i New Features in PL/SQL for Oracle...
... the subprogram from a BEGIN END block allows namedormixednotationforparameters which the CALL statement does not support For information on named parameters, see "Using Positional, Named, or ... PL/SQL Subprograms 8-5 Passing Parameters to PL/SQL Subprograms 8-6 Actual Versus Formal SubprogramParameters 8-6 Using Positional, Named, orMixedNotationforSubprogram ... Guide Related Documents For more information, see these Oracle resources: ■ For additional information on PL/SQL, see the Oracle Technology Network (OTN), at http://www.oracle.com/technology/tech/pl_sql/...
... First, it is named and identified as a before insert and before update (of Rating) trigger, executing for each row: create or replace trigger BOOKSHELF_BEF_UPD_INS_ROW before insert or update of ... Statement-level triggers therefore are not often used for data-related activities; they are normally used to enforce additional security measures on the types of actions that may be performed on a table Statement-level ... include a column for the derived data Storing this data in an uppercase format (for this example, in the column UpperPerson) allows you to display data to the users in its natural format while using...
... while-loop • Lệnh for- loop Phân biệt trỏ (cursor) ngầm trỏ tường minh? Cursor ngầm đòa không đặt tên lệnh SQL xử lý Oracle và/hay chế thực thi PL/SQL Mọi lệnh SQL thực cursor ngầm, bao gồm lệnh ... cursors tường minh Một trỏ tường minh đặt tên developer Nó lệnh select đặt tên Bất kỳ lệnh select sử dụng cursor tường minh cách sử dụng cú pháp cursor cursor_name is Khi lệnh select đặt cursor ... TRẢ LỜI BÀI TẬP ORACLE Kể số thuộc tính trỏ (cursor) ngầm Một số thuộc tính trỏ (cursor) ngầm: • %notfound đònh không tìm hàng Giá trò trả TRUE hay...
... 102 -11 Ví dụ hàm FLOOR(n) SELECT FLOOR (SAL), FLOOR (99.9), FLOOR (101.76), FLOOR (-11.1) FROM EMP WHERE SAL BETWEEN 3000 AND 5000; FLOOR(SAL) FLOOR(99.9) FLOOR(101.76) FLOOR(-11.1) ... SQL*Plus, Oracle Form, Oracle Report, Oracle Designer Việc chạy ứng dụng hoàn toàn giống nh việc chạy ứng dụng thông thờng môi trờng windows Để làm việc với ứng dụng truy cập CSDL Oracle, ngời ... Chỉnh định dạng nhãn column COLUMN ename HEADING Employee|Name FORMAT A15 COLUMN sal JUSTIFY LEFT FORMAT $ 99,990.00 COLUMN hiredate FORMAT A9 NULL Not hired Vd: Hiển thị định dạng column COLUMN...
... while-loop • Lệnh for- loop Phân biệt trỏ (cursor) ngầm trỏ tường minh? Cursor ngầm đòa không đặt tên lệnh SQL xử lý Oracle và/hay chế thực thi PL/SQL Mọi lệnh SQL thực cursor ngầm, bao gồm lệnh ... cursors tường minh Một trỏ tường minh đặt tên developer Nó lệnh select đặt tên Bất kỳ lệnh select sử dụng cursor tường minh cách sử dụng cú pháp cursor cursor_name is Khi lệnh select đặt cursor ... TRẢ LỜI BÀI TẬP ORACLE Kể số thuộc tính trỏ (cursor) ngầm Một số thuộc tính trỏ (cursor) ngầm: • %notfound đònh không tìm hàng Giá trò trả TRUE hay...
... Quyển sách upload tại: hutonline.net Oracle - SQL PL/SQL Primary Key thiết phải có số liệu Foreign Key Là column tập columns có tham chiếu tới bảng bảng khác Foreign Key xác định mối quan hệ bảng ... Quyển sách upload tại: hutonline.net Oracle - SQL PL/SQL 13.1.4 Database Trigger Edditor 13.2 CÁC HÀM, THỦ TỤC 13.2.1 Tạo hàm, thủ tục Client 13.2.2 Tạo hàm, ... Foreign Key xác định mối quan hệ bảng Constraints Là ràng buộc liệu bảng thuộc database Ví dụ: Foreign Key, Primary Key Ví dụ: minh hoạ thành phần logic database EMP DEPT EMPNO ENAME 7369 SMITH...
... Mở cursor: OPEN Tên cursor | Tên cursor( danh sách biến); Ví dụ1: OPEN c_Dept; OPEN c_Dept(10); Ví dụ2: Lấy liệu: FETCH Tên cursor INTO Tên biến; Ví dụ: FETCH c_Dept INTO v_Dept; Đóng cursor: CLOSE ... v_Emp.job); END LOOP; Đóng cursor CLOSE c_Emp; END; Ví dụ 2: DECLARE Khai báo cursor, có cho phép cập nhật liệu CURSOR c_Dept IS SELECT dname, loc FROM dept FOR UPDATE OF loc; Khai báo biến ... với cursor thông qua dòng liệu Dòng liệu định vị trỏ Với việc dịch chuyển trỏ, ta lấy toàn liệu trả Các bước sử dụng biến cursor: Khai báo > mở cursor > lấy liệu để xử lý > đóng cursor Khai...
... Mở cursor: OPEN Tên cursor | Tên cursor( danh sách biến); Ví dụ1: OPEN c_Dept; OPEN c_Dept(10); Ví dụ2: Lấy liệu: FETCH Tên cursor INTO Tên biến; Ví dụ: FETCH c_Dept INTO v_Dept; Đóng cursor: CLOSE ... v_Emp.job); END LOOP; Đóng cursor CLOSE c_Emp; END; Ví dụ 2: DECLARE Khai báo cursor, có cho phép cập nhật liệu CURSOR c_Dept IS SELECT dname, loc FROM dept FOR UPDATE OF loc; Khai báo biến ... với cursor thông qua dòng liệu Dòng liệu định vị trỏ Với việc dịch chuyển trỏ, ta lấy toàn liệu trả Các bước sử dụng biến cursor: Khai báo > mở cursor > lấy liệu để xử lý > đóng cursor Khai...
... Mở cursor: OPEN Tên cursor | Tên cursor( danh sách biến); Ví dụ1: OPEN c_Dept; OPEN c_Dept(10); Ví dụ2: Lấy liệu: FETCH Tên cursor INTO Tên biến; Ví dụ: FETCH c_Dept INTO v_Dept; Đóng cursor: CLOSE ... v_Emp.job); END LOOP; Đóng cursor CLOSE c_Emp; END; Ví dụ 2: DECLARE Khai báo cursor, có cho phép cập nhật liệu CURSOR c_Dept IS SELECT dname, loc FROM dept FOR UPDATE OF loc; Khai báo biến ... với cursor thông qua dòng liệu Dòng liệu định vị trỏ Với việc dịch chuyển trỏ, ta lấy toàn liệu trả Các bước sử dụng biến cursor: Khai báo > mở cursor > lấy liệu để xử lý > đóng cursor Khai...
... Primary Key thiết phải có số liệu Foreign Key column tập column tham chiếu tới bảng bảng khác Foreign Key xác định mối quan hệ bảng Constraint ràng buộc liệu, ví dụ Foreign Key, Primary Key Đào tạo ... WARD 30 7566 JONES 20 30 SALES 7654 MARTIN 30 40 OPERATIONS 7698 BLAKE 30 7782 Row SMITH CLARK 10 Foreign key Primary key Column 1.5 Danh sách rút gọn đối tợng CSDL Table cấu trúc lu trữ CSDL quan ... quan hệ (RDBMS), bao gồm nhiều column nhiều row Row tổ hợp giá trị Column bảng Một row đợc gọi record Column hiển thị loại liệu bảng, ví dụ tên phòng ban bảng phòng ban Ngời ta thể thông qua tên...
... Builder có số thành phần sau: Object Navigator phần hiển thị đối tợng Procedure Builder's Program Unit editor PL/SQL Interpreter Wizard Object Navigator Đặc tính Đóng (+), mở (-) node để xem ... unit Tạo cách nhấn vào nút (+) toolbar Soạn thảo Trợ giúp soạn thảo menu edit Có thể dùng import export menu file để đa thêm/loại bỏ đoạn text Chọn Syntax palete menu program để trợ giúp cú pháp ... Attached library: Sử dụng program unit Attached library nh hàm mặc định Stored Program Unit: Cất Program Unit thành Stored Program Unit CSDL 18 cú pháp lập trình 18.1 IF IF condition THEN actions...
... LOOP; Ví dụ 2: LOOP EXIT WHEN total_sals = 60000; END LOOP; 18.3 FORFOR control_variable IN [REVERSE] low_value high_value Ví dụ FOR I IN 2000 LOOP INSERT INTO numbered_rows VALUES (i); preserve_i:=i; ... Builder có số thành phần sau: Object Navigator phần hiển thị đối tợng Procedure Builder's Program Unit editor PL/SQL Interpreter Wizard Object Navigator Đặc tính Đóng (+), mở (-) node để xem ... Attached library: Sử dụng program unit Attached library nh hàm mặc định Stored Program Unit: Cất Program Unit thành Stored Program Unit CSDL 18 cú pháp lập trình 18.1 IF IF condition THEN actions...
... support for the Software is provided for your information only SYBEX is not the agent or principal of the Owner(s), and SYBEX is in no way responsible for providing any support for the Software, nor ... Software or its contents, quality, performance, merchantability, or fitness for a particular purpose In no event will SYBEX, its distributors, or dealers be liable to you or any other party for direct, ... fetch, it will have a value of For more information about cursors, see Chapter 22 D The attribute %ROWTYPE is used to create a record based on a table, view, or query For more about the %ROWTYPE attribute,...
... HEADER) + ( TABLE DIRECTORY + ROW DIRECTORY) Trong đó: fixed header = 57 bytes variable transaction header = 23*giá trị thông số instrans table directory =4 row directory = 2* số lợng row block ... BY expr] [HAVING condition] [UNION/UNION ALL/INTERSET/MINUS select command] [ORDER BY expr/position [DESC/ASC]] [FOR UPDATE OF [column]] [NOTWAIT] Các thành phần câu lệnh SELECT DISTINCT ALL ... MINUS Cho kết kết hợp toán tử tập hợp ORDER BY Xếp thứ t row theo expr hay position (trong danh sách select) ASC, DESC Trật tự xuôi (mặc nhiên) hay ngợc FOR UPDATE Khóa row đợc chọn, cho biết...
... Chapter Loops Next: 7.4 The Cursor FOR Loop 7.3 The Numeric FOR Loop There are two kinds of PL/SQL FOR loops: the numeric FOR loop and the cursor FOR loop The numeric FOR loop is the traditional and ... explicit declarations for both the cursor (line 2) and a record for that cursor (line 5) The block then uses a cursor FOR loop with that cursor and specifies as its index a record with the same name ... cursor FOR loop when you want to fetch and process every record in a cursor Let's take a look at how you can use the cursor FOR loop to streamline your code and reduce opportunities for error...
... This material or any portion of it may not be copied in any form or by any means without the express prior written permission of the Worldwide Education Services group of Oracle Corporation Any ... Authors Copyright EĂOracle Corporation, 1992, 1996 All rights reserved Neena Kochhar Debby Kramer This documentation contains proprietary information of Oracle Corporation; it is provided ... behavior of SQL statements for the session Format Formats query results File manipulation Saves, loads, and runs script files Execution Sends SQL or PL/SQL commands from SQL buffer to Oracle7...
... [CONSTRAINT constraint_name] PRIMARY KEY FOREIGN KEY ( Referential ): Chỉ mối liên hệ ràng buộc tham chiếu table với table khác, table Nó mối liên hệ cha-con ràng buộc FOREIGN KEY bảng với PRIMARY KEY ... NUMBER 2 Tạo bảng ASSIGNMENTS với column đợc dới đây, đồng thời cột PROJID foreign key tới bảng PROJECT, cột EMPNO foreign key tới bảng EMP Column name Data Type Size -PROJID ... tin ORACLE không cho phép gán mục tin dài chiều dài tối đa định kiểu VARCHAR2 Chiều dài tối đa kiểu VARCHAR2 2000 byte 11.4.3 VARCHAR Hiện ORACLE xem kiểu VARCHAR2 VARCHAR nh nhau, nhiên ORACLE...