From 3c363e125c461d08e9fe4a73ac8c5a3aa741eac6 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 12 Jul 2013 12:14:50 -0400 Subject: - use inline=True for the insert..select here so it works on oracle --- lib/sqlalchemy/sql/expression.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 7cb1326e2..45341bba7 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -6364,6 +6364,17 @@ class Insert(ValuesBase): would normally raise an exception if these column lists don't correspond. + .. note:: + + Depending on backend, it may be necessary for the :class:`.Insert` + statement to be constructed using the ``inline=True`` flag; this + flag will prevent the implicit usage of ``RETURNING`` when the + ``INSERT`` statement is rendered, which isn't supported on a backend + such as Oracle in conjunction with an ``INSERT..SELECT`` combination:: + + sel = select([table1.c.a, table1.c.b]).where(table1.c.c > 5) + ins = table2.insert(inline=True).from_select(['a', 'b'], sel) + .. versionadded:: 0.8.3 """ -- cgit v1.2.1