Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2013

    Unanswered: Informix Database Problem

    I am usin informix and i am unable to use case statement inside aggregate function. It always throws an error. following is the query I am using.

    select nvl(count(case when (ccd.contacttype =1 and ccd.contactdisposition =2) then (ccd.sessionid) else 0 end),'ELSED (att)') as calls from contactcalldetail ccd inner join agentconnectiondetail acd on ccd.sessionid=acd.sessionid

    Plz help me out.

  2. #2
    Join Date
    Feb 2013

    The error in Informix is

    ERROR: A syntax error has occurred.
    Error Code: -201

  3. #3
    Join Date
    Jul 2012
    This question was also asked on Stack Overflow as sql - Informix Database Issue - Stack Overflow.

    It was also answered there.

  4. #4
    Join Date
    Sep 2011
    Pont l'Abbé, Brittany, France
    Provided Answers: 1
    As Jonathan says, the CASE is not supported in "old" informix versions.

    A little hint when you have a 201 with dbaccess, and you do not know where exactly is the syntax error:
    run dbaccess databasename
    type the query, preferrably with a syntax error
    type 'R' / choose Run in the ring menu
    get the syntax error
    type 'u' / choose the 'use editor' option in the ring menu
    choose vi or whatever editor your are familiar with
    when entering the editor, you will see a '^' below the offset in the sql statement string where the parser
    starts disagreeing with the syntax.

    In programs, you have the same information in the sqlca.sqlerrd[2] in esql/c and sqlca.sqlerrd[3] in 4GL.


Posting Permissions

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