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

Home -> Community -> Usenet -> c.d.o.server -> Re: window solution :-)

Re: window solution :-)

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 22 Feb 2005 05:48:52 -0800
Message-ID: <1109080132.816614.276640@c13g2000cwb.googlegroups.com>


Good try. See comments embedded.

jazzz_ wrote:
> OK, thanks for your help
> I found solution.
>
> here is Windows version:
>
> 1. Make batch file 1.sql which include:
>
> sqlplus @c:\username.sql
>
> 2. Make file username.sql and inside put:
>
> us/pass_at_db

Put connect keyword in the beginning i.e. connect us/pass_at_db

> spool c:\parm1.txt
> set pages 1000
> set pause off
> set feedback off
> set head off

Remove this begin

> begin

Don't need to use this begin because there is no end; specified. You can use straight sql here without enclosing it inside begin end; plsql block.

If you want to use begin end; to spool result to a file then your sql statement must be opened as an cursor and used in conjuntion with dbms_output.put_line()... which would be an overkill for what you are doing. Also begin end; requires "set serverout on" when using dbms_output package.

> select username from all_users where username<>'DEMO' AND
username<>'SYS'
> AND username<>'SYSTEM' AND username<>'SCOTT' AND username<>'DBSNMP';

spool off

> exit;
>
> 3. run 1.sql

Goto http://tahiti.oracle.com and look for sqlplus usage.

Regards
/Rauf Received on Tue Feb 22 2005 - 07:48:52 CST

Original text of this message

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