Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Output in SQL Worksheet or SQLPlus
You are confusing SQL and PL/SQL. The latter is only used for procedural
stuff, not for normal selects. You should get rid of SQL-server habits. You
should have issued that select outside a PL/SQL block and it would have
worked without problem.
Any ordinary SQL just gets to the standard output always. If you want to
capture the output, use spool <file> followed later on by spool off, if you
want to save your script use save.
For output in PL/SQL use dbms_output.put_line(<expression>). However keep in
mind stored procedures are not the default.
Hth,
Sybrand Bakker, Oracle DBA
Tom Williamson <tomw_at_action.cnchost.com> wrote in message
news:Edjv3.9335$3%1.2176_at_news.rdc1.az.home.com...
> Please pardon this newbie question, but what's the best way to display
> output in SQL Worksheet or SQL Plus, when using PL/SQL?
>
> In MS-SQL Server it would be simple - either simply SELECT * FROM TABLE or
> else PRINT the values you want.
>
> In Oracle, SELECT X FROM TABLENAME results in an error stating "an INTO
> clause is expected", and there doesn't seem to be a PRINT or ECHO
statement
> anywhere (at least I can't find it.) What's everyone's favorite way of
> doing this (getting output onto the screen)?
>
> Thanks - Tom
>
>
>
>
>
>
Received on Fri Aug 20 1999 - 16:13:31 CDT