> For the complete documentation index, see [llms.txt](https://docs.monokot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.monokot.io/scripts/api/mosodbcreader.md).

# MosOdbcReader

MosOdbcReader is an object used for navigation through the resulting data set returned by a query to the database.

### Methods

| **Name**                   | **Description**                                                                                                                                                 |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| close()                    | Closes the connection with the database and frees all allocated resources. **The function must necessarily be called after each call of** *MosOdbc.openReader*. |
| read()                     | Moves the object to the next record of the data set. The function returns *True* if the data set has a next record, otherwise returns *False*.                  |
| getValueByIndex(index)     | Returns the value of the column specified by the numeric argument *index*. *Index* specifies the column sequence number.                                        |
| getValueByName(columnName) | Returns the value of the column specified by the string argument *columnName*. *ColumnName* specifies the column name from the returned query.                  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monokot.io/scripts/api/mosodbcreader.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
