Ask a Question related to Coldfusion Database Access, Design and Development.
-
Jeremy F #1
Question about Updating a record
Ok, here's what we can assume:
<cfset update = "ALIAS = 'Gruu'">
<cfset id = '999'>
Here's the simplified query:
<cfquery name="angryquery" datasource="ds">
UPDATE TableName
SET #update#
WHERE (key = '#id#')
</cfquery>
And here's what CF has to say about that:
Error Occurred While Processing Request
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Line 2: Incorrect syntax near
'Gruu'.
Any ideas? The field 'alias' is capable of holding 'Gruu' as its value, and
the field 'key' is a unique identifier. Any input is appreciated.
Jeremy F Guest
-
Updating record remotely from a script?
I have a MySQL database on my ISP's Linux server. Can anyone tell me if it would be possible to update a specific record remotely without any user... -
Problems when updating record
I am having a problem with the following code with mySQL. I normally write with Access and do not get this problem, is there something that I am... -
Updating a NEW record
ASP/Access Say a user creates a new record and needs to complete multiple forms, on multiple pages.... How do you submit the data to each page... -
Updating MySQL record
Hi! I'm heaving a small problem updating a record containing an encrypted password. I'm using aes_encrypt. This is my suggestion for the query... -
Updating a single record on a form
Hi Dennis, You need to look at the properties that begin with 'Allow....'. For example Allow Additions (allows/prevents adding new records). ... -
The ScareCrow #2
Re: Question about Updating a record
I would say the problem is that the id is an integer and you have it inclosed
in single quotes, should be
<cfquery name="angryquery" datasource="ds">
UPDATE TableName
SET #update#
WHERE (key = #id#)
</cfquery>
Ken
The ScareCrow Guest
-
Jeremy F #3
Re: Question about Updating a record
Fair enough answer, but not the problem. The query executes just fine if I do
UPDATE TableName
SET ALIAS = 'Gruu'
WHERE (key = '#id#')
But fails if I do:
UPDATE TableName
SET #update#
WHERE (key = 999)
Strange, eh?
Jeremy F Guest
-
The ScareCrow #4
Re: Question about Updating a record
Does it fail if you do
UPDATE TableName
SET #update#
WHERE (key = '999')
Give this a try
<cfset update = "[ALIAS] = 'Gruu'">
Ken
The ScareCrow Guest
-
Jeremy F #5
Re: Question about Updating a record
I've found the solution. Thanks again for your help.
PreserveSingleQuotes()
Who knew...
Jeremy F Guest



Reply With Quote

