Share this page

# Example: lrd_ora8_save_last_rowid

In the following example lrd_ora8_save_last_rowid saves the rowid of the new employee record that was inserted. Afterwards this employee record is updated by using the saved rowid.

    /* Recorded script */

    lrd_ora8_stmt(OraStm1, "insert into employees values('77', 60)", ...);

    lrd_ora8_exec(OraSvc1, OraStm1, ...);

    lrd_ora8_stmt(OraStm1,

    "update employees set salary = 70 where rowid = 'AAAHT5AABAAAIXUAAA'",
        ...);

    lrd_ora8_exec(OraSvc1, OraStm1, ...);

    /* Modified script */

    lrd_ora8_stmt(OraStm1, "insert into employees values('77', 60)", ...);

    lrd_ora8_exec(OraSvc1, OraStm1, ...);

    lrd_ora8_save_last_rowid(OraStm1, "last_row_id");

    lrd_ora8_stmt(OraStm1,

    "update employees set salary = 70 where rowid = '{last_row_id}'",
            ...);

    lrd_ora8_exec(OraSvc1, OraStm1, ...);

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: