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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: simple sqlplus question

Re: simple sqlplus question

From: Jared Still <jkstill_at_gmail.com>
Date: Mon, 11 Apr 2005 09:37:39 -0700
Message-ID: <bf4638050411093734a291c7@mail.gmail.com>


Here is one way to do it:
Here is one way to do it:

set head off;
set echo off;
set verify off;

col schema_name new_value schema_name noprint prompt Enter Schema Name:
set feed off term off
select '&1' schema_name from dual;
set feed on term on

spool t1_out

select cust_id
from &&schema_name..customers
where cust_id=1;

spool off
undef schema_name

Jared

On 4/11/05, Guang Mei <GMei_at_ph.com> wrote:
>
> Thanks for all the replies. But I still got
>
> Enter value for schema_name: dev72upd
>
> 1
>
> How could I get rid off the line "Enter value for schema_name: dev72upd"
> also in the spooled file?
>
> Guang
>
> -----Original Message-----
> From: Knight, Jon [mailto:jknight_at_concordefs.com]
> Sent: Monday, April 11, 2005 11:48 AM
> To: 'GMei_at_ph.com'; Oracle-L (E-mail)
> Subject: RE: simple sqlplus question
>
> set verify off
>
> Thanks,
> Jon Knight
>
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org]
> On Behalf Of Guang Mei
> Sent: Monday, April 11, 2005 10:42 AM
> To: Oracle-L (E-mail)
> Subject: simple sqlplus question
>
> --sql script t1.sql
>
> set hea off;
> set echo off;
>
> spool t1_out
>
> select rid
> from &&schema_name..customers
> where rid=1;
>
> spool off
>
> ----------
>
> And when I ran the above script, I got in my spooled file:
>
> Enter value for schema_name: dev72upd
> old 2: from &&schema_name..customers
> new 2: from dev72upd.customers
>
> 1
>
> Which sqlplus command should I use in my t1.sql so that I only see "1"
> (the
> last line) in my spooled file?
>
> TIA.
>
> Guang
>
> *************************************************************************
> PRIVILEGED AND CONFIDENTIAL:
> This communication, including attachments, is for the exclusive use of
> addressee and may contain proprietary, confidential and/or privileged
> information. If you are not the intended recipient, any use, copying,
> disclosure, dissemination or distribution is strictly prohibited. If you
> are not the intended recipient, please notify the sender immediately by
> return e-mail, delete this communication and destroy all copies.
> *************************************************************************
> --
> http://www.freelists.org/webpage/oracle-l
> --
> http://www.freelists.org/webpage/oracle-l
>
> *************************************************************************
> PRIVILEGED AND CONFIDENTIAL:
> This communication, including attachments, is for the exclusive use of
> addressee and may contain proprietary, confidential and/or privileged
> information. If you are not the intended recipient, any use, copying,
> disclosure, dissemination or distribution is strictly prohibited. If you
> are not the intended recipient, please notify the sender immediately by
> return e-mail, delete this communication and destroy all copies.
> *************************************************************************
> --
> http://www.freelists.org/webpage/oracle-l
>

-- 
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Apr 11 2005 - 12:41:44 CDT

Original text of this message

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