TAILIEUCHUNG - Joe Celko s SQL for Smarties - Advanced SQL Programming P25

Joe Celko s SQL for Smarties - Advanced SQL Programming P25. In the SQL database community, Joe Celko is a well-known columnist and purveyor of valuable insights. In Joe Celko's SQL for Smarties: Advanced SQL Programming, he picks up where basic SQL training and experience leaves many database professionals and offers tips, techniques, and explanations that help readers extend their capabilities to top-tier SQL programming. Although Celko denies that the book is about database theory, he nevertheless alludes to theory often to buttress his practical points. This title is not for novices, as the author points out. Instead, its intended audience. | 212 CHAPTER 8 TABLE OPERATIONS the searched deletion uses a where clause like the search condition in a select statement. The DELETE FROM Clause The syntax for a searched deletion statement is delete statement searched DELETE FROM table name WHERE search condition The delete from clause simply gives the name of the updatable table or view to be changed. Notice that no correlation name is allowed in the delete from clause. The SQL model for an alias table name is that the engine effectively creates a new table with that new name and populates it with rows identical to the base table or updatable view from which it was built. If you had a correlation name you would be deleting from this system-created temporary table and it would vanish at the end of the statement. The base table would never have been touched. For this discussion we will assume the user doing the deletion has applicable delete privileges for the table. The positioned deletion removes the row in the base table that is the source of the current cursor row. The syntax is delete statement positioned DELETE FROM table name WHERE CURRENT OF cursor name Cursors in SQL are generally more expensive than nonprocedural code and despite the existence of the Standard they vary widely in current implementations. If you have a properly designed table with a key you should be able to avoid them in a delete from statement. The WHERE Clause The most important thing to remember about the where clause is that it is optional. If there is no where clause all rows in the table are deleted. The table structure still exists but there are no rows. Most but not all interactive SQL tools will give the user a warning when he or she is about to do this and ask for confirmation. Unless you want to clear out the table immediately do a rollback to restore it if you COMMIT or have set the tool to automatically commit the work then DELETE FROM Statement 213 the data is pretty much gone. The DBA will have to do .

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.