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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Dumb Q but I need to Know

Re: Dumb Q but I need to Know

From: Frank Hubeny <fhubeny_at_ntsource.com>
Date: Wed, 22 Sep 1999 22:59:47 -0500
Message-ID: <37E9A5B3.E2D561A7@ntsource.com>


Perhaps the problem is that you have missed the "into" part of the query.

As an example the following procedure compiles and executes and illustrates use of "into":

SQL> declare
  2 v_row dual%rowtype;
  3 begin

  4     select * into v_row from dual;
  5     dbms_output.put_line(v_row.dummy);
  6 end;
  7 /
X

PL/SQL procedure successfully completed.

Alternatively, this could be written:

SQL> declare

  2     cursor c is
  3     select * from dual;
  4     v_row c%rowtype;
  5  begin
  6     open c;
  7     fetch c into v_row;
  8     close c;
  9     dbms_output.put_line(v_row.dummy);
 10 end;
 11 /
X

PL/SQL procedure successfully completed.

Frank Hubeny

IIFThen wrote:

> I'm trying to write a simple select query within an Oracle stored procedure
> using the following syntax:
>
> select * from <tablename> where <condition statement>
>
> It's compiling with errors. How do I rectify this for Oracle SP. I guess
> I've been with MS SQL Server SP way of doing things. Can anyone out there
> help me out. Thank you.
> --
> IIFThen
Received on Wed Sep 22 1999 - 22:59:47 CDT

Original text of this message

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