470,833 Members | 1,389 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

rowid ?

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
Jul 19 '05 #1
2 11096
ca**********@yahoo.com (captain) wrote in message news:<27**************************@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 --
Jul 19 '05 #2
ca**********@yahoo.com (captain) wrote in message news:<27**************************@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


NOTE: comp.databases.oracle is obsolete. this topic is appropriate for
comp.databases.oracle.misc which I cross posted to with this reply.

Which do you want an answer for, ORACLE or SAS? These are two very
different systems.

If you want to count rows in an ORACLE system, use the SQL command:
SELECT COUNT(*) FROM table1 ;

HTH,
ed
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by droope | last post: by
2 posts views Thread by Scott Holland | last post: by
3 posts views Thread by TP | last post: by
reply views Thread by UJ | last post: by
2 posts views Thread by arivudai2 | last post: by
2 posts views Thread by captain | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.