Đang chuẩn bị liên kết để tải về tài liệu:
Oracle SQL Plus The Definitive Guide- P16

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Oracle SQL Plus The Definitive Guide- P16:Every day, computer professionals the world over wake up, travel to the office, sit down in front of a computer, and begin another day working with that database called Oracle. Programmers write queries and stored procedures. Database administrators monitor performance, make database changes, and perform other maintenance tasks. Operations people may need to back up or recover a database. | previous page page_127 next page Page 127 SQL @c hours_dollars_b Enter value for employee_id 111 As commands are executed SQL Plus constantly looks for the ampersand character indicating a substitution variable. When an ampersand is encountered the next token in the command is treated as a variable. SQL Plus first looks to see if that variable has been previously defined. In this example it hasn t so SQL Plus automatically prompts for the value. After prompting for a value and substituting it into the script in place of the corresponding variable SQL Plus will display both the old and the new versions of the particular line of script involved. During development this aids you in verifying that your script is executing correctly. Here are the before and after versions of the line containing the employee_id variable from the current example old 13 new 13 AND E.EMPLOYEE_ID employee_id AND E.EMPLOYEEID 111 Next SQL Plus goes on to tead the remining lines from the script producing this hours and dollars report for Taras Shevchenko The Fictional Company I.S.Department Project Hours and Dollars Detail Employee 111 Taras Shevchenko Dollars Proj ID Project Name Date Hours Charged 1001 Corporate Web Site 01-Jan-1998 1 100.00 01 Mar-1998 3 300.00 01 May-1998 5 500.00 01-Jul-1988 7 700.00 01-Sep-1998 1 100.00 01-Nov-1998 3 300.00 Project Totals 20 2 000.00 In addition to being displayed on the screen the report is also spooled to the file specified in the script. When TERMOUT is off In the example just shown the report was both displayed on the screen and spooled to a file. In Chapter 3 you saw how the SET TERMOUT OFF command could be used to suppress output to the display while still allowing it to be previous page page_127 next page previous page page_128 next page Page 128 spooled thus making a report run much faster. Trying to do the same thing in this case presents a special problem. The problem is that the command to turn TERMOUT off must precede the SELECT statement .

TÀI LIỆU LIÊN QUAN