Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> DBMS_SQL.LAST_ROW_ID doesn't work
Hi!
I work on Oracle8 Enterprise Edition Release 8.0.5.0.0 under Solaris 2.6.
I attempt to get ROWID of last fetched row, but DBMS_SQL.LAST_ROW_ID always returns
AAAAA7AABAAAAIvAAF
or
AAAAAAAAAAAAAAAAAA
These ROWIDs do not belong to table my program works with. (I guess they do not belong to anything :-) ).
Did anybody encounter this problem?
Here is my table and example:
SQL> desc test5;
Name Null? Type ------------------------------- -------- ---- C CHAR(5) C2 VARCHAR2(5) D DATE
$ cat show5.sql
create or replace procedure show5 is
cursor_name pls_integer;
ignore pls_integer; stmnt varchar2(1000); row_id rowid; c_val char(5); c2_val varchar2(5); d_val date;
BEGIN
......................................
stmnt:='SELECT * FROM TEST5';
cursor_name := dbms_sql.open_cursor;
dbms_sql.parse(cursor_name, stmnt, dbms_sql.native);
dbms_sql.define_column(cursor_name, 1, c_val, 5); dbms_sql.define_column(cursor_name, 2, c2_val, 5); dbms_sql.define_column(cursor_name, 3, d_val); ignore := dbms_sql.execute(cursor_name);
loop
exit when (dbms_sql.fetch_rows(cursor_name) <= 0);
row_id:=dbms_sql.last_row_id;
dbms_sql.column_value(cursor_name, 1, c_val); dbms_sql.column_value(cursor_name, 2, c2_val); dbms_sql.column_value(cursor_name, 3, d_val);
......................................
end loop;
dbms_sql.close_cursor(cursor_name);
END;
/
sho err
$
Klim.
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Feb 02 2000 - 06:04:36 CST