Packaging Your Script
For most scripts you write, you will be satisfied just invoking them from the SQL*Plus prompt. Sooner or later, however, you are going to write a script that you want to share with an end user who may not be familiar with SQL*Plus, or you may end up implementing a complex batch process as a SQL*Plus script. In either of these cases you may find it convenient to create a command or icon that can easily be used to execute the script in question. In the Microsoft Windows environment, for example, you could easily create an icon on which an end user could double-click in order to produce a report or extract data.
Creating a Windows Shortcut
There are two decisions you need to make if you are going to create an icon or shortcut to execute a script. One is whether to embed the Oracle username and password into the shortcut or to prompt the user for this information. The second is to decide which version of SQL*Plus you want to use — the GUI version or the DOS version.
Both of these decisions affect the command used by the shortcut to invoke SQL*Plus and start the script. Your job is easiest if you can embed the Oracle username and password, or at least the username, into the shortcut. If you need to prompt for both username and password at runtime, then you will need to make some minor additions to your script.
For purposes of example, let’s assume you are going to create a Windows shortcut to run the Project Hours and Dollars Report shown earlier in this chapter. ...