Re: sqlplus: chr(10) in sqlprompt?

From: Albert Godfrind <albert.godfrind_at_oracle.com>
Date: Tue, 14 Jun 2005 19:16:08 +0200
Message-ID: <RwEre.22$Sr4.134_at_news.oracle.com>


 > Thanks again. If you (or anyone) comes up with a way to set SQLPROMPT  > without first connecting to a database I'd still be interested.

You can set the prompt without calling SQLPLUS and without being connected to a database by including the 'set sqlprompt' command in the glogin.sql file, which gets executed every time you start sqlplus.

The file is in $ORACLE_HOME/sqlplus/admin.

For example, I have just included the following in my glogin.sql

set sqlprompt '<DONE>'

I did not try to include a newline. Maybe using a hex editor ?

This is a global setting - affects anyone running sqlplus from that oracle home. You can also have your own setting in a login.sql file. SQLPLUS looks for one in your current directoru first, then in the location pointed by SQLPATH. This allows to customize the prompt for different users of programs.

Albert

Chuck wrote:
> Michel Cadot wrote:
>

>>"Chuck" <skilover_nospam_at_softhome.net> a écrit dans le message de
>>news:1118688897.e3945db861e2a6a41fb703f1c475cc3f_at_bubbanews...
>>| Is there a way to set the sqlprompt to something like '<DONE>'||chr(10)?
>>|
>>| I want to write a korn shell script that runs sqlplus as a coprocess and
>>|  use something like <DONE> as a code to indicate that query output is
>>| finished and it's waiting for another command. Problem is the sqlprompt
>>| variable doesn't seem to let me put a newline at the end so I can read
>>| it as a complete line from the coprocesses.
>>|
>>| Thanks.
>>| -- 
>>| To reply by email remove "_nospam"
>>
>>I don't check but this might work:
>>
>>col myprompt noprint new_value myprompt
>>select '<DONE>'||chr(10) myprompt from dual;
>>set sqlprompt '&myprompt'
>>
>>Regards
>>Michel Cadot
>>
>>

>
>
> Thanks. It works. I had thought of that myself but was hoping I could
> find something that would work without having to first be connected to
> the Database.
>
> I think what I'm going to end up doing is something a little different.
> Instead of looking for the SQLPROMPT, I'm going to issue a PROMPT <DONE>
> after every SQL I execute and just check for that.
>
> Thanks again. If you (or anyone) comes up with a way to set SQLPROMPT
> without first connecting to a database I'd still be interested.
>
Received on Tue Jun 14 2005 - 19:16:08 CEST

Original text of this message