另外 RowID 是稳定的吗?比如说我几次检索 同样的行 会 对应同样的RowID本人初学 oracle 望各位高手帮忙

解决方案 »

  1.   

    rowid 是数据行存放的物理地址
    如果对数据重新整理后,可能会改变比如说我几次检索 同样的行 会 对应同样的RowID,这是没问题的SQL> declare
      2  v_out varchar2(20);
      3  begin
      4   insert into t values(1,1) return rowid into v_out;
      5   dbms_output.put_line(v_out);
      6  end;
      7  /
    AAAGHLAABAAAIV0AADPL/SQL 过程已成功完成。已用时间:  00: 00: 00.70
    SQL> select rowid,t.* from t;ROWID                     AAA        BBB
    ------------------ ---------- ----------
    AAAGHLAABAAAIV0AAA          1          2
    AAAGHLAABAAAIV0AAB          3          4
    AAAGHLAABAAAIV0AAC          5          6
    AAAGHLAABAAAIV0AAD          1          1已用时间:  00: 00: 00.50
    SQL> 
      

  2.   

    SQL> create table test(c integer);表已创建。
    SQL> set serveroutput on size 100000
    SQL> declare 
      2  c varchar2(200);
      3  begin
      4  insert into test values(3) return rowid into c;
      5  dbms_output.put_line('rowid='||c);
      6  end;
      7  /
    rowid=AAAA+eAAPAAAAAKAACPL/SQL 过程已成功完成。rowid是指数据保存在数据文件的具体物理位置,如果没有移动数据,就一直固定,多次查询不会改变rowid的值的。
      

  3.   

    to  njhart2003()  bzszp(SongZip)两位 高手,如何得到新增加行的 rowID 呢?我新增加了一条数据,在另一界面 需要 迅速显示这条数据,我想用RowID作为参数
    可是我没办法得到新增加的行的 RowID环境 ado2.5 oracle9i
      

  4.   

    已经返回新插入行的rowid了嘛,再举个应用的例子
    SQL> variable c varchar2(20)
    SQL> insert into test values(3) return rowid into :c;已创建 1 行。SQL> print :cC
    --------------------------------
    AAAA+eAAPAAAAAKAAD
    SQL> select * from test where rowid='AAAA+eAAPAAAAAKAAD';         C
    ----------
             3已选择 1 行。SQL> select * from test where rowid=:c;         C
    ----------
             3已选择 1 行。
    -------------------------------------------------------
    楼主把你的应用说的再详细点吧.
      

  5.   

    用 ado的recordset对象 addnew  一行 update后 如何得到rowsid 
    例如:vb代码dim trs as new adodb.recorset
    trs.open "select table1.f1,table1.rowid from table1",连接,游标,锁
    trs.addnew
    trs("f1")="xxxx"
    trs.updatedebug.print trs("rowid")
    此时如何得不到rowid
      

  6.   

    debug.print trs("table1.rowid")试试...
      

  7.   

    to njhart2003() 
    debug.print trs("table1.rowid")
    该字段不存在
      

  8.   

    to erpang5021(二胖) 事务提交后,还是没办法得到!!!