To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=106104


User atjensen changed the following:

                What    |Old value                 |New value
================================================================================
                 Summary|[cws hsqldb19] Select gene|[cws hsqldb19] SQL stateme
                        |rates error               |nt errors generates confus
                        |                          |ins error messages
--------------------------------------------------------------------------------




------- Additional comments from atjen...@openoffice.org Tue Oct 20 19:10:35 
+0000 2009 -------
This might be more appropriate as an error in the error message.

The first statement does have a mistake in the CONCAT funciton.

Fix that with:

SELECT cu.customer_id AS ID, 
        CONCAT(CONCAT(cu.first_name, ' '), cu.last_name) AS name, 
        a.address AS address, a.postal_code AS "zip code",
        a.phone AS phone, 
        city.city AS city, 
        country.country AS country, 
        IF(cu.active, 'active', '') AS notes, 
        cu.store_id AS SID
FROM customer AS cu JOIN address AS a ON cu.address_id = a.address_id 
JOIN city ON a.city_id = city.city_id
        JOIN country ON city.country_id = country.country_id

So - the IF is wrong for the HSQLdb dialect, but try to run it and the same
error as above is generated from the C++ runtime, the OO.o error dialog box
however now shows:

user lacks privlidges or object not found IF

Finally - if I clean it up and just pull out (what seems like a legit IF clause
to me) the query runs, and creates the view.

SELECT cu.customer_id AS ID, 
        COALESCE(cu.first_name || ' ' || cu.last_name,
                        cu.last_name,
                        cu.first_name,
                        '') AS name, 
        a.address AS address, 
        a.postal_code AS "zip code",
        a.phone AS phone, 
        city.city AS city, 
        country.country AS country, 
--      IF cu.active <> FALSE THEN  
--              'active' 
--      ELSE 
--              ''
--       END AS notes, 
        'active' AS notes, 
        cu.store_id AS SID
FROM customer AS cu JOIN address AS a ON cu.address_id = a.address_id JOIN city
ON a.city_id = city.city_id
        JOIN country ON city.country_id = country.country_id
        



---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@dba.openoffice.org
For additional commands, e-mail: issues-h...@dba.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to