You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
oracledb>`__ module. See :ref:`SQL Execution <sqlexecution>` for examples.
680
681
681
682
The statement to be executed may contain :ref:`IN binds <inbind>`,
682
683
:ref:`OUT or IN OUT <outbind>` bind values or variables, which are bound
@@ -699,10 +700,18 @@ Connection Methods
699
700
- Data Type
700
701
- Description
701
702
* - ``sql``
702
-
- String
703
+
- String or Object
703
704
- .. _executesqlparam:
704
705
705
-
The SQL statement that is executed. The statement may contain bind parameters.
706
+
This function parameter can either be a string or an object.
707
+
708
+
If the parameter is a string, then it is the SQL statement that is executed. The statement may contain bind parameters.
709
+
710
+
If the parameter is an object, then it is the object that is returned from the ``sql`` function of the third-party `sql-template-tag <https://www.npmjs.com/package/sql-template-tag#oracledb>`__ module. This object exposes the SQL statement and values properties to retrieve the SQL string and bind values. See :ref:`example <executeobj>`. If the object returned by the ``sql`` function contains a SQL statement with a ``RETURNING INTO`` clause, then :meth:`connection.execute()` will not work and an error will be thrown.
711
+
712
+
.. versionchanged:: 6.4
713
+
714
+
The ability to accept an object (returned from the ``sql`` function of the third-party ``sql-template-tag`` module) as an input parameter was added to :meth:`connection.execute()`.
0 commit comments