Value in CFQUERYPARAM

I'm cleaning up some codes and start using <cfqueryparam> tags in all the queries.
There is one query that I'm not 100% sure how to convert to cfqueryparam :
INSERT INTO sometable (Column_1,Column_2, .......)
VALUES ( '#Value_1#', '#Value_2# #Value_3#', ......)
The value inserted into Column_2 shows ' #value_1# #value_3# '
Should I use it this way in cfqueryparam:
<cfqueryparam cfsqltype="cf_sql_varchar" value="#value_1# #value_2#"> ? will this be a proper way to do it? 

I think the original question is being misread by some... It's not a list value, it's a concatenation
This will work:
<cfquery name="putSomeTable" datasource="MySource">
  INSERT INTO sometable (Column_1,Column_2)
  VALUES (<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#Value_1#">,
  <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#Value_2# #Value_3#">)
</cfquery>

Similar Messages

  • Error Handling for CFQUERYPARAM

    Is there a way to display the value of cfqueryparam upon a database error?  For example:
    <cfquery name="causeError" datasource="#application.dsn#">
          select street1 from house, #table2# where house.houseid = #table2#.houseid and house.houseid = #form.houseid#
    </cfquery>
    The variable table2 is dynamically generated and let's say an error is caused table2 being an empty string or a table that doesn't exist.  So the error given is:
    [Macromedia][Oracle JDBC Driver][Oracle]ORA-00903: invalid table name
    4 : <cfquery name="causeError" datasource="#application.dsn#">
    5 : select street1 from house, #table2# where house.houseid = #table2#.houseid and house.houseid = #form.houseid#
    6 : </cfquery>
    SQL   select street1 from house, where houseid = 123;
    So I know that the user was trying to look at a house with houseid = 123.  I can then try to replicate the error using the same record in the database which can ultimately can help me diagnose the problem more quickly.
    However, if I use cfqueryparam, i.e.:
    <cfquery name="causeError" datasource="#application.dsn#">
          select street1 from house, #table2# where house.houseid = #table2#.houseid and house.houseid = <cfqueryparam value="#form.houseid#" cfsqltype="cf_sql_integer">
    </cfquery>
    I get:
    [Macromedia][Oracle JDBC Driver][Oracle]ORA-00903: invalid table name
    4 : <cfquery name="causeError" datasource="#application.dsn#">
    5 : select street1 from house, #table2# where house.houseid = #table2#.houseid and house.houseid = <cfqueryparam value="#form.houseid#" cfsqltype="cf_sql_integer">
    6 : </cfquery>
    SQL   select street1 from house, where house.houseid = .houseid and house.houseid = (param 1)
    I have no idea what the user entered.

    The cfqueryparam value is buried deep in the cfcatch structure. You may get to it, for example, by doing something like this:
    <cftry>
    <!--- Put your query here --->
    <cfcatch type="database">
        <cfdump var="#cfcatch.where#">
    </cfcatch>
    </cftry>

  • "Data truncation: Incorrect datetime value" Error Message

    Hello,
    I'm running Coldfusion 8 with a MySQL database. The s10Date
    column is of type "datetime".
    What would cause the following error to occur when I'm
    entering data into the database?
    Data truncation: Incorrect datetime value: '{ts '2008-09-03
    17:16:01'}' for column 's10Date' at row 1
    The error occurred in
    C:\ColdFusion8\wwwroot\Websites\questnbs.info\components\DataMgr\DataMgr.cfc:
    line 1602
    Called from
    C:\ColdFusion8\wwwroot\Websites\questnbs.info\components\DataMgr\DataMgr.cfc:
    line 1170
    Called from
    C:\ColdFusion8\wwwroot\Websites\questnbs.info\components\DataMgr\DataMgr.cfc:
    line 1633
    Called from
    C:\ColdFusion8\wwwroot\Websites\questnbs.info\parsed\quest_c_registrations.processregistr ationform.cfm:
    line 37
    Called from
    C:\ColdFusion8\wwwroot\Websites\questnbs.info\parsed\quest_c_registrations.processregistr ationform.cfm:
    line 5
    Called from
    C:\ColdFusion8\wwwroot\Websites\questnbs.info\parsed\quest_c_registrations.processregistr ationform.cfm:
    line 1
    Called from
    C:\ColdFusion8\wwwroot\Websites\questnbs.info\fusebox5\Application.cfc:
    line 228
    Called from
    C:\ColdFusion8\wwwroot\Websites\questnbs.info\fusebox5\Application.cfc:
    line 218
    Called from
    C:\ColdFusion8\wwwroot\Websites\questnbs.info\fusebox5\fusebox5.cfm:
    line 57
    Called from
    C:\ColdFusion8\wwwroot\Websites\questnbs.info\index.cfm: line 12
    1600 : <cfquery name="qQuery"
    datasource="#variables.datasource#" username="#variables.username#"
    password="#variables.password#"><cfloop index="i" from="1"
    to="#ArrayLen(aSQL)#" step="1"><cfif IsSimpleValue(aSQL
    )><cfset temp =
    aSQL>#Trim(PreserveSingleQuotes(temp))#<cfelseif
    IsStruct(aSQL
    )><cfset aSQL = queryparam(argumentCollection=aSQL
    )><cfswitch
    expression="#aSQL.cfsqltype#"><cfcase
    value="CF_SQL_BIT"><cfif aSQL
    .value>1<cfelse>0</cfif></cfcase><cfcase
    value="CF_SQL_DATE">#CreateODBCDateTime(aSQL.value)#</cfcase><cfdefaultcase><cfif
    ListFindNoCase(variables.dectypes,aSQL
    .cfsqltype)>#Val(aSQL.value)#<cfelse><cfqueryparam
    value="#aSQL
    .value#" cfsqltype="#aSQL.cfsqltype#" maxlength="#aSQL
    .maxlength#" scale="#aSQL.scale#" null="#aSQL
    .null#" list="#aSQL.list#" separator="#aSQL
    .separator#"></cfif></cfdefaultcase></cfswitch></cfif>
    </cfloop></cfquery>
    1601 : <cfelse>
    1602 : <cfquery name="qQuery"
    datasource="#variables.datasource#"><cfloop index="i"
    from="1" to="#ArrayLen(aSQL)#" step="1"><cfif
    IsSimpleValue(aSQL)><cfset temp = aSQL
    >#Trim(PreserveSingleQuotes(temp))#<cfelseif
    IsStruct(aSQL)><cfset aSQL
    = queryparam(argumentCollection=aSQL)><cfswitch
    expression="#aSQL
    .cfsqltype#"><cfcase value="CF_SQL_BIT"><cfif
    aSQL.value>1<cfelse>0</cfif></cfcase><cfcase
    value="CF_SQL_DATE">#CreateODBCDateTime(aSQL
    .value)#</cfcase><cfdefaultcase><cfif
    ListFindNoCase(variables.dectypes,aSQL.cfsqltype)>#Val(aSQL
    .value)#<cfelse><cfqueryparam value="#aSQL.value#"
    cfsqltype="#aSQL
    .cfsqltype#" maxlength="#aSQL.maxlength#" scale="#aSQL
    .scale#" null="#aSQL.null#" list="#aSQL
    .list#"
    separator="#aSQL.separator#"></cfif></cfdefaultcase></cfswitch></cfif>
    </cfloop></cfquery>
    1603 : </cfif>
    1604 :
    Thank you in advance for your assistance.
    Simon

    Just a note, I had the same problem and resolved it by making
    sure my cfsqltype in cfqueryparam is cf_sql_timestamp instead of
    cf_sql_datetime (which is not a valid value).
    Also, just a note that when working with a datetime value in
    cfqueryparam, using cf_sql_date for cfsqltype will truncate the
    time to 00:00:00.

  • IDENTITY_INSERT is set to OFF.

    I have a dynamic site.
    When I insert an integer (a whole number) in a raw materials purchase table, I get the following message:
    Error Executing Database Query.
    [Macromedia][SQLServer JDBC Driver][SQLServer]Cannot insert explicit value for identity column in table 'tblRawMatlPurch' when IDENTITY_INSERT is set to OFF.           
    When I change to or insert a numeric, decimal, or money value, I get the following message:
    Raw Materials Decision
    Company:  Grande
    You have NOT successfully submitted the Raw Materials Decision form
    Please note that the purchase amount must be a whole number, please do not enter a decimal for this number.
    Return to correct
    I have two programs: one is in the secure section, and the name is secure/raw_materials_decision_action, indicating that the raw material purchase variable (rawMat) is a money variable. Giving this information I set it in SQL as a money variable. Here is the file:
    <!---  get Company Name --->
    <cfquery name="getCompany" datasource="#application.dsn#">
      Select companyName
      From tblCompNames
      Where companyID=<cfqueryparam cfsqltype="cf_sql_integer" value="#getAuthUser()#">
    </cfquery>
    <cfparam name="form.changes" default="">
    <cfset error = "">
    <!--- All users must have raw materials associated with city and product when user profile created --->
    <!--- update action --->
    <cfif form.changes NEQ "">
    <!---  go through changes - if they changed cost or selling price, will contain cost_id --->
      <cfloop index="x" list="#form.changes#">
      <cfif trim(x) NEQ "">
      <cfset thisSalesOrderID = trim(x)>
      <cfset thisRawMatID = form["rawMatID_#thisSalesOrderID#"]>
      <cfset thisCity = form["cityID_#thisSalesOrderID#"]>
      <cfset thisProduct = form["productID_#thisSalesOrderID#"]>
      <cfset thisPurchase = form["purchase_#thisSalesOrderID#"]>
      <cfif thisPurchase NEQ "" AND (not isNumeric(thisPurchase) OR thisPurchase CONTAINS ".")>
      <cfset error = "yes">
      </cfif>
      <cfif error EQ "">
      <cfquery name="getRow" datasource="#application.dsn#">
      Select *
      From tblRawMatlPurch
      WHERE SalesOrderID=<cfqueryparam cfsqltype="cf_sql_integer" value="#thisSalesOrderID#">
      </cfquery>
      <cfif getRow.RawMat NEQ thisPurchase>
      <cfif getRow.recordCount NEQ 0 AND trim(thisPurchase) NEQ "">
      <cfquery name="updateRow" datasource="#application.dsn#">
      Update tblRawMatlPurch
      Set CityID = <cfqueryparam cfsqltype="cf_sql_integer" value="#thisCity#">
      , ProductID = <cfqueryparam cfsqltype="cf_sql_integer" value="#thisProduct#">
      , RawMatID = <cfqueryparam cfsqltype="cf_sql_integer" value="#thisRawMatID#">
      , RawMat = <cfqueryparam cfsqltype="cf_sql_money" value="#trim(thisPurchase)#">
      WHERE SalesOrderID=<cfqueryparam cfsqltype="cf_sql_integer" value="#thisSalesOrderID#">
      </cfquery>
      <cfelseif getRow.recordCount NEQ 0 AND trim(thisPurchase) EQ "">
      <cfquery name="deleteRow" datasource="#application.dsn#">
      Delete From tblRawMatlPurch
      WHERE SalesOrderID=<cfqueryparam cfsqltype="cf_sql_integer" value="#thisSalesOrderID#">
      </cfquery>
      <cfelseif getRow.recordCount EQ 0 AND thisPurchase NEQ "">
      <cfquery name="insertRow" datasource="#application.dsn#">
      Insert Into tblRawMatlPurch
      (SalesOrderID,companyID,cityID, productID,RawMatID,RawMat)
      VALUES
      (<cfqueryparam cfsqltype="cf_sql_integer" value="#thisSalesOrderID#">,<cfqueryparam cfsqltype="cf_sql_integer" value="#getAuthUser()#">, <cfqueryparam cfsqltype="cf_sql_integer" value="#thisCity#">, <cfqueryparam cfsqltype="cf_sql_integer" value="#thisProduct#">,<cfqueryparam cfsqltype="cf_sql_integer" value="#thisRawMatID#">,<cfqueryparam cfsqltype="cf_sql_money" value="#trim(thisPurchase)#">)
      </cfquery>
      </cfif>
      </cfif>
      </cfif>
      </cfif>
      </cfloop>
    </cfif>
    However, I have a second program in the files section: the raw material decision, which indicates that the variable must be an integer (a whole number).
    <!---  Text Content for Raw Materials Decision Form
      DO NOT CHANGE ANY FORM NAMES OR ADD NEW FORM NAMES
      <input type="text" name="DO NOT CHANGE". . .>
      See raw_materials_decison_es.html for Spanish version of this file --->
    <!---  User can enter just one purchase
      - the next time they use this screen it will show blank city/product/raw material purchases
      error message if they do not enter numeric value --->
    <!---  get Materials for this company --->
    <cfquery name="getMaterials" datasource="#application.dsn#">
      SELECT SalesOrderID, CityID, ProductID, RawMatID
      FROM tblRawMatID
      WHERE CompanyID=<cfqueryparam cfsqltype="cf_sql_integer" value="#getAuthUser()#">
      ORDER BY cityID, productID, rawMatID
    </cfquery>
    <!--- set Company name --->
    <cfset thisCompany = getCompany.companyName>
    <table width="600" border="0" cellpadding="5" align="center">
      <cfoutput>
      <tr>
      <td colspan="5" align="right">
      <a href="logout.cfm" style="text-decoration:none; font-weight:bold;">LOGOUT</a>
      </td>
      </tr>
      <tr>
      <td colspan="5">
      <h2>Raw Materials Decision</h2>
      <h5>Company:  #thiscompany#</h5>
      </td>
      </tr>
      </cfoutput>
    <!---  Action display --->
    <cfif form.changes NEQ "">
      <!--- Error Message - if there --->
      <cfif error NEQ "">
      <tr>
      <td colspan="5">
      <p>
      You have NOT successfully submitted the Raw Materials Decision form
      </p>
      <p>
      Please note that the purchase amount must be a whole number, please do not enter a decimal for this number.
      <br /><br />
      <a href='Javascript: history.back();'>Return to correct</a>
      </p>
      </td>
      </tr>
      <cfelse>
      <tr>
      <td colspan="5">
      <p>
      Thank you for your submission.
      </p>
      </td>
      </tr>
      </cfif>
    <!---  START FORM --->
    <cfelse>
      <!---  Show Materials already entered when Company set up --->
      <form action="raw_materials_decision.cfm" method="post" name="materials">
      <!---  changes hold the ID for any values that are changed to minimize time to check for changes
      - uses onChange in form input to send ID --->
      <input type="hidden" name="changes" value="" />
      <!--- top column headings for table --->
      <tr>
      <th>
      City
      </th>
      <th>
      Product
      </th>
      <th>Raw Materials</th>
      <th>
      Price</th>
      <th align="center">
      Purchase
      </th>
      </tr>
      <cfoutput query="getMaterials">
      <cfquery name="getCity" datasource="#application.dsn#">
      Select cityName
      From tblCities
      Where cityID = <cfqueryparam cfsqltype="cf_sql_integer" value="#getMaterials.cityID#">
      </cfquery>
      <cfquery name="getProduct" datasource="#application.dsn#">
      Select productName
      From tblProductCategories
      Where productID = <cfqueryparam cfsqltype="cf_sql_integer" value="#getMaterials.productID#">
      </cfquery>
      <cfquery name="getMaterial" datasource="#application.dsn#">
      Select rawMatDescription
      From tblRmatCategory
      Where rawMatID = <cfqueryparam cfsqltype="cf_sql_integer" value="#getMaterials.rawMatID#">
      </cfquery>
      <cfquery name="getPrice" datasource="#application.dsn#">
      Select rawMatPrice
      From tblRawmatPrices
      Where rawMatID = <cfqueryparam cfsqltype="cf_sql_integer" value="#getMaterials.rawMatID#">
      AND cityID= <cfqueryparam cfsqltype="cf_sql_integer" value="#getMaterials.cityID#">
      </cfquery>
      <cfquery name="getPurch" datasource="#application.dsn#">
      SELECT RawMat
      FROM tblRawMatlPurch
      WHERE companyID=<cfqueryparam cfsqltype="cf_sql_integer" value="#getAuthUser()#">
      AND cityID = <cfqueryparam cfsqltype="cf_sql_integer" value="#getMaterials.cityID#">
      AND productID = <cfqueryparam cfsqltype="cf_sql_integer" value="#getMaterials.productID#">
      AND rawMatID =  <cfqueryparam cfsqltype="cf_sql_integer" value="#getMaterials.RawMatID#">
      </cfquery>
      <tr>
      <td>
      #getCity.cityName#
      <input type="hidden" name="cityID_#salesOrderID#" value="#cityID#" />
      </td>
      <td>
      #getProduct.productName#
      <input type="hidden" name="productID_#salesOrderID#" value="#productID#" />
      </td>
      <td>
      #getMaterial.RawMatDescription#
      <input type="hidden" name="rawMatID_#salesOrderID#" value="#RawMatID#">
      </td>
      <td>
      #dollarFormat(getPrice.rawMatPrice)#
      </td>
      <td align="center">
      <input  name="purchase_#salesOrderID#" type="text" value="#getPurch.rawMat#" size="12" onchange="document.materials.changes.value=document.materials.changes.value + ', #salesOrderID#';" />
      </td>
      </tr>
      </cfoutput>
      <!--- blank space before submit button --->
      <tr>
      <td colspan="5">
      <br />
      </td>
      </tr>
      <!--- submit buttons --->
      <tr>
      <td colspan="5">
      <input type="submit" value="Submit Raw Materials" />
      <input type="reset" value="Reset">
      </td>
      </tr>
      </form>
    </cfif>
    </table>
    I understand there is a conflict between the secure/raw_materials_decision_action program and the raw materials decision program, except, that I do not know how to fix it.
    Perhaps, I could change, the raw materials variable from money to integer. But, I am not sure this will solve the problem.
    Alternatively, I could try to change the raw_materials_decision, specification, to accept a decimal, numeric, or money variable, but, I have been revieweing the file, and I do not know how to make this change.
    It is not obvious to me.
    Is there anyone who could help with this problem to find a best possible solution?
    I would appreciate the assistance very much.
    Thank you.

    TL;DR. The error you are receiving is from SQL. Identity fields are auto-assigned by the SQL server and you are sending a prepopulated value, thus the error. I can't really tell you how to easily fix this because I'm not sure what the app is trying to do nor do I know the underlying database schema. The most likely solution is to not send the identity value in your insert query and then use select @@identity if you require the auto-assigned value.

  • Update two DataSources one Query?

    I am building a dynamic site using Dreamweaver CS5 and Coldfusion 9.
    Ok after messing with this particular page for almost five hours now and still have not figured this out I thought I would ask someone (anyone that reads this) who has a better clue than me at this.
    I made a registration page which gets data put into two separate databases "QBs" table-Customer gets contact info "Access" table-Logininfo gets some contact info and username + password +access level. Now I wanted to create a contact update page to allow the user to change any of the information he/she typed in on the registration page. I wanted both sources to be updated in one submit button because the two sources reference each other on different pages so they both need to be updated with the same info. For instance both sources-tables have a column FullName and it gets used as a session variable throughout the site so if the customer changes either first or last name it needs to be updated in both sources at one instant for the site to maintain operation.
    The error I keep getting is this:
    Error  Executing Database Query.
    [Macromedia][SequeLink JDBC  Driver][ODBC Socket][QODBC] Expected lexical element not found:
    The  error occurred in C:\inetpub\wwwroot\CFIDE\testsite\Pages\User  Pages\user_contact_info.cfm: line 97
    95 : Email=<cfqueryparam value="#Email#" cfsqltype="cf_sql_carchar" maxlength="75"/>
    96 : )
    97 : WHERE ListID=<cfoutput>'#Session.ListID#'</cfoutput>
    98 :   </cfquery>
    99 :   <cfquery datasource="Access">
    VENDORERRORCODE
      11015
    SQLSTATE
      42000
    SQL
       UPDATE Customer SET  VALUES ( Salutation= (param 1) , FirstName= (param 2) , LastName= (param 3) ,  Name= (param 4) , BillAdressAddr1= (param 5) , BillAddressAddr2= (param 6) ,  BillAddressCity= (param 7) , BillAddressState= (param 8) ,  BillAddressPostalCode= (param 9) , Contact= (param 10) , Phone= (param 11) ,  AltPhone= (param 12) , Email= (param 13) ) WHERE ListID='80000025-1246408045'
    DATASOURCE
      QBs
    Now this is my code for the Query and I will also list my table because maybe there is something I am missing from that. I have a feeling what I am trying to do is not possible??? thus the lack of success in fiddling with the code for hours. Any help is very much appreciated!!!!!!
    HEAD:
    <cflock scope="Session" type="ReadOnly" timeout="30" throwontimeout="no">
      <cfset MM_Username=Iif(IsDefined("Session.MM_Username"),"Session.MM_Username",DE(""))>
      <cfset MM_UserAuthorization=Iif(IsDefined("Session.MM_UserAuthorization"),"Session.MM_UserAuthor ization",DE(""))>
    </cflock>
    <cfif MM_Username EQ "" OR MM_UserAuthorization EQ "" OR ListFind("User,Admin",MM_UserAuthorization) EQ 0>
      <cfset MM_referer=CGI.SCRIPT_NAME>
      <cfif CGI.QUERY_STRING NEQ "">
        <cfset MM_referer=MM_referer & "?" & CGI.QUERY_STRING>
      </cfif>
      <cfset MM_failureURL="unauthorized.cfm?accessdenied=" & URLEncodedFormat(MM_referer)>
      <cflocation url="#MM_failureURL#" addtoken="no">
    </cfif>
    <cfquery name="Update_info" datasource="Access">
    SELECT ID, FullName, FirstName, LastName, Username, Password
    FROM Logininfo
    WHERE ID=<cfoutput>#Session.ID#</cfoutput>
    </cfquery>
    <cfquery name="update_contactinfo" datasource="QBs">
    SELECT ListID, Name, FullName, CompanyName, Salutation, FirstName, LastName, BillAddressAddr1, BillAddressAddr2, BillAddressCity, BillAddressState, BillAddressPostalCode, Phone, AltPhone, Email
    FROM Customer
    WHERE ListID=<cfoutput>'#Session.ListID#'</cfoutput>
    </cfquery>
    <cfquery name="listvariables" Datasource="Access">
    SELECT Salutation FROM ListVariables
    </cfquery>
    <cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
    <cfif IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "UpdateContactInformation">
    <cfquery datasource="QBs">  
       UPDATE Customer SET
      <cfif IsDefined('form.salutation') and len(form.salutation) NEQ 0>
      <cfset #Salutation#=form.salutation/>
      </cfif>
      <cfif IsDefined('form.firstname') and len(form.firstname) NEQ 0>
    <cfset #FirstName#=form.firstname/>
      </cfif>
      <cfif IsDefined('form.lastname') and len(form.lastname) NEQ 0>
        <cfset #LastName#=form.lastname/>
        </cfif>
      <cfset Name=#FirstName#&' '&#LastName#/>
      <cfset BillAddressAddr1=#Salutation#&' '&#FirstName#&' '&#LastName#/>
        <cfif IsDefined('form.streetaddress') and len(form.streetaddress) NEQ 0>
        <cfset #BillAddressAddr2#=form.streetaddress/>
      </cfif>
        <cfif IsDefined('form.city') and len(form.city) NEQ 0>
        <cfset #BillAddressCity#=form.city/>
        </cfif>
        <cfif IsDefined('form.state') and len(form.state) NEQ 0>
        <cfset #BillAddressState#=form.state/>
        </cfif>
      <cfif IsDefined('form.zipcode') and len(form.zipcode) NEQ 0>
        <cfset #BillAddressPostalCode#=form.zipcode/>
        </cfif>
    <cfset Contact=#FirstName#&' '&#LastName#/>
      <cfif IsDefined('form.dayphone') and len(form.dayphone) NEQ 0>
        <cfset #Phone#=form.dayphone/>
      </cfif>
      <cfif IsDefined('form.eveningphone') and len(form.eveningphone) NEQ "">
        <cfset #AltPhone#=form.eveningphone/>
      </cfif>
      <cfif IsDefined('form.email') and len(form.email) NEQ "">
        <cfset #Email#=form.email/>
      </cfif>
    VALUES (
    Salutation=<cfqueryparam value="#Salutation#" cfsqltype="cf_sql_varchar" maxlength="15"/>,
    FirstName=<cfqueryparam value="#FirstName#" cfsqltype="cf_sql_varchar" maxlength="41"/>,
    LastName=<cfqueryparam value="#LastName#" cfsqltype="cf_sql_varchar" maxlength="41"/>,
    Name=<cfqueryparam value="#Name#" cfsqltype="cf_sql_varchar" maxlength="50"/>,
    BillAdressAddr1=<cfqueryparam value="#BillAddressAddr1#" cfsqltype="cf_sql_varchar" maxlength="80"/>,
    BillAddressAddr2=<cfqueryparam value="#BillAddressAddr2#" cfsqltype="cf_sql_varchar" maxlength="50"/>,
    BillAddressCity=<cfqueryparam value="#BillAddressCity#" cfsqltype="cf_sql_varchar" maxlength="50"/>,
    BillAddressState=<cfqueryparam value="#BillAddressState#" cfsqltype="cf_sql_varchar" maxlength="25"/>,
    BillAddressPostalCode=<cfqueryparam value="#BillAddressPostalCode#" cfsqltype="cf_sql_varchar" maxlength="13"/>,
    Contact=<cfqueryparam value="#Contact#" cfsqltype="cf_sql_varchar" maxlength="41"/>,
    Phone=<cfqueryparam value="#Phone#" cfsqltype="cf_sql_varchar" maxlength="15"/>,
    AltPhone=<cfqueryparam value="#AltPhone#" cfsqltype="cf_sql_varchar" maxlength="15"/>,
    Email=<cfqueryparam value="#Email#" cfsqltype="cf_sql_carchar" maxlength="75"/>
    WHERE ListID=<cfoutput>'#Session.ListID#'</cfoutput>
      </cfquery>
      <cfquery datasource="Access">
    UPDATE Logininfo SET
    <cfif IsDefined('form.firstname') and len(form.firstname) NEQ 0>
    <cfset #FirstName#=form.firstname/>
    </cfif>
    <cfif IsDefined('form.lastname') and len(form.lastname) NEQ 0>
    <cfset #LastName#=form.lastname/>
    </cfif>
    <cfset FullName=#form.firstname#&' '&#form.lastname#/>
    <cfif IsDefined('form.username') and len(form.username) NEQ 0>
    <cfset #Username#=form.username/>
    </cfif>
    <cfif IsDefined('form.password') and len(form.password) NEQ 0>
    <cfset #Password#=form.password/>
    </cfif>
    VALUES (
    FullName=<cfqueryparam value="#FullName#" cfsqltype="cf_sql_varchar" maxlength="80"/>,
    FirstName=<cfqueryparam value="#FirstName#" cfsqltype="cf_sql_varchar" maxlength="41"/>,
    LastName=<cfqueryparam value="#LastName#" cfsqltype="cf_sql_varchar" maxlength="41"/>,
    UserName<cfqueryparam value="#Username#" cfsqltype="cf_sql_varchar" maxlength="41"/>,
    Password=<cfqueryparam value="#Password#" cfsqltype="cf_sql_varchar" maxlength="41"/>
    WHERE ID=<cfoutput>'#Session.ID#'</cfoutput>
    </cfquery>
    <cflocation url="updated_contactinfo.cfm">
    </cfif>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html><!-- InstanceBegin template="/Templates/customer_template.dwt.cfm" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!-- InstanceBeginEditable name="title" --><title>Update Contact Information</title><!-- InstanceEndEditable -->
    <link href="../../styles/Main.css" rel="stylesheet" type="text/css">
    <script src="../../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="../../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
    <!-- InstanceBeginEditable name="head" -->
    <script src="../../SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script><script src="../../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="../../SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
    <link href="../../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css"><!-- InstanceEndEditable --></head>
    BODY:
    <body>
    <div id="Container">
      <div id="header"><img src="../../Images/Website-Image.gif" width="393" height="217" alt="TS Landscaping Logo and Name of company"></div>
      <div id="menu_bar1">
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a class="MenuBarItemSubmenu" href="../../index.cfm">Home</a>
            <ul>
              <li><a href="#">Item 1.1</a></li>
              <li><a href="#">Item 1.2</a></li>
              <li><a href="#">Item 1.3</a></li>
            </ul>
          </li>
          <li><a href="#">About Us</a></li>
          <li><a href="#">Services</a></li>
          <li><a class="MenuBarItemSubmenu" href="#">User Account</a>
            <ul>
              <li><a href="../../login.cfm">Login</a></li>
              <li><a href="../../registration_page_contact.cfm">Register</a></li>
              <li><a href="../../members_page.cfm">Customer Page</a></li>
            </ul>
          </li>
          <li><a href="#">Contact Us</a></li>
        </ul>
      </div>
      <div id="Main">
        <div id="side_bar"><!-- InstanceBeginEditable name="sidebar" -->Content for  id "side_bar" Goes Here<!-- InstanceEndEditable --></div>
        <div id="main_body">
    <p align="left"><a href="../../invoice_page.cfm">Customer Invoices</a> | <a href="../../service_request_page.cfm">Request Services</a> | <a href="user_contact_info.cfm">Change Contact Info</a></p>
          <hr>
    <!-- InstanceBeginEditable name="mainbody" -->
    <h1><cfoutput>#Session.FullName#</cfoutput> Contact Information</h1>
    <table width="auto" border="1">
      <tr>
        <td><div align="center">Update Your Contact Information</div></td>
        </tr>
      <tr>
        <td> 
          <form method="post" name="UpdateContactInformation" action="<cfoutput>#CurrentPage#</cfoutput>">
            <table align="center" >
              <tr valign="baseline">
                <td nowrap align="right"><div align="right"><label for="salutation">Salutation</label></div></td>
                <td><select name="salutation" id="salutation" accesskey="n" tabindex="15">
                  <cfoutput query="listvariables">
                    <option value="#listvariables.Salutation#" <cfif (isDefined("Session.Salutation") AND listvariables.Salutation EQ Session.Salutation)>selected="selected"</cfif>>#listvariables.Salutation#</option>
                  </cfoutput>
                </select>
                  <tr valign="baseline">
                    <td nowrap align="right"><div align="right">FirstName:</div></td>
                    <td><input type="text" name="FirstName" id="firstname" value="<cfoutput>#update_contactinfo.FirstName#</cfoutput>"  size="32"></td>
                    </tr>
              <tr valign="baseline">
                <td nowrap align="right"><div align="right">LastName:</div></td>
                <td><input type="text" name="LastName" id="lastname" size="32" value="<cfoutput>#update_contactinfo.LastName#</cfoutput>"></td>
                </tr>
              <tr valign="baseline" >
                <td nowrap align="right"><div align="right">Street Address:</div></td>
                <td><input type="text" name="streetaddress" id="streetaddress"  size="32" value="<cfoutput>#update_contactinfo.BillAddressAddr2#</cfoutput>"></td>
                </tr>
              <tr valign="baseline">
                <td nowrap align="right"><div align="right">City:</div></td>
                <td><input type="text" name="city" id="city"  size="32"value="<cfoutput>#update_contactinfo.BillAddressCity#</cfoutput>"></td>
                </tr>
              <tr valign="baseline">
                <td nowrap align="right"><div align="right">State:</div></td>
                <td><input type="text" name="state" id="state" size="32" value="<cfoutput>#update_contactinfo.BillAddressState#</cfoutput>"></td>
                </tr>
              <tr valign="baseline">
                <td nowrap align="right"><div align="right">Zip Code:</div></td>
                <td><input type="text" name="zipcode" id="zipcode" size="32"value="<cfoutput>#update_contactinfo.BillAddressPostalCode#</cfoutput>"></td>
                </tr>
              <tr valign="baseline">
                <td nowrap align="right"><div align="right">Day Phone:</div></td>
                <td><input type="text" name="dayphone" id="dayphone" size="32" value="<cfoutput>#update_contactinfo.Phone#</cfoutput>"></td>
                </tr>
              <tr valign="baseline">
                <td nowrap align="right"><div align="right">Evening Phone:</div></td>
                <td><input type="text" name="eveningphone" id="eveningphone"  size="32" value="<cfoutput>#update_contactinfo.AltPhone#</cfoutput>"></td>
                </tr>
              <tr valign="baseline">
                <td nowrap align="right"><div align="right">Email:</div></td>
                <td><input type="text" name="email" id="email" size="32" value="<cfoutput>#update_contactinfo.Email#</cfoutput>"></td>
                </tr>
              <td nowrap align="right"><div align="right">Username:</div></td>
                <td><input type="text" name="username" id="username" size="32" value="<cfoutput>#update_info.Username#</cfoutput>"></td>
                </tr>
              <tr valign="baseline">
                <td nowrap align="right"><div align="right">Password:</div></td>
                <td><input type="password" name="password" id="password" accesskey="n" tabindex="45" size="32" value="<cfoutput>#update_info.Password#</cfoutput>"></td>
                </tr>
              <td nowrap align="right"><div align="right"><label for="confirmpassword">Confirm Password:</label></div></td>
                <td><span id="spryconfirm1">
                  <input type="password" name="confirmpassword" id="confirmpassword" accesskey="n" tabindex="50" size="32">
                  <span class="confirmRequiredMsg">A value is required.</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
                </tr>
              <tr valign="baseline">
                <td colspan="2" align="right" nowrap><div align="center">
                  <input type="submit" value="Update Contact Info">
                  </div></td>
                </tr>
              </table>
            <input type="hidden" name="MM_UpdateRecord" value="UpdateContactInformation">
            </form>
          <p> </p></td>
        </tr>
    </table>
    <p> </p>
    <script type="text/javascript">
    var spryconfirm1 = new Spry.Widget.ValidationConfirm("spryconfirm1","password");
    </script>
        <!-- InstanceEndEditable -->
        </div>
      </div>
      <div id="footer">
        <p>Home | About Us | Site Map </p>
        <p>&copy; TS Landscaping LLC 2010</p>
      </div>
    </div>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
        </script>
    </body>
    <!-- InstanceEnd --></html>

    Meensi just wanted to update you so you didn't put to much time into my problem I have discovered this line of code to work. Obviously it does not include all that I want to update but tomorrow I will add in each line and test as I go to see where I get the error. So far now I think I am at a point where I can figure this out. I am sure there is some value in the database that can't be updated although I looked at the charts for the databases and they all said UPDATABLE I am thinking maybe a typo but I'll find out tomorrow. Thanks again for you help!
    <cflock scope="Session" type="ReadOnly" timeout="30" throwontimeout="no">
      <cfset MM_Username=Iif(IsDefined("Session.MM_Username"),"Session.MM_Username",DE(""))>
      <cfset MM_UserAuthorization=Iif(IsDefined("Session.MM_UserAuthorization"),"Session.MM_UserAuthor ization",DE(""))>
    </cflock>
    <cfif MM_Username EQ "" OR MM_UserAuthorization EQ "" OR ListFind("User,Admin",MM_UserAuthorization) EQ 0>
      <cfset MM_referer=CGI.SCRIPT_NAME>
      <cfif CGI.QUERY_STRING NEQ "">
        <cfset MM_referer=MM_referer & "?" & CGI.QUERY_STRING>
      </cfif>
      <cfset MM_failureURL="unauthorized.cfm?accessdenied=" & URLEncodedFormat(MM_referer)>
      <cflocation url="#MM_failureURL#" addtoken="no">
    </cfif>
    <cfquery name="Update_info" datasource="Access">
    SELECT ID, FullName, FirstName, LastName, Username, Password
    FROM Logininfo
    WHERE ID=<cfoutput>#Session.ID#</cfoutput>
    </cfquery>
    <cfquery name="update_contactinfo" datasource="QBs">
    SELECT ListID, Name, FullName, CompanyName, Salutation, FirstName, LastName, BillAddressAddr1, BillAddressAddr2, BillAddressCity, BillAddressState, BillAddressPostalCode, Phone, AltPhone, Email
    FROM Customer
    WHERE ListID=<cfoutput>'#Session.ListID#'</cfoutput>
    </cfquery>
    <cfquery name="listvariables" Datasource="Access">
    SELECT Salutation FROM ListVariables
    </cfquery>
    <cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
    <cfif IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "UpdateContactInformation">
    <cfset #FistName#=Form.FirstName/>
    <cfquery datasource="QBs">
    UPDATE Customer Set
    FirstName=<cfqueryparam value='#FirstName#' cfsqltype="cf_sql_varchar" maxlength="41"/>
    WHERE ListID=<cfoutput>'#Session.ListID#'</cfoutput>
    </cfquery>
    <cfset #FirstName#=Form.FirstName/>
    <cfquery datasource="Access">
    UPDATE Logininfo Set
    FirstName=<cfqueryparam value='#FirstName#' cfsqltype="cf_sql_varchar" maxlength="41"/>
    WHERE ID=<cfoutput>#Session.ID#</cfoutput>
    </cfquery>
    <cflocation url="updated_contactinfo.cfm">
    </cfif>

  • Entering numbers into Access

    I am using an update statement to enter a number into an
    access databse where the field is set as an interger format. The
    syntax used in the update statement is order = '#form.order#',
    When this is processed I revieve the following error:
    ODBC Error Code = 37000 (Syntax error or access violation)
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in
    UPDATE statement.
    SQL = "UPDATE tbl_images SET mnname = 'Whitney Looking',
    dimensions1 = '5', dimensions2 = '7', dimmeasure = 'Inches',
    denomination = '£', price = '42.00', bgcolour = 'DADAFC',
    medium = 'Inks', order = 19, framedorunframed = 'Framed', approved
    = '0', makeimagelive = '0', subject = 'Animals' WHERE
    tbl_images.imageid=2356"
    I assume this is caused by the database recieving the number
    in a text rather than interger format.
    Could someone please let me know how I need to format the
    update statement to over come this (or whether this may be casued
    by another issue
    Thanks
    Neil

    Dan's point about using a column named "order" is most likely
    the culprit. Words like SELECT, WHERE and ORDER are reserved words
    in SQL and should be avoided as names for database fields. Try
    changing the name of your database field and running the query
    again.
    Also, I noticed the fields "approved" and "makeimagelive"
    seemed to also contain bit or integer values. Try using the same
    formatting with those fields as you did with the order field.
    In fact, you can replace all of your query values with
    <cfqueryparam> and let coldfusion decide which ones will
    received surrounding quotes based on the cfsqltype.

  • Bind in form works with cfinput, how to with cfselect and a href

    Hi all
    This code workks binding a cfinput in an HTML cfform:
    Name:<cfinput type="text" name="FIRSTNAME" label="Name" required="yes" width="150" bind="{UsersGrid.FIRSTNAME}" >
    However this href doesn't seem to bind correctly:
    <a  href="http://www.google.com/search?hl=en&output=search&sclient=psy-ab&q={UsersGrid.COMPANY}&btnK=" bind="{UsersGrid.COMPANY}">Google.com</a>
    This cfselect doesn't either:
    Department: <cfselect name="DEPARTMENT1" width="100" size="1" label="Department" required="yes" bind="UsersGrid.DEPARTMENT1">
    <option></option><cfoutput query="dNames"><option value="#DEPARTMENTIDS#">#DEPARTMENTNOM#</option></cfoutput>
    </cfselect> 
    How can I make them both work? Thank you

    Sure, Aaaron here it is, it uses the same database tables and datasource as in the other thread:
    <cfquery name="QNAMES" datasource="tester">
        select * from company, industries, division
    where company.SECTORS1 = industries.SECTORSIDS
    <cfif structKeyExists(url,"sectorid")>
    and industries.SECTORSIDS = #url.sectorid#</cfif>
    and division.DEPARTMENTIDS = company.DEPARTMENT1
    and company.WHEN = 2
    ORDER BY company</cfquery>
    <cfquery name="dNames" datasource="tester">
        select DEPARTMENTIDS, DEPARTMENTNOM
        from division
    order by DEPARTMENTNOM</cfquery>
    <CFQUERY name="industries" datasource="tester">
    SELECT * FROM industries
    </CFQUERY>
    <CFQUERY name="salesstep" datasource="tester">
    SELECT * FROM sales
    </CFQUERY>
    <CFQUERY name="xity" datasource="tester">
    SELECT * FROM ciudad
    </CFQUERY>
    <CFQUERY name="hols" datasource="tester">
    SELECT * FROM holidays
    </CFQUERY>
    <!--- UPDATE QUERY --->
    <cfif isDefined("FORM.UPDATEADDBTN")>
    <cfif FORM.ENTID GTE 1>
    <cfset isCOMPANYNull = iif(len(trim(FORM.COMPANY)) EQ 0, true, false)>
    <cfset isSECTORS1Null = iif(len(trim(FORM.SECTORS1)) EQ 0, true, false)>
    <cfset isRANKINGNull = iif(len(trim(FORM.RANKING)) EQ 0, true, false)>
    <cfset isPRICENull = iif(len(trim(FORM.PRICE)) EQ 0, true, false)>
    <cfset isDEPARTMENT1Null = iif(len(trim(FORM.DEPARTMENT1)) EQ 0, true, false)>
    <cfset isFIRSTNAMENull = iif(len(trim(FORM.FIRSTNAME)) EQ 0, true, false)>
    <cfset isPOSNull = iif(len(trim(FORM.POS)) EQ 0, true, false)>
    <cfset isPHONENull = iif(len(trim(FORM.PHONE)) EQ 0, true, false)>
    <cfset isEMAILNull = iif(len(trim(FORM.EMAIL)) EQ 0, true, false)>
    <cfset isMOBILENull = iif(len(trim(FORM.MOBILE)) EQ 0, true, false)>
    <cfset isADDRESSNull = iif(len(trim(FORM.ADDRESS)) EQ 0, true, false)>
    <cfset isCITYNull = iif(len(trim(FORM.CITY)) EQ 0, true, false)>
    <cfset isCOMMENTSNull = iif(len(trim(FORM.COMMENTS)) EQ 0, true, false)>
    <cfset MEETINGDATE = trim(FORM.ABUNDANCE)>
    <!--- DATECFM--->
    <cfset isMTGTNull = iif(len(trim(FORM.MTGT)) EQ 0, true, false)>
    <cfset isSTATE1Null = iif(len(trim(FORM.STATE1)) EQ 0, true, false)>
    <CFQUERY name="updatecompany" datasource="tester">
    update COMPANY
    SET COMPANY = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMPANY)#" null="#isCOMPANYNull#" />,
       SECTORS1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.SECTORS1)#" null="#isSECTORS1Null#" />,
       RANKING = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.RANKING)#" null="#isRANKINGNull#" />,
       PRICE = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.PRICE)#" null="#isPRICENull#" />,
       DEPARTMENT1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.DEPARTMENT1)#" null="#isDEPARTMENT1Null#" />,
       FIRSTNAME = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.FIRSTNAME)#" null="#isFIRSTNAMENull#" />,
       POS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.POS)#" null="#isPOSNull#" />,
       PHONE = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.PHONE)#" null="#isPHONENull#" />,
       EMAIL = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.EMAIL)#" null="#isEMAILNull#" />,
       MOBILE= <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MOBILE)#" null="#isMOBILENull#" />,
       ADDRESS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.ADDRESS)#" null="#isADDRESSNull#" />,
       CITY = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.CITY)#" null="#isCITYNull#" />,
       COMMENTS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMMENTS)#" null="#isCOMMENTSNull#" />,
       ABUNDANCE = <cfqueryparam cfsqltype="cf_sql_timestamp" value="#MEETINGDATE#" />,
       MTGT = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MTGT)#" null="#isMTGTNull#" />,
       STATE1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.STATE1)#" null="#isSTATE1Null#" />
    WHERE ENTID = #FORM.ENTID#
    </CFQUERY>
    <CFLOCATION URL="testht.cfm?begin=1">
    <cfelse>
    <cfset isCOMPANYNull = iif(len(trim(FORM.COMPANY)) EQ 0, true, false)>
    <cfset isSECTORS1Null   = iif(len(trim(FORM.SECTORS1)) EQ 0, true, false)>
    <cfset isRANKINGNull = iif(len(trim(FORM.RANKING)) EQ 0, true, false)>
    <cfset isPRICENull = iif(len(trim(FORM.PRICE)) EQ 0, true, false)>
    <cfset isDEPARTMENT1Null = iif(len(trim(FORM.DEPARTMENT1)) EQ 0, true, false)>
    <cfset isFIRSTNAMENull = iif(len(trim(FORM.FIRSTNAME)) EQ 0, true, false)>
    <cfset isPOSNull = iif(len(trim(FORM.POS)) EQ 0, true, false)>
    <cfset isPHONENull = iif(len(trim(FORM.PHONE)) EQ 0, true, false)>
    <cfset isEMAILNull = iif(len(trim(FORM.EMAIL)) EQ 0, true, false)>
    <cfset isMOBILENull = iif(len(trim(FORM.MOBILE)) EQ 0, true, false)>
    <cfset isADDRESSNull = iif(len(trim(FORM.ADDRESS)) EQ 0, true, false)>
    <cfset isCITYNull = iif(len(trim(FORM.CITY)) EQ 0, true, false)>
    <cfset isCOMMENTSNull = iif(len(trim(FORM.COMMENTS)) EQ 0, true, false)>
    <cfset isMTGTNull = iif(len(trim(FORM.MTGT)) EQ 0, true, false)>
    <cfset isSTATE1Null = iif(len(trim(FORM.STATE1)) EQ 0, true, false)>
    <cfset MEETINGDATE = trim(FORM.ABUNDANCE)>
    <!--- DATECFM --->
    <!--- ADD COMPANY QUERY --->
    <CFQUERY name="addcompany" datasource="tester">
    INSERT INTO COMPANY(
    COMPANY,
    SECTORS1,
    RANKING,
    PRICE,
    DEPARTMENT1,
    FIRSTNAME,
    POS,
    PHONE,
    EMAIL,
    MOBILE,
    ADDRESS,
    CITY,
    COMMENTS,
    ABUNDANCE,
    MTGT,
    STATE1
    VALUES (
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMPANY)#" null="#isCOMPANYNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.SECTORS1)#" null="#isSECTORS1Null#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.RANKING)#" null="#isRANKINGNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.PRICE)#" null="#isPRICENull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.DEPARTMENT1)#" null="#isDEPARTMENT1Null#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.FIRSTNAME)#" null="#isFIRSTNAMENull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.POS)#" null="#isPOSNull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.PHONE)#" null="#isPHONENull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.EMAIL)#" null="#isEMAILNull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MOBILE)#" null="#isMOBILENull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.ADDRESS)#" null="#isADDRESSNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.CITY)#" null="#isCITYNull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMMENTS)#" null="#isCOMMENTSNull#" />,
    <cfqueryparam cfsqltype="cf_sql_timestamp" value="#MEETINGDATE#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MTGT)#" null="#isMTGTNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.STATE1)#" null="#isSTATE1Null#" />
    </CFQUERY>
    <!---DATE_FORMAT(datetime_field_name,'%Y-%m-%d');--->
    <CFLOCATION URL="testht.cfm?begin=1">
    </cfif>
    </cfif>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>Sales</title> 
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="formst.css" type="text/css" media="screen" />
    </head>
    <cfdump var=#qnames#>
    <cfajaxproxy bind="javascript:myHandler({UsersGrid.COMPANY},{UsersGrid.SECTORS1},{UsersGrid.DEPARTMENT 1})"/>
    <script type="text/javascript">
      function myHandler(COMPANY,SECTORS1,DEPARTMENT1) {
          //update the link's href
          document.getElementById('myLink').href = 'http://www.google.com/search?q=' + COMPANY;
          document.getElementById('Linkedin').href = 'http://www.google.com/search?q=linkedin' + COMPANY;
          //update SECTORS1's selected
          var theField = document.getElementById('SECTORS1');
          for(var i=0; i<theField.options.length; i++) {
              if(theField.options[i].value==SECTORS1) {
                  theField.options[i].selected = true;
              } else {
                  theField.options[i].selected = false;
    </script>
    <!--- TOP --->
    <body>
    <div>
    <cfform name="SFORM" FORMAT="html"  width="1000" height="400" style="margin-left:140px;">
    <cfgrid name="UsersGrid"
               FORMAT="html"
               query="QNAMES" width="920" height="200" rowheaders="No" striperows="yes" striperowcolor="fefefe">
    <cfgridcolumn name="RANKING" width="40"header="Rank">
    <cfgridcolumn name="COMPANY" width="170" header="Company">
    <cfgridcolumn name="FIRSTNAME"  header="Contact Name">
    <cfgridcolumn name="POS" width="160" header="Position">
    <cfgridcolumn name="DEPARTMENTNOM" width="150" header="Department">
    <cfgridcolumn name="SECTORSNOM" width="120" header="Sectors">
    <cfgridcolumn name="ABUNDANCE" width="120" header="Action date">
    <cfgridcolumn name="SECTORS1" width="120" header="Action date" display="no">
    <cfgridcolumn name="PRICE" width="120" header="Action date" display="no">
    <cfgridcolumn name="PHONE" width="120" header="Action date" display="no">
    <cfgridcolumn name="EMAIL" width="120" header="Action date" display="no">
    <cfgridcolumn name="MOBILE" width="120" header="Action date" display="no">
    <cfgridcolumn name="ADDRESS" width="120" header="Action date" display="no">
    <cfgridcolumn name="CITY" width="120" header="Action date" display="no">
    <cfgridcolumn name="COMMENTS" width="120" header="Action date" display="no">
    <cfgridcolumn name="MTGT" width="120" header="Action date" display="no">
       </cfgrid>
    <!---FIRST--->
    <table width="880" class="stat" >
    <tr><td><cfoutput>#QNAMES.RecordCount# Companies</cfoutput></td></tr>
    <tr>
    <td>Company:<cfinput class="input" type="text" name="COMPANY" size="20" label="Company" required="yes"  bind="{UsersGrid.COMPANY}" ></td>
    <td>
    Sector:<cfselect class="input" name="SECTORS1" size="1" label="Sector" required="yes">
    <option></option><cfoutput query="industries"><option value="#SECTORSIDS#">#SECTORSNOM#</option></cfoutput></cfselect>
    </td>
    <td>Ranking:<cfinput class="input"  type="TEXT" name="RANKING" size="3" label="Ranking" bind="{UsersGrid.RANKING}" ></td>
    <td>Price:<cfinput class="input" type="TEXT" name="PRICE" size="3" label="Price" bind="{UsersGrid.PRICE}" >
    <a href="" id="myLink" target="_blank">Google</a>
    <a href="" id="Linkedin" target="_blank">Linkedin</a></td>
    </tr>
    <tr>
    <td>Department:<cfselect class="input" name="DEPARTMENT1" size="1" label="Department" required="yes">
    <option></option><cfoutput query="dNames"><option value="#DEPARTMENTIDS#">#DEPARTMENTNOM#</option></cfoutput></cfselect>
    </td>
    <td>Name:<cfinput class="input" type="text" name="FIRSTNAME" label="Name" required="yes" width="150" bind="{UsersGrid.FIRSTNAME}" ></td>
    <td>Position:<cfinput class="input" type="text" name="POS" label="Position" width="150" bind="{UsersGrid.POS}" ></td>
    <td>Phone:<cfinput class="input" type="text" name="PHONE" label="Phone" width="150" bind="{UsersGrid.PHONE}" ></td>
    </tr>
    <!--- THIRD--->
    <tr><td>Email:<cfinput class="input" type="text" name="EMAIL" label="Email" width="150" bind="{UsersGrid.EMAIL}" ></td>
    <td>Mobile:<cfinput class="input" type="text" name="MOBILE" label="Mobile"  bind="{UsersGrid.MOBILE}" ></td>
    <td>Address:<cfinput class="input" type="text" name="ADDRESS" label="Address"  bind="{UsersGrid.ADDRESS}" ></td>
    <td><cfselect class="input" name="CITY" width="80" size="1" >
    <cfoutput query="xity"><option value="#CITYID#">#CITYNOM#</option></cfoutput>
    </cfselect></td>
    </tr> 
    <!--- FOURTH --->
    <tr><td>Comments:<cftextarea class="input" name="COMMENTS" height="60"  label="Comments" bind="{UsersGrid.COMMENTS}" /> </td>
    <td>Action:<cfinput type="DateField" class="input" size="10" name="ABUNDANCE" label="Action"  bind="{UsersGrid.ABUNDANCE}" ></td>
    <td>Time:<cfselect class="input" name="MTGT" width="90" label="Time"><option>7:00AM</option></cfselect></td>
    <td><cfselect class="input" name="STATE1"  size="1" label="Action" >
    <cfoutput query="salesstep"><option value="#SALESID#">#SALESNOM#</option></cfoutput>
    </cfselect>  </td>
    <cfinput type="hidden" name="ENTID" label="ENTID" bind="{UsersGrid.ENTID}" >
    </tr>
    <tr> <td> 
    <cfinput type="submit" name="DELCOM" value="delete" class="button" >
    <cfinput type="submit" name="UPDATEADDBTN" value="UPDATE or ADD NEW" class="button"></td>
    </tr>
    </table>
    </cfform>
    <cfif isDefined("FORM.DELCOM")>
    <CFQUERY name="deletecompany" datasource="tester">
    DELETE FROM COMPANY
    WHERE ENTID = #FORM.ENTID#
    </CFQUERY>
    <CFLOCATION URL="testht.cfm">
    </cfif>
    </div>
    </body>
    </html>

  • CFINPUT with datefield type issue

    I have a personal information form that has a hire date entry
    field. I would like to make the field optional, yet I have to enter
    a hire date as I get an error if I dont. The database autofills the
    hire date field with the word "null" so if I submit the form
    without entering a date, I get an error message saying: "Error
    "null" is an invalud date or time string."
    Also, in my database, I have Hire Date as a type DATE, null
    is selected, and default is 0000-00-00. On a side note, even though
    I have 0000-00-00 entered as the default, the word "null" still
    populates the hire date field on the page.
    Here is my code:
    <cfformgroup type="horizontal" visible="yes" enabled="yes"
    style="marginLeft:-74;" >
    <cfinput type="Datefield" name="HireDate" label="Hire
    Date:" width="80" bind="{contactList.selectedItem.HireDate}"
    onchange="UpdateSelect(HireDate, selectYear1);"/>
    <cfselect name="selectYear1" width="80" label=""
    onchange="setStartYear(HireDate, selectYear1);">
    <cfoutput>
    <option value="">Pick Year</option>
    <cfloop index="i" from="1935" to="#thisyear#">
    <option value="#i#">#i#</option>
    </cfloop>
    </cfoutput>
    </cfselect>
    </cfformgroup>
    Any help with this problem would be much appreciated.
    Thanks,
    Nick Butler

    Hi Nick,
    I am not sure which insert method you are using for inserting
    your form information into the database. I prefer to insert
    my
    form information via a <cfquery>.
    Below is the code I use in my forms and have not encountered
    any issues with blank date fields being inserted into a DB.
    <cfquery name="qry_name" datasource="yourdatasource">
    Insert Into tbl_name (
    db_field,
    hiredate,
    db_field)
    Values(
    nullif(<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#form.form_field#">,''),
    nullif(<cfqueryparam cfsqltype="CF_SQL_DATE"
    value="#form.hiredate#">,''),
    nullif(<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#form.form_field#">,'')
    </cfquery>
    With the above code, should the person leave the hire date
    field blank, it will
    insert a null value into the db field. If the person enters a
    date, it will insert the
    date into the db field formatted as yyyy-mm-dd.
    Leonard B

  • Error NEED HELP ASAP!!

    I get this error. I belvie it is refering to this code below
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave, supervisor, description) VALUES('TRY2WitterMay-16-2013', '!' at line 1
    <cfif not form.company1 is "">
    <cfquery username='#username#' password='#password#'  datasource='#datasource#'>
              INSERT INTO jobappemp(jobappid, company, busphone, empfromdate, emptodate, startwage, endwage, leave, supervisor, description)
         VALUES(<cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#jobappid#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.company1#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.busphone1#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.empfromdate1#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.emptodate1#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.startwage1#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.endwage1#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.leave1#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.supervisor1#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.DESCRIPTION1#"/>)
    </CFQUERY>
    </cfif>
    <cfif not form.company2 is "">
    <cfquery username='#username#' password='#password#'  datasource='#datasource#'>
              INSERT INTO jobappemp(jobappid, company, busphone, empfromdate, emptodate, startwage, endwage, leave, supervisor, description)
              VALUES(<cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#jobappid#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.company2#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.busphone2#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.employfromdate2#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.employtodate2#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.startwage2#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.endwage2#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.leave2#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.supervisor2#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.description2#"/>)
    </CFQUERY>
    </cfif>
    <cfif not form.company3 is "">
    <cfquery username='#username#' password='#password#'  datasource='#datasource#'>
              INSERT INTO jobappemp(jobappid, company, busphone, empfromdate, emptodate, startwage, endwage, leave, supervisor, description)
              VALUES(<cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#jobappid#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.company3#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.busphone3#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.employfromdate3#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.employtodate3#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.startwage3#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.endwage3#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.leave3#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.supervisor3#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.description3#"/>)
    </CFQUERY>
    </cfif>
    <cfif not form.company4 is "">
    <cfquery username='#username#' password='#password#'  datasource='#datasource#'>
              INSERT INTO jobappemp(jobappid, company, busphone, empfromdate, emptodate, startwage, endwage, leave, supervisor, description)
              VALUES(<cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#jobappid#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.company4#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.busphone4#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.employfromdate4#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.employtodate4#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.startwage4#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.endwage4#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.leave4#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.supervisor4#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.description4#"/>)
    </CFQUERY>
    </cfif>
    <cfif not form.company5 is "">
    <cfquery username='#username#' password='#password#'  datasource='#datasource#'>
              INSERT INTO jobappemp(jobappid, company, busphone, empfromdate, emptodate, startwage, endwage, leave, supervisor, description)
              VALUES(<cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#jobappid#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.company5#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.busphone5#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.employfromdate5#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.employtodate5#"/>,
        <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.startwage5#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.endwage5#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.leave5#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.supervisor5#"/>,
         <cfqueryparam cfsqltype="cf_sql_varchar" VALUE="#form.description5#"/>)
    </CFQUERY>
    </cfif>

    struct
    Cause
    struct
    ErrorCode
    1064
    Message
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave, supervisor, description) VALUES('REEEESMay-16-2013', '#',' at line 1
    SQLState
    42000
    StackTrace
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave, supervisor, description) VALUES('REEEESMay-16-2013', '#',' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java: 39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm pl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1021) at coldfusion.server.j2ee.sql.JRunPreparedStatement.execute(JRunPreparedStatement.java:91) at coldfusion.sql.Executive.executeQuery(Executive.java:1245) at coldfusion.sql.Executive.executeQuery(Executive.java:1008) at coldfusion.sql.Executive.executeQuery(Executive.java:939) at coldfusion.sql.SqlImpl.execute(SqlImpl.java:341) at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:843) at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:533) at cfjobapp_process2ecfm454558273._factor9(E:\InetPub\imperialind\includes\jobapp_process.cf m:101) at cfjobapp_process2ecfm454558273._factor22(E:\InetPub\imperialind\includes\jobapp_process.c fm:99) at cfjobapp_process2ecfm454558273._factor24(E:\InetPub\imperialind\includes\jobapp_process.c fm:1) at cfjobapp_process2ecfm454558273.runPage(E:\InetPub\imperialind\includes\jobapp_process.cfm :1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfcontent2ecfm1009021074.runPage(E:\InetPub\imperialind\content.cfm:86) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfindex2dold2ecfm2038289319.runPage(E:\InetPub\imperialind\index-old.cfm:225) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:363) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:87) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53) at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126) at coldfusion.CfmServlet.service(CfmServlet.java:200) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 ) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    TagContext
    array
    1
    struct
    COLUMN
    0
    ID
    CFQUERY
    LINE
    101
    RAW_TRACE
    at cfjobapp_process2ecfm454558273._factor9(E:\InetPub\imperialind\includes\jobapp_process.cf m:101)
    TEMPLATE
    E:\InetPub\imperialind\includes\jobapp_process.cfm
    TYPE
    CFML
    2
    struct
    COLUMN
    0
    ID
    CF_JOBAPP_PROCESS
    LINE
    99
    RAW_TRACE
    at cfjobapp_process2ecfm454558273._factor22(E:\InetPub\imperialind\includes\jobapp_process.c fm:99)
    TEMPLATE
    E:\InetPub\imperialind\includes\jobapp_process.cfm
    TYPE
    CFML
    3
    struct
    COLUMN
    0
    ID
    CF_JOBAPP_PROCESS
    LINE
    1
    RAW_TRACE
    at cfjobapp_process2ecfm454558273._factor24(E:\InetPub\imperialind\includes\jobapp_process.c fm:1)
    TEMPLATE
    E:\InetPub\imperialind\includes\jobapp_process.cfm
    TYPE
    CFML
    4
    struct
    COLUMN
    0
    ID
    CF_JOBAPP_PROCESS
    LINE
    1
    RAW_TRACE
    at cfjobapp_process2ecfm454558273.runPage(E:\InetPub\imperialind\includes\jobapp_process.cfm :1)
    TEMPLATE
    E:\InetPub\imperialind\includes\jobapp_process.cfm
    TYPE
    CFML
    5
    struct
    COLUMN
    0
    ID
    CFINCLUDE
    LINE
    86
    RAW_TRACE
    at cfcontent2ecfm1009021074.runPage(E:\InetPub\imperialind\content.cfm:86)
    TEMPLATE
    E:\InetPub\imperialind\content.cfm
    TYPE
    CFML
    6
    struct
    COLUMN
    0
    ID
    CFINCLUDE
    LINE
    225
    RAW_TRACE
    at cfindex2dold2ecfm2038289319.runPage(E:\InetPub\imperialind\index-old.cfm:225)
    TEMPLATE
    E:\InetPub\imperialind\index-old.cfm
    TYPE
    CFML
    Type
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
    DataSource
    imperial
    Detail
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave, supervisor, description) VALUES('REEEESMay-16-2013', '#',' at line 1
    ErrorCode
    42000
    Message
    Error Executing Database Query.
    NativeErrorCode
    1064
    RootCause
    struct
    ErrorCode
    1064
    Message
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave, supervisor, description) VALUES('REEEESMay-16-2013', '#',' at line 1
    SQLState
    42000
    StackTrace
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave, supervisor, description) VALUES('REEEESMay-16-2013', '#',' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java: 39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm pl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1021) at coldfusion.server.j2ee.sql.JRunPreparedStatement.execute(JRunPreparedStatement.java:91) at coldfusion.sql.Executive.executeQuery(Executive.java:1245) at coldfusion.sql.Executive.executeQuery(Executive.java:1008) at coldfusion.sql.Executive.executeQuery(Executive.java:939) at coldfusion.sql.SqlImpl.execute(SqlImpl.java:341) at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:843) at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:533) at cfjobapp_process2ecfm454558273._factor9(E:\InetPub\imperialind\includes\jobapp_process.cf m:101) at cfjobapp_process2ecfm454558273._factor22(E:\InetPub\imperialind\includes\jobapp_process.c fm:99) at cfjobapp_process2ecfm454558273._factor24(E:\InetPub\imperialind\includes\jobapp_process.c fm:1) at cfjobapp_process2ecfm454558273.runPage(E:\InetPub\imperialind\includes\jobapp_process.cfm :1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfcontent2ecfm1009021074.runPage(E:\InetPub\imperialind\content.cfm:86) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfindex2dold2ecfm2038289319.runPage(E:\InetPub\imperialind\index-old.cfm:225) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:363) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:87) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53) at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126) at coldfusion.CfmServlet.service(CfmServlet.java:200) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 ) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    TagContext
    array
    1
    struct
    COLUMN
    0
    ID
    CFQUERY
    LINE
    101
    RAW_TRACE
    at cfjobapp_process2ecfm454558273._factor9(E:\InetPub\imperialind\includes\jobapp_process.cf m:101)
    TEMPLATE
    E:\InetPub\imperialind\includes\jobapp_process.cfm
    TYPE
    CFML
    2
    struct
    COLUMN
    0
    ID
    CF_JOBAPP_PROCESS
    LINE
    99
    RAW_TRACE
    at cfjobapp_process2ecfm454558273._factor22(E:\InetPub\imperialind\includes\jobapp_process.c fm:99)
    TEMPLATE
    E:\InetPub\imperialind\includes\jobapp_process.cfm
    TYPE
    CFML
    3
    struct
    COLUMN
    0
    ID
    CF_JOBAPP_PROCESS
    LINE
    1
    RAW_TRACE
    at cfjobapp_process2ecfm454558273._factor24(E:\InetPub\imperialind\includes\jobapp_process.c fm:1)
    TEMPLATE
    E:\InetPub\imperialind\includes\jobapp_process.cfm
    TYPE
    CFML
    4
    struct
    COLUMN
    0
    ID
    CF_JOBAPP_PROCESS
    LINE
    1
    RAW_TRACE
    at cfjobapp_process2ecfm454558273.runPage(E:\InetPub\imperialind\includes\jobapp_process.cfm :1)
    TEMPLATE
    E:\InetPub\imperialind\includes\jobapp_process.cfm
    TYPE
    CFML
    5
    struct
    COLUMN
    0
    ID
    CFINCLUDE
    LINE
    86
    RAW_TRACE
    at cfcontent2ecfm1009021074.runPage(E:\InetPub\imperialind\content.cfm:86)
    TEMPLATE
    E:\InetPub\imperialind\content.cfm
    TYPE
    CFML
    6
    struct
    COLUMN
    0
    ID
    CFINCLUDE
    LINE
    225
    RAW_TRACE
    at cfindex2dold2ecfm2038289319.runPage(E:\InetPub\imperialind\index-old.cfm:225)
    TEMPLATE
    E:\InetPub\imperialind\index-old.cfm
    TYPE
    CFML
    Type
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
    SQLState
    42000
    Sql
    INSERT INTO jobappemp(jobappid, company, busphone, empfromdate, emptodate, startwage, endwage, leave, supervisor, description) VALUES( (param 1) , (param 2) , (param 3) , (param 4) , (param 5) , (param 6) , (param 7) , (param 8) , (param 9) , (param 10) )
    StackTrace
    coldfusion.tagext.sql.QueryTag$DatabaseQueryException: Error Executing Database Query. at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:595) at cfjobapp_process2ecfm454558273._factor9(E:\InetPub\imperialind\includes\jobapp_process.cf m:101) at cfjobapp_process2ecfm454558273._factor22(E:\InetPub\imperialind\includes\jobapp_process.c fm:99) at cfjobapp_process2ecfm454558273._factor24(E:\InetPub\imperialind\includes\jobapp_process.c fm:1) at cfjobapp_process2ecfm454558273.runPage(E:\InetPub\imperialind\includes\jobapp_process.cfm :1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfcontent2ecfm1009021074.runPage(E:\InetPub\imperialind\content.cfm:86) at coldfusion.runtime.

  • Storing Uploaded Audio Files in Your Database

    I have been using the cffile tag to upload files into a
    directory on the server and then writing the details of that file
    into a database, but I would like to now instead of uploading and
    writing the file to a directory, I would like to write that file
    into a field of a database table and then call it out later to
    listen to it or view it.
    Does anyone have any experience with writing a file into a
    database along with it's file details and then code to read it out
    and display the file details and view or listen to the file?
    I'm guessing that I would need a field in the database table
    that is a byte array, data type "image" to hold the file and then
    the other fields would be "type" "varchar" to hold the details of
    the file.
    MySQL or SQL Server are my choices of databases.
    Thank you!
    Tom

    You should have a blob type column (In oracle) to save the
    content ..
    First upload the file to webserver
    <cffile action="upload"
    filefield="form.FileName"
    destination="C:\temp\"
    nameconflict="makeunique" >
    Convert the same to binary
    <cffile
    action = "readbinary"
    file = "C:\temp\#cffile.serverFile#"
    variable="file_blob">
    insert statement
    insert into files (FILE_ID,file_content)
    values (7,
    <cfqueryparam
    value="#file_blob#"
    cfsqltype="cf_sql_blob">
    delete the file from the server
    <cffile
    action="delete"
    file="C:\temp\#cffile.serverFile#">

  • Account activation sample code

    I am building a web site www.chinafriendclub.com by
    ColdFusion. I want to build a feature that the new user needs to
    activate his/her account and verify his/her e-mail address by going
    into his/her email account to click the link after he creates an
    account from my website before he uses it. Do you know any
    coldfusion sample code available? or suggestion sample code copy
    and paste to me.
    Ed

    Here's roughly what you have to do.
    In your user database table, create a verfied" field for
    activation, such as Yes/No in Access, or a numeric field.
    Create an additional text field 35 characters in length. name
    it verfication_code.
    <cfset verify = CreateUUID()>
    <cfquery datasource="MyUsers">
    insert into users
    (username,email,verified,verification_code)
    values
    <cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.username#">,
    <cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.email#">,
    <cfqueryparam cfsqltype="cf_sql_numeric" value="0">,
    <cfqueryparam cfsqltype="cf_sql_varchar"
    value="#verify#">
    </cfquery>
    Then use the cfmail tag to send the verify code as a url
    parameter in the link.
    On the return trip, search for the username and verification
    code
    <cfquery name="qryValidation" datasource="MyUsers">
    select * from users where
    verification_code = <cfqueryparam
    cfsqltype="cf_sql_varchar" maxlength="35"
    value="#url.verification_code#">
    and username = <cfqueryparamcfsqltype="cf_sql_varchar"
    value="#url.username#">
    </cfquery>
    If the return result matches a record, update the verified
    attribute.
    <cfif qryValidation.RecordCount gt 0>
    <!--- peform the update etc... --->
    </cfif>

  • CF10 odbc server locking up

    We're using CF10 on 2008R2 - with about 25 MS Access DB's running. Our problem started yesterday when the odbc server would lockup and require a reboot to get thing rolling again.  After the reboot everything was fine for about 8hrs then the process started all over again.
    Looked in the application log and this is the error that started it all.
    Error Executing Database Query.[Macromedia][SequeLink JDBC Driver]Network problem, session aborted due to internal error in remote procedure call, connection closed. The specific sequence of files included or processed is:

    First up, get your syntax up to date
    <CFSET ThisMonth = Month( Now())>
    <CFSET ThisDay = Day(Now())>
    <CFSET ThisYear = Year(Now())>
    <cfinclude template="Navigation.cfm">
    <CFOUTPUT>Inserting Mail on
    #SetServerDesc#</CFOUTPUT><br>
    <cfdirectory action="list"
    directory="c:\cfusionmx\mail\undelivr\FromWEB1" name="Files"
    sort="datelastmodified desc">
    <CFLOOP query="Files">
    <CFPARAM name="InsertCount" default="0">
    <cffile action="read"
    file="c:\cfusionmx\mail\undelivr\fromWEB1\#Files.Name#"
    variable="FileRead">
    <CFQUERY name="InsMail" datasource="#Request.DSN#">
    Insert Into _UndelivrEmail(
    UE_Attributes
    ,UE_DateLastModified
    ,UE_Mode
    ,UE_Name
    ,UE_FileSize
    ,UE_Type
    ,UE_ServerDesc
    ,UE_EmailBody
    )Values(
    <cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Attributes#">
    ,<cfqueryparam cfsqltype="CF_SQL_TIMESTAMP"
    value="#Files.DateLastModified#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Mode#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Name#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Size#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Type#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#SetServerDesc#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#FileRead#">
    </CFQUERY>
    <CFSET InsertCount = InsertCount + 1>
    </CFLOOP>
    now..
    How many files are you looping through here: <CFLOOP
    query="Files">
    Next Check the server logs to see whats up. you should be
    able to loop through houndreds of files like that, and the insert
    should be near instant, so besides a few seconds wait if there are
    a TON of files, i can't see anything wrong ...i son't
    think....

  • MX 7 Server Locking Up

    I just installed the Hotfix for Cross Site Scripting and ever
    since then my server locks up daily. Any ideas how to resolve this
    or revers the hotfix?

    First up, get your syntax up to date
    <CFSET ThisMonth = Month( Now())>
    <CFSET ThisDay = Day(Now())>
    <CFSET ThisYear = Year(Now())>
    <cfinclude template="Navigation.cfm">
    <CFOUTPUT>Inserting Mail on
    #SetServerDesc#</CFOUTPUT><br>
    <cfdirectory action="list"
    directory="c:\cfusionmx\mail\undelivr\FromWEB1" name="Files"
    sort="datelastmodified desc">
    <CFLOOP query="Files">
    <CFPARAM name="InsertCount" default="0">
    <cffile action="read"
    file="c:\cfusionmx\mail\undelivr\fromWEB1\#Files.Name#"
    variable="FileRead">
    <CFQUERY name="InsMail" datasource="#Request.DSN#">
    Insert Into _UndelivrEmail(
    UE_Attributes
    ,UE_DateLastModified
    ,UE_Mode
    ,UE_Name
    ,UE_FileSize
    ,UE_Type
    ,UE_ServerDesc
    ,UE_EmailBody
    )Values(
    <cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Attributes#">
    ,<cfqueryparam cfsqltype="CF_SQL_TIMESTAMP"
    value="#Files.DateLastModified#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Mode#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Name#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Size#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Type#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#SetServerDesc#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#FileRead#">
    </CFQUERY>
    <CFSET InsertCount = InsertCount + 1>
    </CFLOOP>
    now..
    How many files are you looping through here: <CFLOOP
    query="Files">
    Next Check the server logs to see whats up. you should be
    able to loop through houndreds of files like that, and the insert
    should be near instant, so besides a few seconds wait if there are
    a TON of files, i can't see anything wrong ...i son't
    think....

  • Server locking up

    Hi all,
    The following code locks up my server when there are several
    messages to read (works fine if theres only 10 or so). Should I be
    using the <CFLOCK> tag with this??
    Thanks
    <CFSET ThisMonth = "#DatePart('m', Now())#">
    <CFSET ThisDay = "#DatePart('d', Now())#">
    <CFSET ThisYear = "#DatePart('yyyy', Now())#">
    <cfinclude template="Navigation.cfm">
    <CFOUTPUT>Inserting Mail on
    #SetServerDesc#</CFOUTPUT><br>
    <cfdirectory action="list"
    directory="c:\cfusionmx\mail\undelivr\FromWEB1" name="Files"
    sort="datelastmodified desc">
    <CFLOOP query="Files">
    <CFPARAM name="InsertCount" default="0">
    <cffile action="read"
    file="c:\cfusionmx\mail\undelivr\fromWEB1\#Files.Name#"
    variable="FileRead">
    <CFQUERY name="InsMail" datasource="#Request.DSN#">
    Insert Into _UndelivrEmail
    (UE_Attributes,UE_DateLastModified,UE_Mode,UE_Name,UE_FileSize,UE_Type,UE_ServerDesc,UE_E mailBody)
    Values('#Files.Attributes#','#Files.DateLastModified#','#Files.Mode#','#Files.Name#','#Fi les.Size#','#Files.Type#','#SetServerDesc#','#FileRead#')
    </CFQUERY>
    <CFSET InsertCount = "#Evaluate(InsertCount +1)#">
    </CFLOOP>

    First up, get your syntax up to date
    <CFSET ThisMonth = Month( Now())>
    <CFSET ThisDay = Day(Now())>
    <CFSET ThisYear = Year(Now())>
    <cfinclude template="Navigation.cfm">
    <CFOUTPUT>Inserting Mail on
    #SetServerDesc#</CFOUTPUT><br>
    <cfdirectory action="list"
    directory="c:\cfusionmx\mail\undelivr\FromWEB1" name="Files"
    sort="datelastmodified desc">
    <CFLOOP query="Files">
    <CFPARAM name="InsertCount" default="0">
    <cffile action="read"
    file="c:\cfusionmx\mail\undelivr\fromWEB1\#Files.Name#"
    variable="FileRead">
    <CFQUERY name="InsMail" datasource="#Request.DSN#">
    Insert Into _UndelivrEmail(
    UE_Attributes
    ,UE_DateLastModified
    ,UE_Mode
    ,UE_Name
    ,UE_FileSize
    ,UE_Type
    ,UE_ServerDesc
    ,UE_EmailBody
    )Values(
    <cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Attributes#">
    ,<cfqueryparam cfsqltype="CF_SQL_TIMESTAMP"
    value="#Files.DateLastModified#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Mode#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Name#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Size#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#Files.Type#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#SetServerDesc#">
    ,<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#FileRead#">
    </CFQUERY>
    <CFSET InsertCount = InsertCount + 1>
    </CFLOOP>
    now..
    How many files are you looping through here: <CFLOOP
    query="Files">
    Next Check the server logs to see whats up. you should be
    able to loop through houndreds of files like that, and the insert
    should be near instant, so besides a few seconds wait if there are
    a TON of files, i can't see anything wrong ...i son't
    think....

  • What is mean?AND bar = cfqueryparam value="#attributes.bar#" /

    what is mean?
    AND bar = <cfqueryparam value="#attributes.bar#" />
    </cfquery>
    <cfset attributes.isFooBar = (foo.recordCount neq 0) />
    of
    <cfquery name="foo" datasource="#request.DSN#">
    SELECT
    id
    FROM
    foobar
    WHERE 1 = 1
    AND bar = <cfqueryparam value="#attributes.bar#" />
    </cfquery>
    <cfset attributes.isFooBar = (foo.recordCount neq 0)
    />

    Basically you have a query "foo". It is pulling "id" from the
    table "foobar" where an attribute was passed into the template.
    "attributes.bar"
    Then you are doing a true/false on the recordcount. If it is
    0 you get 0 otherwise you get 1.

Maybe you are looking for

  • T-code:FB60 and MIRO business place validation Section Code mandatory

    Hi, My requirement is to make mandatory in MIRO and FB60  field: BUPLA-business place and field:SECCO-Section Code. I have done validation through GGB0 . i am facing problem prerequisite: syst-tcode = 'FB60' check bseg-bupla   <>   ' ' and  bseg-secc

  • Siebel UCM (OCH) is overwriting the Contact changes done by external system

    Hi All, We are using UCM for Contact data management. One external system is updating Contact data in UCM through inbound WS. But in Logs, we observed that first it is updating Contact data with values from external system but secondly it is automati

  • HD Video Delay Issues in CS3 Vieo Capture

    I am using CS3. I am having a problem. I have an issue with video capture. Here is my setup.... Canon XH A1 Camcorder Set to: HDV60i Adobe Premier CS3 I'm using the Capture (F5) video option. My video in the capture window is running about 1/2 a seco

  • Problem with uploading scripts and fade effects

    I am a new user of Dreamweaver,I made a simple page with a jpg and added fade in effect and a flash intro song,,it shows all in firefox off line but when I upload the files to my hosting server I only see the background color?Any help please?

  • How to get an XMLBean off the jms queue

              Hello all,           I think I can post an XMLBean to a JMS queue, but how to I read it off the JSM           queue from within a MDB?           When I cast the message from the onMessage(Message msg) event to my XMLBEan, I           get a