#1100 Store result of SQL in a file does not allow recursive queries

3.4.0
open
nobody
None
5
2014-08-04
2013-09-25
Hans Ginzel
No

Hello!

Add please Milestone 3.5.0 to the bug report system.

It seams that script Store result of SQL in a file does not allow recursive queries. Try

WITH days (d)
AS (
 SELECT DATE('2013-01-01') d FROM sysibm.SysDummy1
 UNION  ALL
 SELECT d + 1 DAY FROM days
 WHERE  d < CURRENT DATE
)
SELECT  *
FROM    days

It writes The selected SQL is not a SELECT statement. and Could not create the Progress Monitor.

Example is for DB2, but in Teradata queries can also start with 'WITH'.

Best regards
HG

Discussion

  • sfst
    sfst
    2013-10-07

    The headline is a bit unfortunate, but the description correctly hints that any command starting with 'WITH" has the problem (cannot directly store the result to a file, despite pulling the data up working just fine).

    E.g. in Oracle:

    with a as(select 'q' from dual)
    SELECT * FROM a;

    already shows "The selected SQL is not a SELECT statement." when selecting "Store result of SQL in file".

    As workaround (in Oracle) I can use

    select * from (
    with a as(select 'q' from dual)
    SELECT * FROM a)

    (Tested with SQuirreL 3.5.0)

     
  • sfst
    sfst
    2014-02-07

    Unchanged in version 3.5.1