1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

IF THEN causing syntax [OPENEDGE]Syntax error (10713)

Discussão em 'StackOverflow' iniciado por fdantas, Junho 4, 2018.

  1. fdantas

    fdantas Administrator Moderador

    I'm trying to write an IF/THEN/ELSE against Progress OpenEdge and getting syntax errors on every iteration I've tried. I'm trying to select a group of columns and doing a couple of calculations. One calc is dividing two columns so I'm trying to check the divisor column in case it is zero.

    I'm getting the following error with slight variations of what it doesn't like in the statement depending on what variation of the IF/THEN I use.

    ERROR [HY000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]
    Syntax error in SQL statement at or about "= 0 THEN ColumnA ELSE (ColumnA " (10713)


    This is my current iteration (with columns renamed to protect the innocent. ;)

    , IF ColumnA = 0 THEN ColumnA
    ELSE (ColumnA - ColumnB) / ColumnB
    END as ProfitMargin


    I started with aliased columns (POS.ColumnA & POS.ColumnB) and read somewhere that fully qualified columns could cause issues so I dropped the alias.

    I tried IF POS.ColumnA = 0 THEN 0. I also tried putting in ELSE DO: I have put an END after the THEN ColumnA. I have put the full calculation in another set of parens.

    I throw myself on the mercy of S.O. What am I missing?

    Continue reading...

Compartilhe esta Página