Can LibreOffice store a query without modifying it?

I have this code:

SELECT “PEOPLE”.“ID”,“PEOPLE”.“LAST_NAME”,“PEOPLE”.“FIRST_NAME” FROM “PEOPLE”,“DAYS_OFF” WHERE “PEOPLE”.“ID”=“DAYS_OFF”.“ID” AND NOT( MOD(DATEDIFF(‘dd’,‘1960-01-03’,CURRENT_DATE),7)=0 AND “DAYS_OFF”.“SUNDAY_OFF”=true) AND NOT( MOD(DATEDIFF(‘dd’,‘1960-01-03’,CURRENT_DATE),7)=1 AND “DAYS_OFF”.“MONDAY_OFF”=true) AND NOT( MOD(DATEDIFF(‘dd’,‘1960-01-03’,CURRENT_DATE),7)=2 AND “DAYS_OFF”.“TUESDAY_OFF”=true) AND NOT( MOD(DATEDIFF(‘dd’,‘1960-01-03’,CURRENT_DATE),7)=3 AND “DAYS_OFF”.“WEDNESDAY_OFF”=true) AND NOT( MOD(DATEDIFF(‘dd’,‘1960-01-03’,CURRENT_DATE),7)=4 AND “DAYS_OFF”.“THURSDAY_OFF”=true) AND NOT( MOD(DATEDIFF(‘dd’,‘1960-01-03’,CURRENT_DATE),7)=5 AND “DAYS_OFF”.“FRIDAY_OFF”=true) AND NOT( MOD(DATEDIFF(‘dd’,‘1960-01-03’,CURRENT_DATE),7)=6 AND “DAYS_OFF”.“SATURDAY_OFF”=true)

However, libreoffice Base modifies it (presumably to fit into it’s graphical editor?) and then it becomes hundreds of lines - many hundreds. Is there a way to force LibreOffice to take this command literally?

Also, is this command, as it stands, capable of modifying the Days_off database? (It’s only supposed to read it.)

You could see the code when design view is switched off. Now press SQL. The code will be safed as it is, no change to design mode on is possible any more.

In this mode you could also set returns, add comments…

If you have changed the query to direct SQL it isn’t possible to change any data. The result of the query could only be read.

1 Like

Say, am I doing it right if I use “Table”.“YesNoValue” = true or =false?

Or is there some other way I’m supposed to access that…

TRUE and FALSE are right for a boolean field. Depending of the database you are using you could also write 1 for TRUE and 0 for FALSE.