[libreoffice-users] Re: SQL-Query Syntax in LO-3.6-Base

2013-07-29 Thread Alexander Thurgood
Le 29/07/13 10:00, Heinrich Stoellinger a écrit :

Hi Heinrich,

> Using the German UI, I don't have a "Tools" menu item. I suspect it is
> called
> "Extras" in my version. Clicking on "SQL" under THAT menu I can enter the
> SQL statement alright. As mentioned before, this statement is
> 

Yes, that's right, sorry, I don't switch my UI to German very often.


> insert into anwesenheit
>  (select 999,a2.persNr,anwesend,statAnw,abwGrund,a2.mitfahrer,bemerkung
>   from anwesenheit a2
>   where a2.veranstNr = 796);
> (also tried without the ";")
> On execution I still get back the same error!

Unfortunately, not all statements that you can run from the command line
in MySQL's SQL dialect will work, even via the Tools/Extras - SQL menu
entry.

You should try and make your SQL statement more standards SQL compliant,
the baseline for LO being ANSI SQL 1999, I think (but don't quote me on it).

Ultimately, you will probably have to try and reformulate your statement
in a way that LO understands, however, this may, or may not actually be
possible, at least not in the way in you want.

> As a long-time systems "nurd" I myself don't mind entering the statement
> from a mysql-client command-line. It is just that handing the
> administration
> of the database over to "normal" people, I cannot expect them to use a text
> editor to define the query that way and then run it through the mysql
> client.

Agreed, but I'm afraid that LO still lacks the desired feature set for that.


> SQL queries should be able to cover statements as the one above. I use it
> to keep a table up-to-date which shows the presence of musicians in my band
> at practices every week or concerts...
> phpMyAdmin isn't really an alternative either...

Agreed. Currently, the best way to achieve what you are looking for, if
a SQL INSERT SELECT statement is not accepted, is to use Basic, or
another programming language that interfaces with LO to produce what you
want and the use form elements to associate that with the execution of
the script.


Alex



-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: SQL-Query Syntax in LO-3.6-Base

2013-07-29 Thread Heinrich Stoellinger

Hi Alex,
Using the German UI, I don't have a "Tools" menu item. I suspect it is called
"Extras" in my version. Clicking on "SQL" under THAT menu I can enter the
SQL statement alright. As mentioned before, this statement is

insert into anwesenheit
 (select 999,a2.persNr,anwesend,statAnw,abwGrund,a2.mitfahrer,bemerkung
  from anwesenheit a2
  where a2.veranstNr = 796);
(also tried without the ";")
On execution I still get back the same error!
As a long-time systems "nurd" I myself don't mind entering the statement
from a mysql-client command-line. It is just that handing the administration
of the database over to "normal" people, I cannot expect them to use a text
editor to define the query that way and then run it through the mysql client.
SQL queries should be able to cover statements as the one above. I use it
to keep a table up-to-date which shows the presence of musicians in my band
at practices every week or concerts...
phpMyAdmin isn't really an alternative either...
Thanks for your help in any case
Regards
H

On Sun, 28 Jul 2013 20:08:52 +0200, Alexander Thurgood 
 wrote:


Le 28/07/13 17:03, Heinrich Stoellinger a écrit :

Hi Heinrich,



I never tried it previously. How do I set the internal SQL parser "off"?
Regards


Sorry, I'm being a bit dim. INSERT statements can only be run from the
Tools > SQL menu entry and not from the SQL Query window (or Designer
for that matter).


Alex






--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Re: SQL-Query Syntax in LO-3.6-Base

2013-07-28 Thread Alexander Thurgood
Le 28/07/13 17:03, Heinrich Stoellinger a écrit :

Hi Heinrich,


> I never tried it previously. How do I set the internal SQL parser "off"?
> Regards

Sorry, I'm being a bit dim. INSERT statements can only be run from the
Tools > SQL menu entry and not from the SQL Query window (or Designer
for that matter).


Alex



-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: SQL-Query Syntax in LO-3.6-Base

2013-07-28 Thread Heinrich Stoellinger

On Sun, 28 Jul 2013 12:28:52 +0200, Alex Thurgood  
wrote:


Le 26/07/2013 00:15, Heinrich Stoellinger a écrit :

Hi Heinrich,


This query (ommitting the "") has been working perfectly for years when
issued from the mysql
command-line client. It is correct SQL syntax...


Are you attempting to run it in LO with the internal SQL parser on or
off ? My guess is that it would only run with the internal SQL parser
off, and the error message you get seems to imply that, as it is the
most freqent when using expressions that the parser doesn't understand.

Did it work in any previous version of LO ?


Alex





Hi Alex,
I never tried it previously. How do I set the internal SQL parser "off"?
Regards
H

--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Re: SQL-Query Syntax in LO-3.6-Base

2013-07-28 Thread Alex Thurgood

Le 26/07/2013 00:15, Heinrich Stoellinger a écrit :

Hi Heinrich,


This query (ommitting the "") has been working perfectly for years when
issued from the mysql
command-line client. It is correct SQL syntax...


Are you attempting to run it in LO with the internal SQL parser on or 
off ? My guess is that it would only run with the internal SQL parser 
off, and the error message you get seems to imply that, as it is the 
most freqent when using expressions that the parser doesn't understand.


Did it work in any previous version of LO ?


Alex




--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: SQL-Query Syntax in LO-3.6-Base

2013-07-25 Thread Heinrich Stoellinger

I am using MySQL...

On Thu, 25 Jul 2013 20:37:40 +0200, Alexander Thurgood 
 wrote:


Le 25/07/13 18:54, Heinrich Stoellinger a écrit :

Hi Heinrich,


What's wrong with my query?


Which db engine are you using ?

Alex






--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: SQL-Query Syntax in LO-3.6-Base

2013-07-25 Thread Heinrich Stoellinger

Hi Alex,
This query (ommitting the "") has been working perfectly for years when issued 
from the mysql
command-line client. It is correct SQL syntax...
Regards
H

On Thu, 25 Jul 2013 20:45:24 +0200, Alexander Thurgood 
 wrote:


Le 25/07/13 18:54, Heinrich Stoellinger a écrit :


Hi Heinrich,



insert into "anwesenheit" "a1"
 (select
795,"a2"."persNr","a2"."anwesend","a2"."statAnw","a2"."abwGrund","a2"."mitfahrer","a2"."bemerkung"

  from "anwesenheit" "a2"
  where "a2"."veranstNr" = 796)



http://www.hsqldb.org/doc/guide/ch09.html#insert-section

Don't you need to tell your db that you have VALUES to insert ?


Alex







--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Re: SQL-Query Syntax in LO-3.6-Base

2013-07-25 Thread Alexander Thurgood
Le 25/07/13 18:54, Heinrich Stoellinger a écrit :


Hi Heinrich,


> insert into "anwesenheit" "a1"
>  (select
> 795,"a2"."persNr","a2"."anwesend","a2"."statAnw","a2"."abwGrund","a2"."mitfahrer","a2"."bemerkung"
> 
>   from "anwesenheit" "a2"
>   where "a2"."veranstNr" = 796)
> 

http://www.hsqldb.org/doc/guide/ch09.html#insert-section

Don't you need to tell your db that you have VALUES to insert ?


Alex




-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Re: SQL-Query Syntax in LO-3.6-Base

2013-07-25 Thread Alexander Thurgood
Le 25/07/13 18:54, Heinrich Stoellinger a écrit :

Hi Heinrich,

> What's wrong with my query?

Which db engine are you using ?

Alex



-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted