<cfquery> bug/missing function

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

  1. #1

    Default <cfquery> bug/missing function

    Hi All,

    In the docs there are a few references to SQLParameters being a member of
    the new results structure. The docs say the use is something like:

    <cfquery ... results="tempVar">
    SQL BLAH
    </cfquery>

    <cfdump var="#tempVar.SQLParameters#">

    It's supposed to hold an "ordered array of cfqueryparam values". What I'm
    hoping that means is an array of column types (VarChar, Integer, etc). But for
    the life of me, I can't find it. It doesn't show up in the results at all...no
    matter what I do.

    Am I doing something wrong?

    Also, if it is indeed an array of column types...why is it an array? The
    column names are passed out as a list, why not pass the column types as a list
    as well? It would make life easier if you are trying to do something like
    <cfset rstStuff = QueryNew("#rstOriginal.columnList#",
    "#rstOriginal.columnTypes#").

    TIA,
    Chris

    Sir Monkey Guest

  2. Similar Questions and Discussions

    1. addItem() function missing from List control
      I am running Flex 2.0 builder beta and trying to walk through the first of the Flex 1.5 tutorials. The call to the addItem() function below is being...
    2. Text Missing from cfquery
      I have a query which return like 150 records, one of the field contain more than 200 characters. When i try to display it, it only show up part of...
    3. cfquery errors on Package or function LIST is in an invalid state
      I am trying to understand an error I got from my cfquery I created a function using TOAD like: create or replace function list ( field1 number...
    4. missing guides. missing cursors. missing a good drawing app. Ugh.
      I can't see my text cursor. It's invisible. Why? I can't see new guides I drag onto the documents. They are there, I just can't see them. Why? ...
    5. missing strip function in DB2 8.1 -- remove leading zeros
      sujit <yhkumars@yahoo.com> wrote: Where did you have the STRIP function? It didn't exist in version 7....
  3. #2

    Default Re: <cfquery> bug/missing function

    I'm seeing it OK. What it dumps is the sequence 1,2,3 etc along with the value 100,John,Mary etc
    OldCFer Guest

  4. #3

    Default Re: <cfquery> bug/missing function

    Sir Monkey wrote:
    >
    > In the docs there are a few references to SQLParameters being a member of
    > the new results structure. The docs say the use is something like:
    >
    > <cfquery ... results="tempVar">
    > SQL BLAH
    > </cfquery>
    >
    > <cfdump var="#tempVar.SQLParameters#">
    >
    > It's supposed to hold an "ordered array of cfqueryparam values". What I'm
    > hoping that means is an array of column types (VarChar, Integer, etc).
    That's not what it means.

    If you use cfqueryparam all the variables in the normal debug
    output are replaced by placeholders, i.e.:
    SELECT * FROM table WHERE field = <cfqueryparam value="xCFx">
    will show in the debug output as:
    SELECT * FROM table WHERE field = ?

    In this case the SQLParameters array will hold the pair
    1 xCFx so you know the value that was substituted for the first
    parameter.


    The information you want is not available from CF. Which does
    make a bit of sense, CF itself is typeless.

    Jochem

    --
    Jochem van Dieten
    Team Macromedia Volunteer for ColdFusion, beer and fun.
    Jochem van Dieten - TMM Guest

  5. #4

    Default Re: <cfquery> bug/missing function

    On one hand, I'd agree that leaving the column types out makes sense in a
    typeless language...on the other hand SQL is typed (as are recordsets and query
    of queries). And when you create a query with QueryNew MM recommends that you
    supply a list of column types along with the column names. In a situation
    where you creating a forged recordset from a real one, it would be very helpful
    to be able to programmatically pull the column types from a query. While CF
    makes pretty good guesses most of the time, it interprets one of my columns
    that should be a string as a date (the data is in the format ?0000-00000-0000?).

    Maybe this will come about in CF 8?

    Thanks all!!

    Chris


    Sir Monkey Guest

  6. #5

    Default Re: <cfquery> bug/missing function

    Sir Monkey wrote:
    >
    > Maybe this will come about in CF 8?
    [url]http://www.macromedia.com/go/wish/[/url]

    Jochem

    --
    Jochem van Dieten
    Team Macromedia Volunteer for ColdFusion, beer and fun.
    Jochem van Dieten - TMM 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