Re: Stored procedure with NOT PL/SQL

From: P. Larsen <plarsen_at_dc.dynares.com>
Date: Wed, 25 Nov 1998 08:13:24 -0500
Message-ID: <73h0ie$7ng9_at_news.uscg.mil>


Hi Frank,
Please refer to the manuals of Oracle. It seems that you are a beginner and are still graping som concepts. Understandable, coming from another platform though :)

To do a select ad-hoc do the following:
1. Start sqlplus (f.eks. type plus80w on the command line if you're running windows (NT or 9x).
2. Enter a valid username/password combination 3. Type your select like this:
SELECT * FROM <tablename>;

If you only want particular columns, type the column names where the * is seperated by commas.
A stored procedure IS NOT NEEDED to do SQL. PL/SQL is build on top of SQL - not in stead of. Using stored procedures, all output is given to your programming interface. Using SQLplus all output is printed by default (can be overwritten though).

I suspect that you have your CREATE PROCEDURE .... infront your statement. That might be necessary in SQLServer - but is total unnecessary in Oracle (and invalid as you have found out). The BEGIN/END is not what makes a stored procedure - but what makes PL/SQL.

Try to read the concepts and programmers guide to Oracle to learn more about how to access data in an Oracle database.

  • Peter Larsen Senior Oracle Consultant

Frank Meng wrote in message <365AC5C8.D9E8168_at_usa.net>...
> I want to create a stored procedure for
>SELECT * from MYTABLE
>When I use BEGIN & END command, Oracle asked me using INTO.
>I don't want to INTO some table, but only display it on the screen.
>When I don't use BEGIN & END with SQL Plus 8.0, I got the message:
>-------------------------------------
>PLS-00103: Encountered the symbol "SELECT" when expecting one of
>the following:
>begin function package pragma procedure subtype type use ...
>-------------------------------------
>Someone told me I must use a cursor to select only one record each time
>and
>use INTO.
>I can't believe it, because I can do it very easily with Microsoft SQL
>Server.
>Please tell me what is wrong to frankmeng_at_usa.net
>Thanks in advance.
>Frank
>
Received on Wed Nov 25 1998 - 14:13:24 CET

Original text of this message