Passing null into a stored procedure

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Passing null into a stored procedure

    I have a survey form with both checkboxes and radio buttons... when storing the
    form, there are occassions that I need to store a NULL in the DB and therefore
    must pass a NULL as that parameter's value. However, I keep getting error
    messages.

    Error Executing Database Query.
    [Macromedia][SQLServer JDBC Driver][SQLServer]Cannot use empty object or
    column names. Use a single space if necessary.

    Here's my code (call to stored procedure):

    <cfquery name="storeSurveyResults" datasource="reports">
    exec drb_Mkt130StoreSurvey #url.Contract_ID#, #SalesPerson_Id#,
    #ProductionPerson_Id#, #LenderID#, #LenderContactID#, #SettleID#,
    #SettleContactID#, #CustomerSvc_ID#, #Recommend#, "#Recommend_Comment#",
    #DRBOverall#, #SQ1#, #SQ2#, #SQ3#, #SQ4#, #PQ1#, #PQ2#, #PQ3#, #PQ4#, #LQ1#,
    #LQ2#, #LQ3#, #SCQ1#, #SCQ2#, #SCQ3#, #CSQ1#, #CSQ2#, #CSQ3#, #CSQ4#,
    #Market1#, #Market2#, #Market3#, #Market4#, #Market5#, #Market6#, #Market7#,
    #Market8#, "#Market8_comment#", #Why1#, #Why2#, #Why3#, #Why4#, #Why5#, #Why6#,
    #Why7#, "#Why7_Comment#"
    </cfquery>

    carmenreed23 Guest

  2. Similar Questions and Discussions

    1. passing values to stored procedure
      Hello Can some please let me know how can I pass value to the following stored procedure from coldfusion template. It is written in different...
    2. VB.NET, Stored procedure, NULL
      Hi Help with this problem would be appreciated. I have a stored procedure with default NULL parameters which should allow all items to be...
    3. NULL in search stored procedure, VB.NET
      Hi I am using a stored procedure to search a single table with "COALESCE(@param,param)" but the NULL default value is being ignored. I think...
    4. #19841 [Opn->Fbk]: RPC stored procedure with many columns return null value
      ID: 19841 Updated by: sniper@php.net Reported By: tonyho at fairex dot com -Status: Open +Status: ...
    5. Passing arrays to a stored procedure
      http://www.aspfaq.com/2248 http://www.algonet.se/~sommar/arrays-in-sql.html http://www.algonet.se/~sommar/dynamic_sql.html "Doug Eller"...
  3. #2

    Default Re: Passing null into a stored procedure

    Use <CFSTOREDPROC> to run the procedure and <CFPROCPARAM> with the attribute
    setting null="true" to pass a null as an argument. You should be using
    <CFQUERYPARAM> or <CFPROCPARAM> for arguments anyway.

    cjeris Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139