Oracle SQL Script
Oracle SQL script is a powerful tool for database program development and efficient deployment. It is the best and the most efficient skill for database professionals to maintain consistent versions for database and software development. It is a necessary tool for database administration professionals. From this point on in this course, every project will require you to submit a SQL script that will accomplish the assigned tasks. Here is the ways that will help you work with SQL script. You may login Oracle SQL Plus, for example, as SCOTT/tiger. After you login, you may query a table, for example, "emp" table by entering the following SQL command: SQL> SELECT empno, ename FROM emp; The above SQL command is temporarily stored in SQL Plus buffer after execution. You may save your SQL commands into a script file and retrieve/use it later. If you like to save your commands in SQL Plus buffer and reuse it later, you may issue the following command: SQL>SAVE d:\tec5363\ exmaple.sql You may save your file in different directory other than d:\tec5363 directory. However, you will need to create the directory before you use it. The default file extension is sql if you do not specify it. It is a good idea to specify the SQL file extension. If the file already exists and you want to replace the file, you may use: SQL>SAVE d:\tec5363\ exmaple.sql REPLACE If you like to retrieve your saved SQL script file into your SQL Plus buffer, use the following command: SQL>GET d:\tec5363\example1.sql After the file is retrieved into the SQL Plus buffer, you may execute your script by typing "/" and enter: SQL> / Another way to use the script is to use the following command: SQL>@d:\tec5363\example1.sql In this way, you will be able to execute all the actions with one command and run them consistently over time or over different computers. This is the way all your projects will be graded by the instructor for this course. |