SQL.FetchPos
------------

Fetches a row from a result set.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SQL](component_SQL.md) | [5.1](newinversion51.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "SQL.FetchPos"; Command; Offset { ; Relative } ) 

**MBS**( **"SQL.FetchPos";** /\* Fetches a row from a result set. \*/  
**$Command**; /\* The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). \*/   
**$Offset**; /\* The index/offset of the row. Zero based.e.g. 1 \*/   
**$Relative**) /\* Optional; Pass 1 for relative movement.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Command | The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). | $Command |  |
| Offset | The index/offset of the row. Zero based. | 1 |  |
| Relative | Pass 1 for relative movement. | 0 | Optional |

### Result

Returns 0, 1 or error message.

### Description

Fetches a row from a result set.  
You may need to request recordset to be scrollable to have this work. For that, please call MBS( "[SQL.SetCommandOption](SQLSetCommandOption.md)"; $Command; "Scrollable"; "True" ) before doing the query.  
  
Result is 1 on success or 0 on failure.   
### See also

- [SQL.FetchLast](SQLFetchLast.md)
- [SQL.FetchPrior](SQLFetchPrior.md)
- [SQL.NewCommand](SQLNewCommand.md)
- [SQL.SetCommandOption](SQLSetCommandOption.md)

This function is free to use.

Created 6th May 2015 , last changed 24th April 2016

  
[SQL.FetchNext](SQLFetchNext.md) - [SQL.FetchPrior](SQLFetchPrior.md)

[HTML Version](SQLFetchPos.shtml)