Bug 46206

Summary: SQL: INSERT accepts only VALUES, not arbitrary SELECT query
Product: LibreOffice Reporter: Lionel Elie Mamane <lionel>
Component: BaseAssignee: Lionel Elie Mamane <lionel>
Status: RESOLVED FIXED    
Severity: normal CC: jmsachs, LibreOffice, lionel
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard: target:3.6.0 target:3.5.1
Crash report or crash signature: Regression By:
Bug Depends on: 46198    
Bug Blocks:    

Description Lionel Elie Mamane 2012-02-16 20:12:48 UTC
+++ This bug was initially created as a clone of Bug #46198 +++

http://stackoverflow.com/questions/4770466/sql-dialect-in-openoffice-base/9315951#9315951

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":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=00e26baaf5cca36a7e78036aa5694196ccbf7402

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":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=02dc763291630f7cb4cd9342e8937f3abb92dbc2&g=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.