Execute a Parameterized SQL Statement ===================================== Execute a parameterized SQL statement that takes arguments. The location of a parameter in the SQL is indicated by a " ~V " (i.e. a blank, followed by a tilde, followed by an uppercase V, and finally another blank): .. CODE:: INSERT INTO foo (name,ordernr,weight) VALUES ( ~V , ~V , ~V ) DELETE FROM foo WHERE ordernr = ~V See `Queries and Parameters `_ in the *OpenAPI User Guide* for more information. Also see :ref:`data-buffer-example`. .. NOTE:: There are two forms of parameterized SQL. The other form, not shown here, is used with the PREPARE statement and uses a question-mark for its parameter marker. .. 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_parameters` must be set :attr:`True`. Failing to set it will cause :attr:`!IIAPI_ST_FAILURE` and :attr:`!E_AP0006 API function cannot be called in the current state` when the application attempts to start sending arguments by calling :func:`!IIapi_setDescriptor`. :download:`Download <./examples/exec-parm-sql.py>` .. LITERALINCLUDE:: ./examples/exec-parm-sql.py :linenos: :download:`Download <./examples/exec-parm-sql.py>`