Next Previous Contents

3. Usage

3.1 Starting KSqlPlus

Before starting KSqlPlus you must be sure for set some Oracle environment. Minimal Oracle environment contains following variables:

If you won't to set special environment for Oracle or you want to use different environment (by example, another NLS_LANG) but you want to use local SQL*Plus, you can connect using "remote" SQL*Plus with 'localhost' as remote host address. See next section about using of remote SQL*Plus.

After starting KSqlPlus from KDE main menu you must fill in Logon dialog fields with your Oracle username, password and (optionally) database name. If you dismiss this dialog at first time then application will be closed - these login parameters are missing for start of SQL*Plus in the batch mode. If you omit database name you will be connected to "default" database - specified by 'ORACLE_SID' or 'LOCAL' environment variables. sqlplus will be started with your login parameters after you accept Logon dialog.

You can connect to another Oracle database or as another Oracle user anytime using 'File|Connect...' menu and filling Logon dialog again.

3.2 KSqlPlus and remote SQL*Plus

KSqlPlus sets Oracle environment by self before calling remote SQL*Plus. This environment, remote host and remote account can be configured in the 'SQL*Plus location' dialog. This dialog can be called using 'Edit|SQL*Plus location...' menu. Also this dialog is being shown everytime if you are choosing 'Remote SQL*Plus' item of the 'Using' list in the Logon dialog.

You must configure remote accout before using this KSqlPlus feature. Refer to the Unix manual pages for further information about RSH and SSH please.

The way of work with remote SQL*Plus is the same as for local one - you send SQL commands, SQL*Plus executes them.

3.3 Executing SQL commands and scripts

KSqlPlus has two main text areas: upper area is used for SQL*Plus output, lower area is used for your input and SQL scripts editing.

Type SQL command in user input area or load SQL script file into it and press Ctrl+Enter or toolbar button "Execute" for sending command to SQL*Plus. Your command will be repeated in output area and SQL*Plus answer will be followed after it.

NOTE: You can change some KSqlPlus accelerator keys using Accelerators dialog ('Edit|Keys...' menu).

You can execute only a part of input area - select some text inside it and press same Ctrl+Enter or same toolbar button "Execute". The marked part of your input will be sent to SQL*Plus as separate command.

You can prepare next SQL command while SQL*Plus executes last one. Be careful - KSqlPlus doesn't control SQL*Plus activity. If you send a command when SQL*Plus is busy, your command will be set to command's queue. It means that you cannot break SQL*Plus current command executing if you send a new one.

You can break current command executing if you press toolbar button "Break" or menu 'Command|Break'. This action kills SQL*Plus process and asks you about restarting SQL*Plus again.

Instead of usage Oracle SQL Worksheet, you must properly end each SQL command (with a semicolon or slash at last line) - it's demand of SQL*Plus.

3.4 Browsing executed SQL commands

KSqlPlus saves a history of your executed SQL commands (there is a limit for size of saved command list). You can return previous command to input area pressing Alt+Left or toolbar button "Back". And you can browse and select the full command's history in Commands history dialog using 'Command|History...' menu.

3.5 Exiting KSqlPlus

You can close application by usual way (from 'File|Close' menu). It sends to SQL*Plus command 'exit'. But if your SQL*Plus is busy (it's executing a long-running command), then your uncommited changes in database will be lost - KSqlPlus kills SQL*Plus by signal in that case. Or you can type SQL*Plus command 'exit' and your changes will be saved by SQL*Plus and KSqlPlus will be closed automatically.


Next Previous Contents