forcing string datatype in query of queries

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default forcing string datatype in query of queries

    In a query, I have a column of varchar type and the strings consist of numbers
    in the form "00000099999"
    When I do a query of queries on the result, the column becomes "99999" with
    the leading zeroes truncated.

    Is there a way to force it to display the correct datatype?


    mocax Guest

  2. Similar Questions and Discussions

    1. 2 queries to 1 query
      Hello, Can somebody help me to combine these two queries into one query. <cfquery datasource="#DATAS#" name="getMainNav"> SELECT * FROM...
    2. Query of Queries on query New type query
      In CF5 we have a page that creates a query, using queryNew and querySetCell and the like, we then used dbtype="query" and gave it's name so we could...
    3. Maintain query string and somehow auto refresh a pagewith that string intact
      I have a drill down where on page one the user selects criteria to narrow down the search for a speicific group of employees(like all hired between...
    4. Clob Datatype Cast for Queries on Query
      Hi , I am getting a Query of Queries runtime error when I try to do a QoQ on query which has a column with the clob datatype. The original query is...
    5. SQL Server query with Image datatype
      Hi Folks Can anyone please tell me how I can safely run an SQL query on SQL 2000 via a Perl which includes a field of Image datatype which holds...
  3. #2

    Default Re: forcing string datatype in query of queries

    Will it work if you use CAST to a varchar in the QofQ?
    Iceborer Guest

  4. #3

    Default Re: forcing string datatype in query of queries

    cast() and convert() don't work in QofQs.....
    At least in MX6.1
    No idea about MX7
    mocax Guest

  5. #4

    Default Re: forcing string datatype in query of queries

    Hi

    Is this problem is with the query of queries only?

    actually i have tried with a single query and it is displayintg the value as
    it is in the database onyl.

    <cfquery datasource="test" name="s">
    select * from test1
    </cfquery>
    <cfoutput query="s">
    #test#
    </cfoutput>

    this dispaying the value as : 00009999

    vkunirs Guest

  6. #5

    Default Re: forcing string datatype in query of queries

    The only solution to this I've been able to come up with is to create the query
    with QueryNew and then add a row with default values of the correct type.
    After adding the rest of the data, you can delete first row.

    It's sloppy I know, but it's all my brain, with it's limited capacity for
    parallel thinking has managed to provide me. If anyone has a better idea, I'd
    love to hear it.

    JR

    jonwrob Guest

  7. #6

    Default Re: forcing string datatype in query of queries

    In your query of query, you can try tricking it into thinking it is a string by concatenating an empty string value.

    SELECT COL1 + '' AS COL1

    eastinq 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