TAILIEUCHUNG - HandBooks Professional Java-C-Scrip-SQL part 175

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 175', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Calling PL SQL Functions in SQL Stored functions can be called from SQL statements in a manner similar to built-in functions like DECODE NVL or RTRIM. This is a powerful technique for incorporating business rules into SQL in a simple and elegant way. Unfortunately there are a number of caveats and restrictions. The most notable caveat is that stored functions executed from SQL are not by default guaranteed to follow the statement-level read consistency model of the database. Unless the SQL statement and any stored functions in that statement are in the same read-consistent transaction even if they are read-only each execution of the stored function may look at a different time-consistent set of data. To avoid this potential problem you need to ensure read consistency programmatically by issuing the SET TRANSACTION READ ONLY or SET TRANSACTION ISOLATION LEVEL SERIALIZABLE statement before executing your SQL statement containing the stored function. A COMMIT or ROLLBACK then needs to follow the SQL statement to end this read-consistent transaction. Calling a Function The syntax for calling a stored function from SQL is the same as that used to reference it from PL SQL schemanam e. pkg nam e. func nam e @db_link parmlist schema_name is optional and refers to the user owner of the function or package. pkg_name is optional and refers to the package containing the called function. func_name is required and is the function name. db_link is optional and refers to the database link name to the remote database containing the function. parm_list is optional as are the parameters passed to the function. The following are example calls to the GetTimestamp function in the time_pkg example seen earlier in Section -- Capture system events. INSERT INTO v_sys_event timestamp event qty_waits SELECT event total_waits FROM v system_event -- Capture system statistics. INSERT INTO v_sys_stat timestamp stat value SELECT .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.