I am getting the following error message, when I try to save the buffer in SQL plus. SP2-0110: Cannot create save file "myfile.sql"
I created a short cut to my desktop. I tried to to place the new folder name "SQL' in the " Start in" section of the properties tab, but it is grey out.
can anyone advice how to save to a buffer?
I followed the below instructions, but it did not work.
Setting up SQL*Plus on Windows
Despite living in the era of GUI tools such as PL/SQL Developer, there are times when a simple text browser is all you want. Sometimes you may not have access to an IDE, or you just want to mail a simple example to a colleague or web forum, or you may not trust your fancy IDE to give you the actual results without manipulating them in some way, and sometimes you may prefer the text-based Explain Plan results you get from DBMS_XPLAN. Whatever the reason, it is worth knowing your way around SQL*Plus.1 The product is called SQL*Plus, not SQL*PLUS or SQL+.
Two versions of SQL*Plus are provided on the Windows platform. The deprecated GUI version can seem initially more attractive as it has a cheerful white screen, an icon, more buttons, and "File > Spool" and "Options > Environment" options, but it is actually less useful. The directional keys simply scroll up or across the screen, rather than retrieving previous commands or navigating in the current record. You can't change the font or the colours. There is no option to paste copied text with a right-mouseclick. I will therefore pretend that it does not exist, and look at the character mode version.Much as I love Unix (and my Mac), it has to be said that the Windows version of SQL*Plus is better than the Unix one because it is more configurable and comes with command-line history.One strength of the character mode sqlplus.exe is that it simply runs in the Windows command window (cmd.exe). If you have never used sqlplus.exe before but you have configured your cmd window the way you like it, you will find that sqlplus.exe inherits these settings. It also uses a fraction of the system resources (sqlplusw.exe hogs around 12MB as soon as you start it up, while sqlplus.exe is initially listed in Task Manager as Zero KB, only rising to a few kilobytes as you fill the scroll buffer). The following steps essentially describe how to customise cmd windows.
Location for scripts
First, set up a folder for files. By default in Windows, the working folder is the one that contains the executable, in this case the "bin" directory of the Oracle client installation. This is not a good place for your SQL*Plus scripts. Using Windows Explorer, create a folder called something like "SQL" in a convenient location. On some company sites, I have used the private space on the network drive provided, although on others with less reliable networks I have set it up on the C: drive, directly under Oracle. It's up to you, but the important thing is to have a dedicated folder for SQL*Plus stuff. Find the sqlplus.exe executable (not sqlplusw.exe!) in the Oracle bin folder. This is usually something like c:\Oracle\bin, although the default varies by Oracle release, and of course you might have installed the Oracle client yourself (actually quite a good idea if you are allowed to, as the version on corporate desktops is often way out of date - often DBAs upgrade the database but it isn't their job to upgrade the desktop client). Using the right mouse button, drag it to the desktop and select "Create shortcuts here". Change the name of the new shortcut to [the username you will use]@[the instance name you will connect to], for example "william@dev". You may want to leave a space before the "@" to allow the label to wrap. You will now have a blank-looking icon with a helpful label under it.
Set the shortcut properties
Right-click the shortcut and choose Properties.
- Set the username and instance to connect as: in the "Target" field containing the executable path, append a space followed by [username]@[TNS label], for example "william@dev". (You can add more SQL*Plus shortcuts later for other user and instance combinations. We will get one how we like it first, then copy it.) You can also enter a password here, depending on how security-conscious you feel; for example "william/secret@dev".
- Set the default working folder: in the "Start in" field, enter the path to the "SQL" folder you created above, e.g. "c:\oracle\sql".
- (If you have a 10g or earlier client available) Change the icon: give the generic shortcut a proper SQL*Plus icon by using the "Browse" option to navigate to the Oracle bin folder and selecting sqlplusw.exe. (You'll notice this is is an older screenshot than the others on this page. This is because I only have 11g on the machine I'm using to write this article, and 11g does not include sqlplusw.exe. Which is a good thing.)