CFUPDATE error
I have a pretty straigtforward form being used both for
Insert *and* for Update, using variables for the formfield data.
The table is 'tblPeople' and it has typical Lastname, Firstname,
email, password, LevelID (a number), comments, ExpiryDate, Created,
LastUpdated. They are all text fields except the one noted number
and the last 3 which are dates.
The CFInsert works fine.
The CFUpdate throws the following error:
Error Executing Database Query.
Syntax error in UPDATE statement.
The error occurred in
C:\CFusionMX7\wwwroot\geeks\admin\tblpeople\actions.cfm: line 4
2 : <cfset EditMode=IsDefined("FORM.PersonID")>
3 : <cfif EditMode>
4 : <cfupdate datasource="#REQUEST.DSN#"
tablename="tblPeople">
5 : <cflocation url="index.cfm">
6 : <cfelse>
SQL update tblPeople set LASTNAME= (param 1) ,FIRSTNAME=
(param 2) ,COMMENTS= (param 3) ,PASSWORD= (param 4) ,EMAIL= (param
5) ,CREATED= (param 6) ,LEVELID= (param 7) ,TOPICS= (param 8)
,LASTUPDATED= (param 9) ,EXPIRYDATE= (param 10) where PersonID=
(param 11)
When I do a cfdump on the form that is passed, here's what I
get:
struct
COMMENTS comments here
CREATED 06/06/2006
EMAIL [email protected]
EXPIRYDATE 05/05/2005
FIELDNAMES
LASTNAME,FIRSTNAME,EMAIL,TOPICS,PASSWORD,LEVELID,COMMENTS,EXPIRYDATE,CREATED,LASTUPDATED, PERSONID
FIRSTNAME Suzy
LASTNAME Jones
LASTUPDATED 07/07/2007
LEVELID 5
PASSWORD [empty string]
PERSONID 222
TOPICS [empty string]
Everything looks right to me, I just don't know what else to
check.
any ideas?
If you are using an Access db, your problem might be that
password is a reserved word. Also your date is not in an odbc style
format.
Similar Messages
-
CF8 cfinsert / cfupdate Error
OS: Windows Server 2003
CF: CF8 Enterprise 8.0.1
DB: 10g
There are two problems:
** NOTE: NEITHER OF THE TWO ERRORS BELOW HAPPEN IN COLDFUSION
7, ONLY IN VERSION 8. **
(1) Inserting new database records using cfinsert.
For certain tables, when attempting to insert a new record
using cfinsert, the following error is displayed:
[Macromedia][Oracle JDBC Driver]Internal error: Net8 protocol
error.
This only happens some database tables and not on others
(most seem to work, only a couple do not). The basic configuration
of all the tables tested is the same (a primary key exists). The
table is being referred to in all upper-case in the cfinsert tag,
as is required for an Oracle DB. Using an insert inside a cfquery
tag works fine. Also, deleting all data out of the table allows one
cfinsert to work correctly, with subsequent attempts causing the
error.
(2) Updating an existing database record using cfupdate.
For certain tables, when attempting to update an existing
record cfupdate, the following error is displayed:
An error occurred during the update process. Error code: The
primary key for the IRCCO table was not found in the '' datasource.
/// Ensure that the table name is in the format that the database
server expects. (For example. Oracle Server table name must be
uppercase or the server table name must be qualified in the format
"schema.table_name". For SQL Server, the format is
"databasename.username.tablename", for example,
customers.dbo.orders)
This only happens on some database tables and not on others
with a similar configuration (the same tables with the cfinsert
problem). The tables associated with the error do in fact have a
primary key, so I'm not sure why the error above indicates
otherwise. Using and update inside a cfquery tag seems to work
fine.
(I have a tech-support case, 0180152620, open for these
issues right now. I just wanted to see if anyone else out there had
seen this problem and perhaps fixed it.)That may be true, but the cfinsert/cfupdate tags afford us
the opportunity to do some framework-level automation across
multiple "modules" in our product. I suppose we could write our own
tags/code to do the dynamic-SQL ourselves (we've actually written
our own pre-processor tag for cfquery), but it would be great if
the cfinsert/cfupdate tags just worked as well as they do in CF7
now. (It would also seem to obviate what would seem to be a primary
reason for using CF in first place.) -
CFUPDATE Query Error **Help**
Ok, I am at a serious loss and am getting a headache trying to
figure out what exactly is wrong with this simple code. I have a
form that pulls information from a database and allows users to
update the information. The code for that page is:
<CFQUERY NAME="editmessage" DATASOURCE="subscriptions">
SELECT *
FROM tbl_Messages
WHERE messageID = #URL.messageID#
</CFQUERY>
<head>
<title><CFOUTPUT>#editmessage.type#
Editor</CFOUTPUT></title>
<style type="text/css">
<!--
.style38 {font-size: 14px}
.style39 {font-family: Arial, Helvetica, sans-serif}
.style40 {font-size: 16px; }
-->
</style>
<body bgcolor="FFFFFF" text="000000">
<CFOUTPUT query="editmessage">
<form name="form" method="post"
action="updatemessage.cfm">
<table width="900" border="0" align="center"
cellpadding="5" cellspacing="0">
<tr>
<td> </td>
<td>[<a href="menu.cfm">Back to menu</a>]
[<a href="logout.cfm">Logout</a>] </td>
</tr>
<tr>
<td width="25%"><div align="right"
class="style40"><span
class="style39">Type:</span></div></td>
<td width="75%">
<input name="Type" type="text" value="#Type#"
size="50">
<span class="style38"></span></td>
</tr>
<tr>
<td width="25%"><div align="right"
class="style40"><span
class="style39">From:</span></div></td>
<td width="75%"><span class="style38">
<input name="From" type="text" value="#From#"
size="50">
</span></td>
</tr>
<tr>
<td width="25%"><div align="right"
class="style40"><span
class="style39">Subject:</span></div></td>
<td width="75%"><span class="style38">
<input name="Subject" type="text" value="#Subject#"
size="50">
</span></td>
</tr>
<tr>
<td width="25%" valign="top"><div align="right"
class="style40"><span
class="style39">Body:</span></div></td>
<td width="75%"><span class="style38">
<textarea name="Body" cols="90"
rows="10">#Body#</textarea>
</span></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" value="Update">
</div></td>
</tr>
</table>
</form>
</CFOUTPUT>
</body>
Then on the page it posts to, I have the simple code of:
<CFUPDATE datasource="subscriptions"
tablename="tbl_Messages">
However, I keep getting an error stating there is a syntax error
in my update query code and I'm clueless as to why. I have tried
several different things, but to no help. Please let me know what I
am doing wrong. Thank you in advance.I am actually using this code now, as I have seen other issues
in the forums with CFUPDATE:
<CFQUERY NAME="UpdateMessage"
DATASOURCE="subscriptions">
UPDATE tbl_Messages
SET From = '#Form.mesFrom#',
Subject = '#Form.mesSubject#',
Body = '#Form.mesBody#'
WHERE Type = '#Form.mesType#'
</CFQUERY>
However, it is still returning an error and all it states in the
CF log files is:
Error Executing Database Query.[Macromedia][SequeLink JDBC
Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver]
Syntax error in UPDATE statement. The specific sequence of files
included or processed is:
C:\websites\docs\subscriptions\updatemessage.cfm
I tried turning debugging on to specify exactly what is wrong,
but I'm not getting anything :(.....I did rename the field names
becuase I was unsure if they were creating the problem, but
again...no help -
after calling cfupdate tag it raise following erro
The ISUSERDATAUPDATED fieldname cannot be found in the Users table
while 'ISUSERDATAUPDATED ' is a control name in form.
I am using following code
<CFIF ID GT 0>
<CFUPDATE DATASOURCE="#Application.DSN#" TABLENAME="Users" FORMFIELDS="#ColNames#">Coldfusion displays the following error in Stack Trace.
coldfusion.tagext.sql.InsertTag$FieldNameNotFoundException: The ISUSERDATAUPDATED fieldname cannot be found in the Users table -
Problem with CFUPDATE porting from CF4 to CF7
Hi, I am porting a site from CF4.1 to CF7 and am getting the
following error in the site.
Error Occurred While Processing Request
The given fieldname "STYLE" could not be found in the table
"OBJECTS".
The error occurred in doeditobject.cfm: line 19
18 : <CFIF SITEADMINPERMS is True OR SECTIONADMINPERMS is
True OR EDITPERMS is True>
19 : <CFUPDATE DATASOURCE="#SITENAME#" TABLENAME="OBJECTS"
FORMFIELDS="TEXT,TITLE,LINK">
20 : <CFLOCATION
URL="main.cfm?Action=editobject&SID=#Form.SID#&LID=#URL.LID#&EDITTYPE=#URL.EDITTYPE#">
21 : <CFELSE>
STYLE is not given as a fieldname so I don't understand where
to start with this error.
Any thoughts. I know that I have not provided a lot of
information but I am not sure what is relevant to this error.
The three form fields mentioned contain text. TEXT field
contains HTML to be written to the database.
Thanks in advance for any help.
Sean.My guess is it has something to do with the HTML. There may
be a <style> tage that is causing the problem.
Any chance you can just write the insert statement? -
Update Error Without any Reason.
I have a Code which is i think is fine, Irun it give Syntax
error in Update Statement:
The code I am Trying to do is:
<CFIF NOT isDefined ("URL.clientUserLookupID")>
<CFLOCATION url="list.cfm" addtoken=no>
</CFIF>
<CFQUERY name=clientUserInfo
datasource="#Application.data#">
SELECT tblclientUserLookup.clientUserLookupID,
tblclientUserLookup.ClientID, tblUsers.username, tblUsers.password,
tblUsers.UserEmail, tblUsers.UserID
FROM tblclientUserLookup, tblUsers
WHERE tblclientUserLookup.clientUserLookupID =
#URL.clientUserLookupID#
AND tblUsers.UserID = tblclientUserLookup.UserID
</CFQUERY>
<CFQUERY name=AttachedSearchesInfo
datasource="#Application.data#">
SELECT tblSearches.SearchID
FROM tblclientUserSearchLookup, tblSearches
WHERE tblclientUserSearchLookup.clientUserLookupID =
#URL.clientUserLookupID#
AND tblclientUserSearchLookup.SearchID =
tblSearches.SearchID
</CFQUERY>
<CFSET AttachedSearchList = "">
<CFLOOP query=AttachedSearchesInfo>
<CFSET AttachedSearchList =
ListAppend("#AttachedSearchList#", "#SearchID#")>
</CFLOOP>
<CFQUERY name=ClientInfo
datasource="#Application.data#">
SELECT Name
FROM tblClients
WHERE ClientID = #clientUserInfo.ClientID#
</CFQUERY>
<CFQUERY name=SearchInfo
datasource="#Application.data#">
SELECT *
FROM tblSearches
WHERE ClientID = #clientUserInfo.ClientID#
</CFQUERY>
<CFINCLUDE template="../../header.cfm">
<CFOUTPUT>
<p><b>client EXTRANET ACCOUNT : Modify
'#ClientInfo.Name#' ACCOUNT</b></p>
</CFOUTPUT>
<CFFORM action="data/update.cfm" method=post>
<CFOUTPUT query=clientUserInfo>
<table>
<tr>
<td align=right class=AdminField>
Username
</td>
<td>
<CFINPUT type=text name="username" value="#username#"
required=yes message="You must enter a Username.">
</td>
</tr>
<tr>
<td align=right class=AdminField>
Password
</td>
<td>
<CFINPUT type=text name="password" value="#password#"
required=yes message="You must enter a Password.">
</td>
</tr>
<tr>
<td align=right class=AdminField>
Account Email Address
</td>
<td>
<CFINPUT type=text value="#useremail#" name="email">
</td>
</tr>
<tr>
<td align=right class=AdminField valign=top>
Linked Searches
</td>
<td>
<CFSET SizeVar = 10>
<CFSELECT name=SearchesToAttach multiple=yes
size="#sizeVar#">
<CFLOOP query=SearchInfo>
<CFIF ListFind("#AttachedSearchList#", "#SearchID#")>
<OPTION value=#SearchID#
selected>#Title#</OPTION>
<CFELSE>
<OPTION value=#SearchID#>#Title#</OPTION>
</CFIF>
</CFLOOP>
</CFSELECT><br>
hold down ctrl for multiple
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<INPUT type="hidden" name="clientUserLookupID"
value="#clientUserLookupID#">
<INPUT type="hidden" name="UserID" value="#UserID#">
<INPUT type="submit" value="Update Account">
</td>
</tr>
</table>
</CFOUTPUT>
</CFFORM>
<CFINCLUDE template="../../footer.cfm">
The above is the file where we have a form and when i click
the update submit button:
The code of that page is below:
<CFIF NOT IsDefined("Form.UserID") OR NOT
IsDefined("Form.ClientUserLookupID")>
<CFLOCATION url="../list.cfm" addtoken=no>
</CFIF>
<CFQUERY name="exists" datasource="#Application.data#">
SELECT *
FROM tblUsers
WHERE username = '#Form.username#'
AND UserID <> #Form.UserID#
</CFQUERY>
<CFIF exists.recordcount GT 0>
<CFINCLUDE template="../cannotadd.cfm">
<CFABORT>
</CFIF>
<!---<cfdump var="#form#"><cfabort>--->
<CFTRANSACTION>
<cfquery datasource="RainesDataBase">
UPDATE tblUsers
SET Username=<cfif IsDefined("FORM.username") AND
#FORM.username# NEQ "">
<cfqueryparam value="#FORM.username#"
cfsqltype="cf_sql_clob" maxlength="50">
<cfelse>
</cfif>
, Password=<cfif IsDefined("FORM.password") AND
#FORM.password# NEQ "">
<cfqueryparam value="#FORM.password#"
cfsqltype="cf_sql_clob" maxlength="50">
<cfelse>
</cfif>
, UserEmail=<cfif IsDefined("FORM.email") AND #FORM.email#
NEQ "">
<cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob"
maxlength="50">
<cfelse>
</cfif>
WHERE UserID=<cfqueryparam value="#FORM.UserID#"
cfsqltype="cf_sql_numeric">
</cfquery>
<!---
<CFQUERY name=updateUser
datasource="#Application.data#">
UPDATE tblUsers
SET Username = '#Form.Username#',
Password = '#Form.Password#',
UserEmail = '#Form.email#'
WHERE UserID = #Form.UserID#
</CFQUERY>
--->
<CFQUERY name="deleteClientUserSearchLookups"
datasource="#Application.data#">
DELETE
FROM tblClientUserSearchLookup
WHERE ClientUserLookupID = #Form.ClientUserLookupID#
</CFQUERY>
<CFIF isDefined("Form.searchesToAttach")>
<CFLOOP list="#Form.searchesToAttach#" index=index>
<CFQUERY name=insertClientUserSearchLookup
datasource="#Application.data#">
INSERT INTO tblClientUserSearchLookup (ClientUserLookupID,
SearchID)
VALUES (#Form.ClientUserLookupID#, #index#)
</CFQUERY>
</CFLOOP>
</CFIF>
</CFTRANSACTION>
<CFLOCATION url="../list.cfm" addtoken=no>
But this is not working as it is showing this below error as:
he web site you are accessing has experienced an unexpected
error.
Please contact the website administrator.
The following information is meant for the website developer
for debugging purposes.
Error Occurred While Processing Request
Error Executing Database Query.
Syntax error in UPDATE statement.
The error occurred in
C:\Inetpub\wwwroot\ConsultantTrack_OldFTP\Admin\users\clients\data\update.cfm:
line 19
17 : <!---<cfdump
var="#form#"><cfabort>--->
18 : <CFTRANSACTION>
19 : <cfupdate datasource="#Application.data#"
tablename="tblUsers"
formfields="username,password,UserEmail,userid">
20 : <!---<cfquery datasource="RainesDataBase">
21 : UPDATE tblUsers
SQLSTATE
SQL update tblUsers set username= (param 1) ,password= (param
2) ,UserEmail= (param 3) where UserID= (param 4)
VENDORERRORCODE 3092
DATASOURCE RainesDataBase
Resources:Could be the datatypes in your cfqueryparam tags. As a
minimum, use integer for the userid one.
Or it could be a reserved problem with "password" -
CFUPDATE problem with field name beginning with a number
I have a form (actually several) that is gathering data for a survey. I tried to use cfupdate to update the data elements and got a string index out of range error. I tested again without the form fields that began with numbers and it worked just fine. I then tried to enclose the offending field names in () and []. Both times I got same error. Does anyone have a work around for this? The code and error are below.
Changing the field names is not really an option. This survey has almost 400 data points and most of the fields begin with the question number.
Thanks
DW
<cfupdate datasource="#application.fdp_datasource#" tablename="arra_survey1" dbtype="ODBC" formfields = "entry_no, 2_a_fy09, '2_a_fy10', '2_a_fy11', '2_a_fy12', '2_b_fy09', '2_b_fy10', '2_b_fy11', '2_b_fy12', '2_c_fy09', '2_c_fy10', '2_c_fy11', '2_c_fy12', '2_d_fy09', '2_d_fy10', '2_d_fy11', '2_d_fy12', '2_e_fy09', '2_e_fy10', '2_e_fy11', '2_e_fy12', '2_f_fy09', '2_f_fy10', '2_f_fy11', '2_f_fy12', '2_g_fy09', '2_g_fy10', '2_g_fy11', '2_g_fy12', '2_h_fy09', '2_h_fy10', '2_h_fy11', '2_h_fy12', '2_i_fy09', '2_i_fy10', '2_i_fy11', '2_i_fy12', '2_j_fy09', '2_j_fy10', '2_j_fy11', '2_j_fy12', '2_k_fy09', '2_k_fy10', '2_k_fy11', '2_k_fy12', '2_l_fy09', '2_l_fy10', '2_l_fy11', '2_l_fy12', central_office, dept_office, incl_other, 3_a_fy09, 3_a_fy10, 3_a_fy11, 3_a_fy12, 3_b_fy09, 3_b_fy10, 3_b_fy11, 3_b_fy12, 3_c_fy09, 3_c_fy10, 3_c_fy11, 3_c_fy12, 3_d_fy09, 3_d_fy10 3_d_fy11, 3_d_fy12, 3_e_fy09, 3_e_fy10, 3_e_fy11, 3_e_fy12, 3_f_fy09, 3_f_fy10, 3_f_fy11, 3_f_fy12, 3_g_fy09, 3_g_fy10, 3_g_fy11, 3_g_fy12, 3_h_fy09, 3_h_fy10, 3_h_fy11, 3_h_fy12, 3_i_fy09, 3_i_fy10, 3_i_fy11, 3_i_fy12, 3_j_fy09, 3_j_fy10, 3_j_fy11, 3_j_fy12, 3_k_fy09, 3_k_fy10, 3_k_fy11, 3_k_fy12, 3_l_fy09, 3_l_fy10, 3_l_fy11, 3_l_fy12">
String index out of range: -2
The error occurred in C:\Inetpub\wwwroot\directory\process_arra_suvey_2.cfm: line 12
12 : <cfupdate datasource="#application.fdp_datasource#" tablename="arra_survey1" dbtype="ODBC" formfields = "entry_no, 2_a_fy09, '2_a_fy10', '2_a_fy11', ...I think you have run one of CFUPDATE's limitations. I am not 100% certain, but I do not think cfupdate provides a way to escape invalid column names like yours. In which case you may need to do a regular UPDATE within a cfquery instead... or rename your columns.
fields that began with numbers
Most databases discourage creating column names that start with a number (or other restricted characters). While many databases will allow you to escape invalid names, it is simpler all around to avoid them altogether. Otherwise, you may have to escape the names in every single query. The recommendations vary, but usually object names that begin with a letter, and contain only letters, numbers and underscores are considered safe.
This survey has almost 400 data points and most of the fields begin with the question number.
Four-hundred (400) is a lot of columns for a single table. The fact that they all them seem to contain the same type of information (ie response to a question) is an indication that data should probably be stored in a separate table, as rows, not columns. For example questions could be stored in one table, possible answers in another, and the results of an individual test/survey stored in a third table. A structure like that is much easier to query, can easily accommodate changes (add/remove questions, responses, etcetera) without having modify the table every time. -
I begin by using a simple HTML form to look up the record by
date. The code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" ">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>News Release Search by Date</title>
<link href="../../inside_pages.css" rel="stylesheet"
type="text/css" />
</head>
<body onLoad="document.forms[0].day.focus()">
<form id="search" name="search" method="post"
action="nr_search_action.cfm">
<label><span class="inside_pages">Search for a
date using this format DD/MM/YYYY.<br />
For example if you want to find April 7, 2006
search for 4/7/2006 .
<br />
<br />
Search</span>
<input name="day" type="text" id="day" />
</label>
<p>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</p>
</form>
</body>
</html>
The action page for the form is as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Form to Allow Editing of a News
Release</title>
<cfquery name="search_action"
datasource="news_releases">
SELECT *
FROM t_news_release
WHERE day = #CreateODBCDate(FORM.day)#
</cfquery>
</head>
<body>
<table width="100%" border="1">
<tr>
<td width="19%">Date</td>
<td width="29%">Title</td>
<td width="52%">Body</td>
</tr>
<tr>
<cfform action="nr_update.cfm">
<cfoutput>
<input type="hidden" name="release_id"
value="t_news_release.release_id" />
</cfoutput>
<cfoutput query="search_action">
<td height="23"><input type="text" name="day"
value="#DateFormat(day, "MMMM D, YYYY")#"></a></td>
<td><input type="text" name="title"
value="#title#"></td>
<td><textarea cols="50" rows="2"
name="body">#body#</textarea></td>
</cfoutput>
</tr>
</table>
<p><input type="submit" value="Update"></p>
</cfform>
<cfif search_action.RecordCount is 0>
<p>This date ("<cfoutput>#FORM.day#
</cfoutput>was not found. <a
href="nr_search.html">Please try again.</a>
<cfelse>
<p>Is this the record you wish to edit? If not please
<a href="nr_search.html">try again</a></p>
</cfif>
</body>
</html>
This page seems to be working as it finds the correct record
and allows me to type changes in the form. However, when I call the
nr_update.cfm page which uses a simple cfupdate I receive the
following error:
Invalid data t_news_release.release_id for CFSQLTYPE
CF_SQL_INTEGER.
The code that causes this error follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd">
<html>
<cfupdate datasource="news_releases"
tablename="t_news_release"
formFields="title,body">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
This is the edit page for the news releases.
<cfoutput>
<p>You updated news release #FORM.title#.</p>
<p>Do you want to <a
href="nr_search.cfm">edit</a> another news release?
</cfoutput>
</body>
</html>
Thank you in advance for your help.Here is some of the code generated with debugging turned on:
The error occurred in
C:\Inetpub\wwwroot\spl_web_site\about_lib\news_releases\cold_fuson\nr_update.cfm:
line 5
3 : <cfupdate datasource="news_releases"
4 : tablename="t_news_release"
5 : formFields="release_id,title,body">
6 : <head>
7 : <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
coldfusion.sql.Parameter$DataTypeMismatchException: Invalid
data t_news_release.release_id for CFSQLTYPE CF_SQL_INTEGER.
at
coldfusion.sql.Parameter.getMappingValue(Parameter.java:86)
at
coldfusion.sql.Parameter.getMappingValues(Parameter.java:38)
at
coldfusion.sql.InParameter.setStatement(InParameter.java:33)
at
coldfusion.sql.ParameterList.setStatement(ParameterList.java:107)
at coldfusion.sql.Executive.executeQuery(Executive.java:707)
at coldfusion.sql.Executive.executeQuery(Executive.java:638)
at coldfusion.sql.Executive.executeQuery(Executive.java:599)
at coldfusion.sql.SqlImpl.execute(SqlImpl.java:236)
at
coldfusion.tagext.sql.InsertTag.doStartTag(InsertTag.java:632)
at
coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:1918)
at
cfnr_update2ecfm448083145.runPage(C:\Inetpub\wwwroot\spl_web_site\about_lib\news_releases \cold_fuson\nr_update.cfm:5)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:343)
at
coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:210)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at
coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:50)
at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
at
coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:105)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:349)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:457)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:295)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
I hope this isn't too much. Thank you again.
Margo -
Java.lang.IllegalArgumentException: MONTH Error
I am maintaining an very old website built with ColdFusion 7 in my org, but I am very new to ColdFusion. We have a newsbriefs module which worked very well before last week. However, from last week, it started throwing me an error when I try to search the articles (Please see below for the error messages). Can anybody tell me what's wrong? Is it something wrong with the java environment on the server or something wrong with the code? How should I fix this problem? Everything else works fine on this site except for the searching articles by date or keywords. Any advices or suggestions would be greatly appreciated!!!
Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ;
InfoPath.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C)
Remote Address
192.198.46.55
Referrer
http://siteroot/sitename/newsbriefs/CF/viewbydate.cfm
Date/Time
14-Dec-11 09:54 AM
Stack Trace (click to expand)
at cfviewbydate_action2ecfm1313219662.runPage(E:\InetPub\wwwroot\sitename\newsbriefs\CF\view bydate_action.cfm:49)
java.lang.IllegalArgumentException: MONTH
at java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2482)
at java.util.Calendar.updateTime(Calendar.java:2463)
at java.util.Calendar.getTimeInMillis(Calendar.java:1082)
at java.util.Calendar.getTime(Calendar.java:1055)
at coldfusion.runtime.CFPage.CreateDate(CFPage.java:937)
at cfviewbydate_action2ecfm1313219662.runPage(E:\InetPub\wwwroot\sitename\newsbriefs\CF\viewbydate_action.cfm:49)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
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.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)
at coldfusion.CfmServlet.service(CfmServlet.java:175)
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:284)
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)Thanks very much for you quick response! Here are some codes related to this action:
Page viewbydate.cfm (no problem on this page, but on the following page):
<cfoutput>
<cfinclude template="menu.cfm">
<cfif isdefined('news_title')>
<cfupdate datasource="newsbriefs" tablename="news">
The article titled #news_title# has been updated in the database.<br />
</cfif>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>View By Date</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form" method="post" action="viewbydate_action.cfm">
<cfif isdefined('makeissue') and #makeissue# eq true>
<cfquery datasource="newsbriefs" name="ii">
SELECT TOP 1 ISSUE.ISSUE_ID, finalize
FROM ISSUE
ORDER BY ISSUE.ISSUE_ID DESC;
</cfquery>
<cfif #ii.finalize# eq false>
<cfset form.issue_id = #ii.issue_id#>
<cfelse>
<cfset form.issue_id = #ii.issue_id#+1>
</cfif>
Create Issue: Step 1<input type="hidden" name="issue_id" value="#form.issue_id#"></cfif>
<table border="0">
<tr>
<td colspan="3"><div align="right">Select stories by </div></td>
<td colspan="3"><select name="criteria">
<option value="added">date added</option>
<option value="story">story date</option>
</select></td>
</tr>
<cfset current = now()>
<cfset twoweeks = current-14>
<tr>
<td colspan="6"> </td>
</tr>
<tr>
<td>Month</td>
<td>
<select name="frommonth">
<cfloop from="0" to="11" step="1" index="add">
<option value="#dateformat(dateadd('m', add, twoweeks), 'm')#">
#dateformat(dateadd('m', add, twoweeks), 'mmmm')#</option>
</cfloop>
</select>
</td>
<td>Day</td>
<td>
<select name="fromday">
<cfloop from="1" to="31" step="1" index="add">
<option value="#add#" <cfif #dateformat(twoweeks, 'd')# eq #add#>selected</cfif>>#add#</option>
</cfloop>
</select>
</td>
<td>Year</td>
<td>
<select name="fromyear">
<cfloop from="-1" to="1" step="1" index="add">
<option value="#dateformat(dateadd('yyyy', add, twoweeks), 'yyyy')#"
<cfif #dateformat(dateadd('yyyy', add, twoweeks), 'yyyy')# eq #dateformat(twoweeks, 'yyyy')#>selected</cfif>>
#dateformat(dateadd('yyyy', add, twoweeks), 'yyyy')#</option>
</cfloop>
</select>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Month</td>
<td><select name="tomonth">
<cfloop from="0" to="11" step="1" index="add">
<option value="#dateformat(dateadd('m', add, current), 'm')#">
#dateformat(dateadd('m', add, current), 'mmmm')#</option>
</cfloop>
</select>
</td>
<td>Day</td>
<td> <select name="today">
<cfloop from="1" to="31" step="1" index="add">
<option value="#add#" <cfif #dateformat(current, 'd')# eq #add#>selected</cfif>>#add#</option>
</cfloop>
</select>
</td>
<td>Year</td>
<td> <select name="toyear">
<cfloop from="-1" to="1" step="1" index="add">
<option value="#dateformat(dateadd('yyyy', add, current), 'yyyy')#"
<cfif #dateformat(dateadd('yyyy', add, current), 'yyyy')# eq #dateformat(current, 'yyyy')#>selected</cfif>>
#dateformat(dateadd('yyyy', add, current), 'yyyy')#</option>
</cfloop>
</select>
</td>
</tr>
<tr>
<td colspan="6"><input type="submit" value="Get Articles"></td>
</tr>
</table>
</form>
</body>
</html>
</cfoutput>
Here is the viewbydateaction.cfm (error message returned on this page):
<cfoutput>
<!--- CREATE DATES FOR THE FROM AND TO DATES ON SUBMIT PAGE --->
<cfif isdefined('form.fromyear')>
<cfset fromdate = #createdatetime(form.fromyear,form.frommonth,form.fromday,0,0,0)#>
<cfset todate = #createdatetime(form.toyear,form.tomonth,form.today,23,59,59)#>
</cfif>
<!--- GET ALL STORIES --->
<cfquery name="z" datasource="newsbriefs" cachedwithin="#createtimespan(0,0,15,0)#">
select *
from news
</cfquery>
<cfquery datasource="newsbriefs" name="y">
select distinct news_category
from news
order by news_category
</cfquery>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>View Articles</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<cfinclude template="menu.cfm">
<form name="form" method="post" action="preview.cfm">
<cfif isdefined('form.issue_id') and #form.issue_id# neq "">Create Issue: Step 2<input type="hidden" name="issue_id" value="#form.issue_id#"><cfset makeissue = true></cfif>
<table border="1">
<cfloop query="y">
<cfquery datasource="newsbriefs" name="a">
select *
from category
where category_id = #y.news_category#
</cfquery>
<tr><td colspan="2"><h1>#a.category_name#</h1></td></tr>
<cfquery datasource="newsbriefs" name="x">
select *
from news
where news_category = #y.news_category#
order by news_category,news_year desc,news_month desc,news_day desc
</cfquery>
<cfquery datasource="newsbriefs" name="ii">
SELECT TOP 1 ISSUE.ISSUE_ID, finalize
FROM ISSUE
ORDER BY ISSUE.ISSUE_ID DESC;
</cfquery>
<cfloop query="x">
<cfset storydate = '#dateformat(createdate(x.news_year,x.news_month,x.news_day), 'd mmmm yyyy')#'>
<cfif #form.criteria# eq 'story'>
<cfif #storydate# gte #fromdate# and #storydate# lte #todate#>
#x.news_title#<br>
#storydate#
<br>
<br></cfif>
<cfelse>
<cfif #x.added# gte #fromdate# and #x.added# lte #todate#>
<tr><td rowspan="4" width="20">
<cfif isdefined('makeissue') and #makeissue# eq true><input type="checkbox" name="storyid" value="#x.news_id#">Add
<cfif #ii.finalize# eq false>to temp issue</cfif></cfif><br>
<br>
<cfquery datasource="newsbriefs" name="b">
select *
from news_issue
where news_id = #x.news_id#
</cfquery>
<cfif isdefined('b.issue_id') and #b.issue_id# neq "">
<cfloop query="b">
issue #b.issue_id#<Br>
</cfloop><cfelse> </cfif>
</td><td><a href="editarticle.cfm?news_id=#x.news_id#">#x.news_title#</a></td></tr>
<tr><td>#storydate#</td></tr>
<tr><td>#news_text#</td></tr>
<tr><td>#news_source#</td></tr>
</cfif>
</cfif>
</cfloop>
<tr><td colspan="2"> </td></tr>
</cfloop>
</table>
<input type="submit" value="NEXT >>">
</form>
</body>
</html>
</cfoutput> -
CFUPDATE character restriction
The problem I'm having is that if I use CFUPDATE or CFINSERT
and go over around 400 characters in the submitted text area it
bombs out. I don't know the exact amount of characters but if I
remove some text there is no issue. Does anyone know why this is
happening? If I uses a query with just UPDATE I can add as much
text as I want, but CFUPDATE limits me. Any help is greatly
appreciated!
Here is the error I get when I go over with too many
characters. Thanks
Error Executing Database Query.
Application uses a value of the wrong type for the current
operation.
The error occurred in D:\Hosting\kapman78\quickadmin3.cfm:
line 10
8 : <CFIF IsDefined("FORM.postnum")>
9 : <!--- Update game --->
10 : <CFUPDATE datasource="kapman78_accesscf_buss"
TABLENAME="#URL.tablename#">
11 : <CFELSE>
12 : <!--- Add game --->Well, the way i have my site coded it would take a lot of
rework to change it to a standard UPDATE query. I was hoping there
was some kind of fix to allow CFUPDATE to insert more characters.
The DB column is the same for both queries and I have run into no
input limitations with the UPDATE. -
Ok, first off I know I'm going to hear people say use CFQuery
to do the update. - this isn't a choice for this application, as
this is legacy code.
Here's the problem, we have a form that has this data in it
(sorry for the crappy layout, I'm cutting and pasting the FORM
cfdump results):
struct
ALLOW_FEATURE 1
COMMENTS [empty string]
DEPT_ID 1006,1034,1016
FIELDNAMES
PRODUCT_ID,PRODUCT_NAME,SKU,MANUFACTURER,PRODUCT_DESCRIPTION,COMMENTS,TICKET_TYPE,STATUS_ FLAG,ALLOW_FEATURE,SHOW_DT,IS_GIFTCERT,TAX_FLAG,SHIP_CATEGORY,SALE_PRICE,RETAIL_PRICE,HAND LE_COST,DEPT_ID,DEPT_ID,DEPT_ID,IMAGE_NAME,UPDATE_BUTTON
HANDLE_COST 0.00
IMAGE_NAME [empty string]
IS_GIFTCERT N
MANUFACTURER [empty string]
PRODUCT_DESCRIPTION #NI317 Poly filled jacket for cold
weather.
PRODUCT_ID 18930
PRODUCT_NAME Poly Fill Jacket
RETAIL_PRICE 0.00
SALE_PRICE 64.88
SHIP_CATEGORY T
SHOW_DT [empty string]
SKU 6F170
STATUS_FLAG Y
TAX_FLAG Y
TICKET_TYPE 0
UPDATE_BUTTON Update Product
Now, on the action page, we have a bunch of things going on
using other aspects of that data that I won't bore you with, but
when we go to update using CFUPDATE using the following chunk of
code:
<cfupdate tablename="sto_product" datasource="#sto_dsn#"
formfields="sku,product_name,product_description,comments,status_flag,allow_feature,tax_f lag,manufacturer,sale_price,retail_price,weight,dimensions,handle_cost,shipping_flag,stock _qty,store_id,ticket_type,is_giftcert,tax_flag,ship_category">
We get this error (I've replaced the real path with
"xxxxxxxxxxx"):
Error Occurred While Processing Request
The given fieldname "DEPT_ID" could not be found in the table
"sto_product".
The error occurred in
D:\Inetpub\xxxxxxxxxxx\edit_product.cfm: line 99
Called from D:\Inetpub\xxxxxxxxxxxt\edit_product.cfm: line 94
Called from D:\Inetpub\xxxxxxxxxxx\edit_product.cfm: line 54
Called from D:\Inetpub\xxxxxxxxxxx\edit_product.cfm: line 1
98 :
99 : <cfupdate tablename="sto_product"
datasource="#sto_dsn#"
formfields="sku,product_name,product_description,comments,status_flag,allow_feature,tax_f lag,manufacturer,sale_price,retail_price,weight,dimensions,handle_cost,shipping_flag,stock _qty,store_id,ticket_type,is_giftcert,tax_flag,ship_category">
Now if you notice, DEPT_ID isn't
ANYWHERE in the formfields declaration. For some reason
CFUPDATE is trying to use that field even though I am giving it a
list of fields to use. Also, I've noticed that if you have spaces
after each field name (before or after the comma) CFUPDATE craps
out as well. Since this works in CFMX6.1 with all the hotfixes in
place, it seems Cf 7 has a bug with CFUPDATE.
Has anyone else run into this problem at all?I'm having the same problem. CF 7.02 running on Windows 2003
Server. -
have built a flash form that pulls information dynamically
from a mysql db. everything but the edit feature is working. When
the form is submitted, it is sent to submit.cfm. For some reason,
errors appear as:
The given fieldname "DBDATA.FIRSTNAME" could not be found in
the table "table".
Below is a STRIPPED down version of what we have. Is there
something im doing wrong?
--SUBMIT.CFM--
<cfupdate dataSource = "datasource"
tableName = "table"
formFields = "firstname,lastname">
--FORM.CFM--
<cfquery name="dbdata" datasource="datasource">
SELECT * FROM table
</cfquery>
<cfform format="flash" action="submit.cfm">
<cfformgroup type="vbox"><cfformgroup type="panel"
label="Information">
<cfgrid name="dbdata" query="dbdata"
rowheaders="false">
<cfgridcolumn name="firstname" header="First Name" />
<cfgridcolumn name="lastname" header="Last Name" />
</cfgrid>
</cfformgroup>
<cfformgroup type="panel" label="Edit">
<cfinput type="text" name="firstname" label="First
Name:"bind="{dbdata.selectedItem.firstname}" />
<cfinput type="text" name="lastname" label="Last
Name:"bind="{dbdata.selectedItem.lastname}" />
<cfinput type="submit" name="submit" value="Apply changes"
/>
</cfformgroup>
</cfformgroup>
</cfform>If the intent is to prevent multiple form submissions, there
are a couple of other ways to do it. Neither is perfect, but both
require a deliberate effort to submit the form more than once.
1. Use an intermediate page. On this page, validate the form
inputs, convert the form variables to session variables and
javascript.window.location to the real page.
2. At the top of the form action page, display some html
content and cfflush it. Then process your form. -
Error in starting Adobe Bridge in Photoshop CS2
I've just installed Photoshop CS2, however upon opening Adobe Bridge this error message appears " The application has failed to start because libagluc28.dll was not found. Reinstalling to application may fix the problem"
I have reinstalled and click repair but to no avail
I followed Adobe Support Knowledgebase solution and run CMD and this appears:
c:Documents and Settings/Jesus M Ferraris>
then i entered the command
cacls c:\windows\installer /T /E /C /G administrators:F
but an error message appears - 'cacls' is not recognized as an internal or external command, operable program or bathc file
I also entered the next command
cacls "c:\documents and setting\all users" /Y /E /C /G administrators:F
still the same error as above appears, Please help, have I miss something or was my procedure correct...
P4, 512ram, WXP 80gHDVery useful.
Good Luck.
My
Si
tes -
Windows Vista: Ipod Error Message, no longer read by PCs
Hello,
I have a 5th generation black ipod video with 30GB of memory.
The other day I hooked it up to my laptop (Toshiba, 4 months old) that it's been functioning on with no problems whatsoever. This weird error message flashed twice about it not being able to sync because of some software problem.
Eversince then, the only thing I can charge my ipod on is the family treadmill in the basement (~_~) as no other computer in the house recognizes it. I can't even charge it through the wall sockets, either.
I have changed the ipod cord, still no luck. I've also reset the device about 3 or 4 times and uninstalled, restarted the laptop then reinstalled itunes. I would like to reset it back to factory settings but that's impossible as computers/laptops don't pick it up. I live very far from a Mac store...
What's a girl to do? I can't live without my Busta Rhymes and Wu-Tang Clan!
Any advice would be greatly appreciated! Thanks!you have to update Vista go to this site and up-date http://windowsupdate.microsoft.com
-
Error while offsetting a variable
Hello Experts
I want to display the data for last 5 years in my query. So I tried using the SAP exit variable Current Calendar Year (0CYEAR) and the offset it by 5. However, I am getting the following error message for the query "System error in program SAPLRR12 and form REP_ASSIGN_INITIAL_OPT-01"
Any Help on this is appreciated and points will be assigned.
ThanksThanks Chetan for your prompt reply. I have assigned points.
But I would appreciate if you help me clear my understanding of offseting a variable.
Say if the Current Calendar Year variable returns 2008, then will offseting that variable by 5 return me the data for years 2008, 2007, 2006, 2005 , 2004. Or, will it just return me the data for 2008 - 5 = 2004 only.
Thanks
Rishi
Maybe you are looking for
-
Hi, Everyone -- If the iPod can project to a TV via RCA or SVideo cables, can you then transfer the video contents to VCR tape or DVD ROM by recording? Thanks for your help.
-
How to set ringtone from text message?
I got text message from friend that contain ringtone on it. I like to set it on my iphone. How to do it? Doesn't show "save". Please help!!
-
Dear all, At the time of using F-47, what is the use of Bus. Area. If I enter code 0001 in Bus. area, the system will deisplay the following error You have no authorization for posting in business area 0001 what is the mean of it, What is main reason
-
Unable to customize my portal masthead
Hi, I am unable to customize my portal masthead. I can't download the par file like "System Administration -> Support -> Portal Runtime -> Browse Deployment -> WEB-INF -> deployment -> temp (or) pcd -> com.sap.portal.navigation.masthead.par.bak ". I'
-
Hi All, Is it possible to create this effect in Motion from this After Effects Tutorial from Video Copilot? http://www.videocopilot.net/tutorials/procedural_crumble/ Thanks Darren