An expression of non-boolean type specified in a context where a condition is expected, near ')'.

已答复 An expression of non-boolean type specified in a context where a condition is expected, near ')'.

  • Friday, October 02, 2009 8:24 PM
     
     

    I'm getting the error: An expression of non-boolean type specified in a context where a condition is expected, near ')'.

    On the code below. Any suggestions Thanks.

    insert into rdm_port (ANLSID, ID, EVENTID, PERSPCODE, PERSPVALUE, STDDEVC, STDDEVI, EXPVALUE)

    select b.ANLSID, PORTID, EVENTID, PERSPCODE,

    sum(PERSPVALUE) as SumOfPerspvalue, sum(STDDEVC) as SumOfSTDDEVC,

    sqrt(sum(STDDEVI*STDDEVI)) AS SumOfSTDDEVI, Sum(EXPVALUE) as SumOfEXPVALUE

    from rdm_geoidlob a inner join rdm_anldef b on substring (a.locncode,1,8) = b.lobname

    where a.ANLSID in (1) and perspcode = 'gr'

    group by b.anlsid, a.portid, a.eventid,a.perspcode

     

    insert into rdm_port (ANLSID, ID, EVENTID, PERSPCODE, PERSPVALUE, STDDEVC, STDDEVI, EXPVALUE)

    select b.ANLSID, PORTID, EVENTID, PERSPCODE,

    sum(PERSPVALUE) as SumOfPerspvalue, sum(STDDEVC) as SumOfSTDDEVC,

    sqrt(sum(STDDEVI*STDDEVI)) AS SumOfSTDDEVI, Sum(EXPVALUE) as SumOfEXPVALUE

    from rdm_geoidlob a inner join rdm_anldef b on substring (a.locncode,1,8) = b.lobname

    where a.ANLSID in (1) and perspcode = 'gu'

    group by b.anlsid, a.portid, a.eventid,a.perspcode

     

    insert into rdm_port (ANLSID, ID, EVENTID, PERSPCODE, PERSPVALUE, STDDEVC, STDDEVI, EXPVALUE)

    select b.ANLSID, PORTID, EVENTID, 'rp',

    sum(PERSPVALUE) as SumOfPerspvalue, sum(STDDEVC) as SumOfSTDDEVC,

    sqrt(sum(STDDEVI*STDDEVI)) AS SumOfSTDDEVI, Sum(EXPVALUE) as SumOfEXPVALUE

    from rdm_geoidlob a inner join rdm_anldef b on substring (a.locncode,1,8) = b.lobname

    where a.ANLSID in (1) and perspcode = 'gr'

    group by b.anlsid, a.portid, a.eventid,a.perspcode

     

    insert into rdm_port (ANLSID, ID, EVENTID, PERSPCODE, PERSPVALUE, STDDEVC, STDDEVI, EXPVALUE)

    select b.ANLSID, PORTID, EVENTID, 'rl',

    sum(PERSPVALUE) as SumOfPerspvalue, sum(STDDEVC) as SumOfSTDDEVC,

    sqrt(sum(STDDEVI*STDDEVI)) AS SumOfSTDDEVI, Sum(EXPVALUE) as SumOfEXPVALUE

    from rdm_geoidlob a inner join rdm_anldef b on substring (a.locncode,1,8)) = b.lobname

    where a.ANLSID in (1) and perspcode = 'gr'

    group by b.anlsid, a.portid, a.eventid,a.perspcode

All Replies

  • Friday, October 02, 2009 8:26 PM
     
     
    Which insert is giving you the error?

    Abdallah, PMP, MCTS
  • Friday, October 02, 2009 8:31 PM
     
     
    The last one. The other three ran fine.
  • Friday, October 02, 2009 8:32 PM
     
     Answered

    I'm getting the error: An expression of non-boolean type specified in a context where a condition is expected, near ')'.

    On the code below. Any suggestions Thanks.

    insert into rdm_port (ANLSID, ID, EVENTID, PERSPCODE, PERSPVALUE, STDDEVC, STDDEVI, EXPVALUE)

    select b.ANLSID, PORTID, EVENTID, PERSPCODE,

    sum(PERSPVALUE) as SumOfPerspvalue, sum(STDDEVC) as SumOfSTDDEVC,

    sqrt(sum(STDDEVI*STDDEVI)) AS SumOfSTDDEVI, Sum(EXPVALUE) as SumOfEXPVALUE

    from rdm_geoidlob a inner join rdm_anldef b on substring (a.locncode,1,8) = b.lobname

    where a.ANLSID in (1) and perspcode = 'gr'

    group by b.anlsid, a.portid, a.eventid,a.perspcode

     

    insert into rdm_port (ANLSID, ID, EVENTID, PERSPCODE, PERSPVALUE, STDDEVC, STDDEVI, EXPVALUE)

    select b.ANLSID, PORTID, EVENTID, PERSPCODE,

    sum(PERSPVALUE) as SumOfPerspvalue, sum(STDDEVC) as SumOfSTDDEVC,

    sqrt(sum(STDDEVI*STDDEVI)) AS SumOfSTDDEVI, Sum(EXPVALUE) as SumOfEXPVALUE

    from rdm_geoidlob a inner join rdm_anldef b on substring (a.locncode,1,8) = b.lobname

    where a.ANLSID in (1) and perspcode = 'gu'

    group by b.anlsid, a.portid, a.eventid,a.perspcode

     

    insert into rdm_port (ANLSID, ID, EVENTID, PERSPCODE, PERSPVALUE, STDDEVC, STDDEVI, EXPVALUE)

    select b.ANLSID, PORTID, EVENTID, 'rp',

    sum(PERSPVALUE) as SumOfPerspvalue, sum(STDDEVC) as SumOfSTDDEVC,

    sqrt(sum(STDDEVI*STDDEVI)) AS SumOfSTDDEVI, Sum(EXPVALUE) as SumOfEXPVALUE

    from rdm_geoidlob a inner join rdm_anldef b on substring (a.locncode,1,8) = b.lobname

    where a.ANLSID in (1) and perspcode = 'gr'

    group by b.anlsid, a.portid, a.eventid,a.perspcode

     

    insert into rdm_port (ANLSID, ID, EVENTID, PERSPCODE, PERSPVALUE, STDDEVC, STDDEVI, EXPVALUE)

    select b.ANLSID, PORTID, EVENTID, 'rl',

    sum(PERSPVALUE) as SumOfPerspvalue, sum(STDDEVC) as SumOfSTDDEVC,

    sqrt(sum(STDDEVI*STDDEVI)) AS SumOfSTDDEVI, Sum(EXPVALUE) as SumOfEXPVALUE

    from rdm_geoidlob a inner join rdm_anldef b on substring (a.locncode,1,8)) = b.lobname

    where a.ANLSID in (1) and perspcode = 'gr'

    group by b.anlsid, a.portid, a.eventid,a.perspcode

    Check underlined. There is an extra bracket


    Abdallah, PMP, MCTS
  • Friday, October 02, 2009 8:32 PM
     
     
    I think I see the problem there is an extra parentheses I'll try again.