Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Fixing a little problem in the login.sql script found in Tom Kyte's book

Re: Fixing a little problem in the login.sql script found in Tom Kyte's book

From: Ban Spam <ban-spam_at_operamail.com>
Date: Wed, 15 Jan 2003 02:55:05 GMT
Message-ID: <Xns9303C0B69D099SunnySD@68.6.19.6>


"FC" <flavio_at_tin.it> wrote in news:10VU9.28651$0v.828646_at_news1.tin.it:

> Hello folks,
> while playing around with the login.sql script found in the excellent
> book of Tom Kyte, "Oracle one-on-one".
> I managed to fix its behaviour if you happen to start SQL*Plus with
> the
> /NOLOG switch.
>
> I don't know if anyone else ever had a similar problem, I searched
> Tom's site but I couldn't find anything, there are only versions of
> the script modified to display various prompts.
>
> Tested on Oracle EE 8.1.7.0.0 is running on Win2000.
>
> The original script is as follows (or with a slightly different decode
> clause):
> --------------------------------------
> ...
> column global_name new_value gname
> set termout off
> select lower(user) || '@' || decode(global_name, 'ORACLE8.WORLD',
> '8.0',
>
> 'ORA8I.WORLD', '8i',
>
> 'ORA8IDEV.WORLD', 'dev8i',
>
> global_name) global_name
> from global_name;
> set termout on
> set sqlprompt '&gname> '
> ...
> -------------------------------------
>
> The "improved" version is:
>
> ...
> set termout off
> # begin workaround
> define gname = disconnected
> column global_name new_value gname
> whenever sqlerror continue none
> # end workaround
> select lower(user) || '@' || decode(global_name, 'ORACLE8.WORLD',
> '8.0', 'ORA8I.WORLD', '8i',
> 'ORA8IDEV.WORLD', 'dev8i',
> global_name) global_name
> from global_name;
> set termout on
> set sqlprompt '&gname> '
> ...
>
> When you start SQL*Plus with /NOLOG, the original script hangs until
> you press CTRL-C because there is no connection to the DB and the
> SELECT statement fails.

Can't say that I've tried the actual code, even tho I do have the book & found it to be a GREAT resource, but have you ever tried to just hit the "Enter" key after entering SQL*Plus? For me I the ">" becomes the prompt string. I would not go as far as claiming the script is "broken".

HTH & YMMV HAND! Received on Tue Jan 14 2003 - 20:55:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US