I suggest you ...

add support for NULL="AUTO" on CFQUERYPARAM

6 votes
Vote 0 votes Vote Vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service

    You'll receive a confirmation email with a link to create a password (optional).

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    zac.spitzerzac.spitzer shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    declined  ·  Todd RaffertyTodd Rafferty responded  · 

    It’s a been a year, no further votes or discussion on this and see Sean Corfield’s response.

    7 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service

      You'll receive a confirmation email with a link to create a password (optional).

      Signed in as (Sign out)
      Submitting...
      • Sean CorfieldAdminSean Corfield (Admin, Railo Technologies) commented  ·   ·  Flag as inappropriate

        I agree with Adrian that this is too tied to your application's data and is not an appropriate feature for the language or for Railo (and if we add it, code that uses it won't run on other CFML engines!). I'll leave this suggestion open for a while longer but my inclination is to decline it.

      • Adrian LynchAdrian Lynch commented  ·   ·  Flag as inappropriate

        Exactly. Unless I'm completely missing something here, auto doen't seem like it would be anything special. Leave it to us to decide when to pass a NULL.

      • Randy MerrillRandy Merrill commented  ·   ·  Flag as inappropriate

        Couldn't you also do: <cfqueryparam value="#arguments.ServiceName#" cfsqltype="cf_sql_varchar" null="#len(arguments.ServiceName)#"> or <cfqueryparam value="#arguments.ServiceName#" cfsqltype="cf_sql_varchar" null="#len(arguments.ServiceName) EQ 0#">

      • Adrian LynchAdrian Lynch commented  ·   ·  Flag as inappropriate

        But what would cause NULL to be used? An empty string for character types? A zero for numeric types? This is too tied into your application's data, null="yes|no" is the way to go for this I feel.

      • SundvorSundvor commented  ·   ·  Flag as inappropriate

        I fully support this idea as the IIF statements are adding a lot of noise to my code. E.g.
        ServiceName = <cfqueryparam value="#arguments.ServiceName#" cfsqltype="cf_sql_varchar" null="#iif(len(arguments.ServiceName),de('NO'),de('YES'))#">
        should really just have to be :
        ServiceName = <cfqueryparam value="#arguments.ServiceName#" cfsqltype="cf_sql_varchar" null="auto">

      Knowledge Base and Helpdesk