Skip to main content
nikos101
Inspiring
May 23, 2012
Answered

null statement in query

  • May 23, 2012
  • 3 replies
  • 672 views

Hi, how can I do this null statement

  <cfqueryparam value="#arguments.trade.fwdExtraWindowStart#" cfsqltype="cf_sql_timestamp" null="#not(arguments.trade.optionBarrier_ObservedType eq 'W') & arguments.trade.ignoreBarrierStyleAndObserved#">,

I keep getting errors like:

faultCode:Server.Processing faultString:'Unable to invoke CFC - cannot convert the value "NONO" to a boolean' faultDetail:''

    This topic has been closed for replies.
    Correct answer BKBK

    In addition to what Steve says, I would make the code easier to read and to maintain by doing this just before the query:

    <cfset isTradeVariableNull = not(arguments.trade.optionBarrier_ObservedType eq 'W') and arguments.trade.ignoreBarrierStyleAndObserved>

    and this inside the query:

    <cfqueryparam value="#arguments.trade.fwdExtraWindowStart#" cfsqltype="cf_sql_timestamp" null="#isTradeVariableNull#">

    3 replies

    nikos101
    nikos101Author
    Inspiring
    May 24, 2012

    thanks friends

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    May 23, 2012

    In addition to what Steve says, I would make the code easier to read and to maintain by doing this just before the query:

    <cfset isTradeVariableNull = not(arguments.trade.optionBarrier_ObservedType eq 'W') and arguments.trade.ignoreBarrierStyleAndObserved>

    and this inside the query:

    <cfqueryparam value="#arguments.trade.fwdExtraWindowStart#" cfsqltype="cf_sql_timestamp" null="#isTradeVariableNull#">

    Legend
    May 23, 2012

    Assuming arguments.trade.ignoreBarrierStyleAndObserved is a boolean, I think your only issue here is the "&" -- it should be "and".