2.5. Command Line

When you are typing a SQL statement and need additional text lines, hit Enter/Return. SQL*Plus will look at the very last (nonblank) character. If that character is a semicolon, the SQL statement is processed; otherwise, SQL*Plus assumes you are still typing the text for a single SQL statement and need another line. There is no dash or backslash needed to continue typing a SQL statement onto a next line.

A SQL statement ends with a semicolon. When you end a line with a semicolon, SQL*Plus sends the SQL statement to the database server for processing. The results are sent back and displayed in your SQL*Plus session. If it is an UPDATE statement or the result set of the SELECT statement, these results may include some information as to how many rows were updated. In the following example we see that SQL*Plus acknowledges that one row is updated. This very same information is available within embedded SQL when we use: JDBC, ODBC, Net8, or PL/SQL. In PL/SQL we can reference, following an UPDATE, the implicit cursor attribute SQL%ROWCOUNT to determine which rows were affected. SQL*Plus provides automatic feedback showing the number of rows updated. In the following code, SQL*Plus acknowledges that one row is updated.

					SQL> UPDATE students SET college_major='Biology'
  2  WHERE student_name='John';

1 row updated.
				

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.39.142