Rlwrap, the second

April 1, 2010 at 2:52 pm | Posted in Oracle Developement, Oracle Tools | Leave a comment

The next handy thing I learned from Tanel was the use of the autocompletion feature in rlwrap. Now, this is nowhere near as sophisticated as the code completion features found in PL/SQL Developer, SQL Developer, or any of the other sophisticated GUI tools. However, it can help when you just don’t remember quite the exact object name that you want to use.

For rlwrap to have auto-completion, you need to have a textfile with the keywords. By default, rlwrap installs some basic files in the /usr/share/rlwrap directory. One file, for example, contains FTP commands.

To have auto-completion with Oracle reserved words, table, program names, etc., you’ll have to create a text file yourself. Tanel, once  again, has made a handy script available for this in his script library. You can easily generate such a keyword file yourself by spooling the output on queries against v$reserved_words, dict, dba_objects, dba_procedures, etc.

Once you have such a file, reference it in your rlwrapped call to sqlplus:

rlwrap -if my_keyword_file.txt sqlplus

Use the -i switch to for case insensitivity.

Of course you can now use this feature with the setup I’ve suggested earlier.


Leave a Comment »

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Entries and comments feeds.

%d bloggers like this: