title: SQL Array being returned as number, not String in ColdFusion
body: <p>In Coldfusion, I'm using a cfc that binds one select box to another (basically, choose a State from one box, the second box is populated with County names.)  The value for the County box is a 5-digit number WHICH IS FORMATTED AS TEXT (ie.  the value comes from a text field.)  </p>
  
  <p>The problem is that I'm finding that if the value of the selected county id starts with a '0', it's been cut off.</p>
  
  <p>So I get stuff like:
  ID       County
  11223     A
  2300      B (should be 02300)</p>
  
  <p>Can someone help make sure that leading 0s are not cut off?</p>
  
  <p>Here's the select boxes on the page:</p>
  
  <pre><code> &lt;!--- State Name options ---&gt;
      &lt;b&gt;State:&lt;/b&gt;&lt;br /&gt;
      &lt;cfselect bind="cfc:states.getStates()" bindonload="true" name="search_state" id="search_state" value="StateUSAbb" display="StateName"&gt;
      &lt;/cfselect&gt;&lt;br /&gt;
  
    &lt;!--- County Name options ---&gt;
      &lt;b&gt;County:&lt;/b&gt;&lt;br /&gt;
      &lt;cfselect bind="cfc:states.getCounties({search_state})" name="search_county" id="search_county" value="FIPS_County" display="CountyName"&gt;
      &lt;/cfselect&gt;
  </code></pre>
  
  <p>I hate pasting the whole .cfc but pay attention to the latter part, particularly the cfloop which uses a cfset to populate array RESULT:</p>
  
  <pre><code>&lt;cfcomponent output="false"&gt;
  
      &lt;!--- Get array of media types ---&gt;
      &lt;cffunction name="getStates" access="remote" returnType="array"&gt;
          &lt;!--- Define variables ---&gt;
          &lt;cfset var data=""&gt;
          &lt;cfset var result=ArrayNew(2)&gt;
          &lt;cfset var i=0&gt;
  
          &lt;!--- Get data ---&gt;
          &lt;cfquery name="data" datasource="bridges"&gt;
         SELECT DISTINCT tblLoc.StateUSAbb, lkuState.StateName
          FROM lkuState INNER JOIN tblLoc ON lkuState.FIPS_State = tblLoc.FIPS_State
          WHERE (lkuState.StateName &lt;&gt; 'New Brunswick')
          UNION
          SELECT '' AS StateUSAbb, ' ALL' AS StateName
          FROM lkuState
          ORDER BY StateName
          &lt;/cfquery&gt;
  
          &lt;!--- Convert results to array ---&gt;
          &lt;cfloop index="i" from="1" to="#data.RecordCount#"&gt;
              &lt;cfset result[i][1]=data.StateUSAbb[i]&gt;
              &lt;cfset result[i][2]=data.StateName[i]&gt;
          &lt;/cfloop&gt;
  
          &lt;!--- And return it ---&gt;
          &lt;cfreturn result&gt;
      &lt;/cffunction&gt;
  
      &lt;!--- Get counties by state ---&gt;
      &lt;cffunction name="getCounties" access="remote" returnType="array"&gt;
          &lt;cfargument name="stateabb" type="string" required="true"&gt;
  
          &lt;!--- Define variables ---&gt;
          &lt;cfset var data=""&gt;
          &lt;cfset var result=ArrayNew(2)&gt;
          &lt;cfset var i=0&gt;
  
          &lt;!--- Get data ---&gt;
          &lt;cfquery name="data" datasource="bridges"&gt;
          SELECT '' AS FIPS_COUNTY, ' ALL' as CountyName
          FROM lkuCnty
          UNION
          SELECT FIPS_County, CountyName
          FROM lkuCnty
          WHERE StateAbb = '#ARGUMENTS.stateabb#'
          ORDER BY CountyName
          &lt;/cfquery&gt;
  
          &lt;!--- Convert results to array ---&gt;
          &lt;cfloop index="i" from="1" to="#data.RecordCount#"&gt;
              &lt;cfset result[i][1]=data.FIPS_County[i]&gt;
              &lt;cfset result[i][2]=data.CountyName[i]&gt;
          &lt;/cfloop&gt;
  
          &lt;!--- And return it ---&gt;
          &lt;cfreturn result&gt;
      &lt;/cffunction&gt;
  
  &lt;/cfcomponent&gt;
  </code></pre>