Execute a SELECT Statement Returning Row(s) =========================================== Execute a SELECT statement that takes no parameters and returns one or more rows. .. CODE:: none SELECT name, weight FROM foo WHERE ordernr = 71025 .. NOTE:: ``asyncio`` is used in this example but it is not essential. To use busy-wait loops instead, see :ref:`asynchronous-functions`. .. IMPORTANT:: :attr:`!qy_queryType` must be set to :attr:`py.IIAPI_QT_QUERY` to indicate which protocol the OpenAPI must expect. .. IMPORTANT:: The OpenAPI allocates an array of :attr:`!IIAPI_DESCRIPTOR` for the query results. It is released when the application executes :func:`!IIapi_close`. Copy any required descriptor information before doing so. .. WARNING:: Failing to call :func:`!IIapi_close` will create a memory leak. :download:`Download <./examples/exec-select.py>` .. LITERALINCLUDE:: ./examples/exec-select.py :linenos: :download:`Download <./examples/exec-select.py>`