[Solved] Cannot save a carriage return in a Query

Creating tables and queries
Post Reply
det
Posts: 86
Joined: Fri Mar 31, 2017 8:24 pm

[Solved] Cannot save a carriage return in a Query

Post by det »

I enter the Query:
SELECT A, B, C
FROM Table
AS Name

Then I save it and close it. When I re-open the Query, I get:
SELECT A, B, C FROM Table AS Name

This is very annoying with long Queries. Is there a setting somewhere to fix it?
Thanks for any help
Det
Last edited by robleyd on Fri Sep 21, 2018 2:16 am, edited 1 time in total.
Reason: Tagged [Solved] [robleyd, Moderator]
OpenOffice 4.1.5 on Mac Sierra 10.13.1
User avatar
Sliderule
Volunteer
Posts: 1278
Joined: Thu Nov 29, 2007 9:46 am

Re: Cannot save a carriage return in a Query

Post by Sliderule »

det wrote:This is very annoying with long Queries. Is there a setting somewhere to fix it?
Yes.

After you open and write your Query, before you save it, either:
  1. From the Menu: Edit -> Run SQL command directly

    Make sure above has a check mark next to it
  2. From the Toolbar:

    Click on the icon: Run SQL command directly ( SQL command with a GREEN check mark )
Explanation:
  1. The above means, the Base Parser will NOT check the Query before running it, NOR before executing your Query. Therefore, you canNOT use the Query as a Parameter Query ( to prompt user for input before executing it ).
  2. Additionally, when a Query is saved to Run Directly, you CAN, if you want, add comments to the Query, by using two dashes. For example:

    Code: Select all

    -- This Query is to be saved and run directly withOUT the Base Parser being involved
    SELECT 
       A, -- This column will display the information from A
       B, 
       C
    FROM Table AS Name  -- This is an example of the tables I want to use
    
I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
det
Posts: 86
Joined: Fri Mar 31, 2017 8:24 pm

Re: Cannot save a carriage return in a Query

Post by det »

Solved
Thanks so much for detailed explanation. Works perfectly.
OpenOffice 4.1.5 on Mac Sierra 10.13.1
Post Reply