Re: rowid ?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 28 Jul 2004 06:53:50 -0700
Message-ID: <2687bb95.0407280553.505be254_at_posting.google.com>


captain_2010_at_yahoo.com (captain) wrote in message news:<27aae5ab.0407272342.408a752a_at_posting.google.com>...
> hi,
>
> Want to count rowid. One row by one row
> and on each do a calculation and than go to next or previous row.
>
> In oracle it is Rowid, wonder how to do in SAS for going by row.
> e.g. in Oracle
> Select * from table1 where rowid > rowid+1
>
>
> Captain2010

I think what you want is an explicit cursor written in pl/sql. See the PL/SQL manaul.

declare
cursor c_example is select * from my_table; begin
open c_example;
loop
  fetch c_example into variable_list....   exit when c_example%notfound;

  • logic to do something here end loop; close c_example; end;

Also look up Cursor For loops to have Oracle perform the open, fetch, and close automatically rather than explicitly.

HTH -- Mark D Powell -- Received on Wed Jul 28 2004 - 15:53:50 CEST

Original text of this message