relative is a method of the SapDB_ResultSet class (sdb.sql module). You can use this method to position the cursor on a data record relative to the current one in the result set.
Syntax
relative (offset)
Attribute |
Description |
---|---|
offset |
Number of data records that the cursor should be moved back or forward, relative to the current position offset > 0: You move the cursor forward in the result set offset < 0: You move the cursor backward in the result set |
Data record at the specified position in the result set
If the result set is empty or if offset is greater than the number of data records after or before the current cursor position: None
You move the cursor 5 data records forward:
Syntax
row = cursor.relative (5)
You move the cursor 1 data record backward:
Syntax
row = cursor.relative (-1)
This expression is equivalent to
Syntax
row = cursor.previous ()
Example: Executing an SQL Statement and Navigating in the Result Set