Bug 46206 - SQL: INSERT accepts only VALUES, not arbitrary SELECT query
Summary: SQL: INSERT accepts only VALUES, not arbitrary SELECT query
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
(earliest affected)
Hardware: All All
: medium normal
Assignee: Lionel Elie Mamane
Whiteboard: target:3.6.0 target:3.5.1
Depends on: 46198
  Show dependency treegraph
Reported: 2012-02-16 20:12 UTC by Lionel Elie Mamane
Modified: 2012-03-24 09:52 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Elie Mamane 2012-02-16 20:12:48 UTC
+++ This bug was initially created as a clone of Bug #46198 +++


I'm familiar with SQL in SQLite and MySQL, but OpenOffice Base seems to be either very crippled, or I don't understand how to execute raw SQL.

I want to do (effectively) this:

INSERT INTO t2 SELECT NULL as id, t.foo, t.bar, '' as baz, 0 as quux 
  FROM MyTable t

All I can do is

SELECT t.foo, t.bar, '' as baz, 0 as quux FROM MyTable t

because the NULL seems to give Base confusion, as does the INSERT INTO T2 SELECT ... syntax.

Can anyone suggest how I need to fix this?
Comment 1 Markus Mohrhard 2012-02-17 01:32:46 UTC
Sorry Lionel, just need this as a test for the bugzilla script.

Will correct it if the script does not fix it.
Comment 2 Not Assigned 2012-02-17 01:33:22 UTC
Lionel Elie Mamane commited a patch related to this issue to "master":


fdo#46206 accept an arbitrary query for INSERT
Comment 3 Markus Mohrhard 2012-02-17 01:34:36 UTC
Sorry for the noise. Fixed now the last error in the script.
Comment 4 Not Assigned 2012-02-21 06:19:13 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":


fdo#46206 accept an arbitrary query for INSERT

It will be available in LibreOffice 3.5.1.
Comment 5 Rainer Bielefeld Retired 2012-03-24 09:52:50 UTC
Fix is in 3.5, 3.6, there will be no 3.4.7, so I closed tis one. Please feel free to reopen if I did wrong.