Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Posts
    1,605

    Unanswered: VAR(column1) OVER() crashes the DB2

    Hi,

    I tried to execute following SQL statements in db2v7.2 fp5 on win2k. At the end I get db2 crash. Is there some bug or am I doing something wrong?

    CREATE TABLE TAB1 (DATA INTEGER);
    INSERT INTO TAB1 VALUES (1),(2),(3),(4),(5);
    SELECT DATA, SUM(DATA) OVER (ORDER BY DATA ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS RESULT FROM TAB1;

    -- above commands work fine

    SELECT DATA, VAR(DATA) OVER (ORDER BY DATA ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS RESULT FROM TAB1;
    -- above command crashes the DB2 with error message: "SQL1224N A database agent could not be started to service a request, or was terminated as a result of a database system shutdown or a force command. SQLSTATE=55032"

    I would like to write the variance between 1 preceding row and current row. I need this SQL to calculate some more sophisticated formula....

    Thanks,
    Grofaty
    Last edited by grofaty; 08-25-03 at 09:24.

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    Standard deviation function (STDDEV) also crashes the DB2. So the following SQL statement returs the same error:

    SELECT DATA, stddev(DATA) OVER (ORDER BY DATA ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS RESULT FROM TAB1;

    Thanks,
    Grofaty

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    You need IBM support ...

    They may have an answer

    Cheers

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  4. #4
    Join Date
    Feb 2002
    Location
    Germany
    Posts
    141
    Grafaty,

    I've tested it by me:
    W2K DB2 V7.2 FP 8: same error.
    W2K DB2 V8.1: it works.

    HTH,
    Rodney Krick

  5. #5
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    Thanks a lot RKrick.

    I have tested on db2v8.1 fp2 win2k and it works.

    Thanks,
    Grofaty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •