Teach yourself SQL in 21 days
... now using a relational database. You have seen terms like SQL, tables, records, queries, and RDBMS, but you don't remember Teach Yourself SQL in 21 Days, Second Edition - Day 2 - Introduction ... SELECT into your system, you might get the following response: INPUT: SQL& gt; SELECT; OUTPUT: SELECT * ERROR at line 1: ORA-00936: missing expression The asterisk under the offending line indicates ... calculations in a SELECT statement. Modulo (%) The modulo operator returns the integer remainder of the division operation. Using the table REMAINS, type the following: INPUT: SQL& gt; SELECT...
Ngày tải lên: 06/08/2013, 17:39
Ngày tải lên: 26/01/2014, 15:20
Teach Yourself PL/SQL in 21 Days- P16
... 11 SQL- Programmer (Sylvain Faust Inc.), 11 SQL- Station (Platinum Technology Inc.), 11 SQLCODE function, 160, 211 -212 SQLERRM function, 160, 211 -212 SQLJ, calling PL /SQL from Java, 578-579 calling ... creating, 54 creating (security exam- ple), 538-539 data integrity (maintain- ing), 300-304 listing, 302 defining, 299-300, 313, 319 delete, 296 enabling/disabling, 310-311 event, 311-312 defining, ... 143 loops, 121 CURSOR FOR, 254 debugging, 136 FOR, 121- 122, 146 common errors, 124 EXIT statement, 140 listing, 121 nesting, 121 guidelines, 147 incrementing through, 123-124 listing, 123 infinite,...
Ngày tải lên: 20/10/2013, 17:15
Teach Yourself PL/SQL in 21 Days- P1
... Compatibility 574 Using the OUT and IN OUT Arguments 575 Calling PL /SQL from Java Using SQLJ 578 Using SQLJ to Execute an Anonymous PL /SQL Block 578 Using SQLJ to Call a PL /SQL Procedure or Function ... exciting new product. PL /SQL is an excellent language to use for database programming. We hope that you enjoy learning about both as you read this book. 4 Sams Teach Yourself PL /SQL in 21 Days, ... using the SQL* Plus @ command. •Use the SQL* Plus EDIT command. The first method involves running Windows Notepad, typing your PL /SQL code (or SQL queries) into it, and then copying and pasting from...
Ngày tải lên: 07/11/2013, 20:15
Teach Yourself PL/SQL in 21 Days- P2
... A nested anonymous block begins on line 14 and ends on line 21. Lines 6 through 9 define the name_print procedure. The variable a_name is declared in the outermost block (see line 4), thus any nested block, ... watermark. Writing Declarations and Blocks 49 2 Using Block Structure On Day 1, “Learning the Basics of PL /SQL, ” you saw that the fundamental programming structure in PL /SQL is referred to as a block. In ... watermark. Writing Declarations and Blocks 59 2 22: 23: DBMS_OUTPUT.PUT_LINE(‘Back in the main block’); 24: 25: But we cannot compile the following line because b_name 26: is not defined in this block. 27:...
Ngày tải lên: 07/11/2013, 20:15
Teach Yourself PL/SQL in 21 Days- P3
... typing the keyword BEGIN : BEGIN Because you are not performing anything in this function except returning a value, you will code a NULL statement, which is discussed later in this lesson in ... When I am comparing strings, especially when comparing a CHAR string to a VARCHAR2 string, is there a convenient way to tell PL /SQL to ignore any trail- ing spaces in the CHAR string? A Yes. Use ... longer string and then does the comparison. Trailing spaces alone will not result in any differences being found between two springs. Oracle also does the same thing when comparing two string constants....
Ngày tải lên: 07/11/2013, 20:15
Tài liệu Teach Yourself PL/SQL in 21 Days- P4 pptx
... ending semicolon for the one-line SQL listings. If you are entering at the prompt, the semicolon performs the SQL statement, similar to using a / to execute the code. Note L ISTING 6.8 Converting DATE to ... about using this example as a PL /SQL procedure and returning to the good old days of BC? Listing 6.9 shows another example of using TO_CHAR with converting and format- ting dates. L ISTING 6.9 Converting DATE to ... (inverse) cosine of a number, expressed in radians. ASIN Returns the arc (inverse) sine of a number, expressed in radians. ATAN Returns the arc (inverse) tangent of a number (x), expressed in...
Ngày tải lên: 15/12/2013, 05:15
Tài liệu Teach Yourself PL/SQL in 21 Days- P5 doc
... resulting month does not have as many days. (For example, April 30th is the answer to adding one month.) The following three examples in Listing 6 .21 provide the same result. L ISTING 6 .21 Adding ... ON command at the SQL* Plus prompt. The code in Listing 7.2 illustrates the PUT_LINE command line that you can include inside a procedure. L ISTING 7.2 The PUT_LINE Command Within a Procedure CREATE ... left in the given month. LAST_DAY(input_date_passed) You will compute the last days in the month when summer officially starts from 1999. Execute the code in Listing 6.27. L ISTING 6.27 Finding...
Ngày tải lên: 15/12/2013, 05:15
Tài liệu Teach Yourself PL/SQL in 21 Days- P6 docx
... containing any of the following: OPEN stock_listing_cur (stock_listing.name, ‘ABCDEFG’); OPEN stock)listing_cur (stock_listing_name, stock_listing_price); Fetching Data in a Cursor You get data into ... IF; 29: END; 30: / Line 12 places a value into the table associated with the index value 10. There are no other values in the table. Line 17, inside the nested PL /SQL block (lines 16 21) , attempts ... number Listing 8.4 shows the PL /SQL anonymous block that you can run to insert the necessary data. L ISTING 8.4 Inserting Records with PL /SQL Code DECLARE insert department data first i_dept_id INTEGER, i_dept_name, BEGIN INSERT...
Ngày tải lên: 15/12/2013, 05:15
Tài liệu Teach Yourself PL/SQL in 21 Days- P7 ppt
... imagina- tion. Some common uses are • Enforcing business rules • Maintaining referential integrity • Enforcing security • Maintaining a historical log of changes • Generating column values, including ... trigger. Lines 17–19 define a record containing the primary key fields for the emp_dept table. This record in turn is used to define a PL /SQL table type (lines 23–24). Finally, in line 27, a PL /SQL ... read in. 13: depts dept_table; 14: depts_max PLS_INTEGER; 15: inx1 PLS_INTEGER; 16: BEGIN 17: Initialize the index into the table. 18: depts_max := 0; 19: 20: Initialize the table by creating...
Ngày tải lên: 15/12/2013, 05:15
Tài liệu Teach Yourself PL/SQL in 21 Days- P8 pptx
... (SELF IN building, 8: OtherBuilding IN building) 9: RETURN INTEGER 10: ); 11: / 12: CREATE OR REPLACE TYPE BODY building AS 13: MEMBER PROCEDURE ChangeMgr(SELF IN OUT building, 14: NewMgr IN INTEGER) ... in Listing 12.8 in order to insert a few building objects. These will be used in later examples that show how to update object tables and how to link objects in the database. L ISTING 12.8 Inserting ... object- oriented methods in your software development projects. Storing Objects in an Object Table You can insert information about buildings into the object table you just created by using a SQL INSERT statement....
Ngày tải lên: 15/12/2013, 05:15
Bạn có muốn tìm thêm với từ khóa: