EasyCFM.COM ColdFusion Forums / Coding Help! / Unknown attribute SET ???

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Unknown attribute SET ??? -- page: 1 2

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

tans007
08-18-2003 @ 9:29 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 604
Joined: May 2003

Hi there

I have the following code in my script:

<cfupdate datasource = "CartDB"
       TABLENAME = "ORDERS"
       SET OrderStatus = "Authorised"
       WHERE OrderID = #FORM.User2#    
    </cfupdate>

Basically all I want to do is update one filed in a record - I want to change the order status from Pending to Authorised.  Note #FORM.User2 is a generic field which contains the OrderID.

Unfortuantely the following is the result I am getting:

Just in time compilation error

An unknown attribute 'SET' has been encountered at document position (53:8) to (53:10) while processing tag CFUPDATE. This tag can only take the following attributes:

CONNECTSTRING
DATASOURCE
DBNAME
DBPOOL
DBSERVER
DBTYPE
FORMFIELDS
PASSWORD
PROVIDER
PROVIDERDSN
TABLENAME
TABLEOWNER
TABLEQUALIFIER
USERNAME

Could someone possibly shed some light on what the issue maybe.

Thanks in advance.

Pete


Pete Tanswell

Bobby
08-18-2003 @ 10:52 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 21
Joined: Aug 2003

yeah you cant specify that much info to a CFUPDATE... i never use them or cfforms.

anyway enough of my personal prefs... try a normal query in lace of your CFUPDATE tag

<cfquery name="UpdateIt" datasource="CartDB">
Update ORDERS
SET OrderStatus = 'Authorised'
WHERE OrderID = #val(FORM.User2)#
</cfquery>




Ever go to eat a pork sausage and find its got hairs all over it?

Bobby
08-18-2003 @ 10:52 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 21
Joined: Aug 2003



This message was edited by Bobby on 8-18-03 @ 10:52 PM

tans007
08-18-2003 @ 11:08 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 604
Joined: May 2003

OK that gets around the error - but when I look at the database - it has not updated the OrderStatus from Pending to Authorised.

Any ideas?

Rgds

Pete Tanswell

Bobby
08-18-2003 @ 11:15 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 21
Joined: Aug 2003

well other than what I'd make sure of first...

Was the database Opened?
if so was the table opened too?
if so clse it and reopen it to make sure... then if its still not changed I'm gonna need to see more code than just the query there could be plenty of possibilities.

Ever go to eat a pork sausage and find its got hairs all over it?

tans007
08-19-2003 @ 12:30 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 604
Joined: May 2003

All fixed and working


Pete Tanswell

Adrian
08-19-2003 @ 9:21 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 77
Joined: Jul 2003

I'm having a similar problem with one of my update fields.  Could you tell me what you changed to get it working?

Adrian

tans007
08-19-2003 @ 9:25 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 604
Joined: May 2003

Hi there

Paste your script on a message and I can have a look at it.

Regards

Pete


Pete Tanswell

Adrian
08-19-2003 @ 9:33 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 77
Joined: Jul 2003

In the form, I output all the sales information for a particular order.  Then I allow the user to make as many changes as is required.

In the action page, I have set up the following loop to run through all the records, updating them.

<cfloop from="1" to="#FORM.Records#" index="ThisRow">
  <cfquery datasource="ECBDB">
  UPDATE tblPurchase
    Set ProductID='#Evaluate("Prod" & ThisRow)#',
    Length='#Evaluate("Len" & ThisRow)#',
    Yardage='#Evaluate("Yard" & ThisRow)#',
    Quantity='#Evaluate("Quan" & ThisRow)#',
    ShippingInstructions='#Evaluate("Ship" & ThisRow#'
  WHERE OrderConfirmationID=#Evaluate("ID" & ThisRow#;
  </cfquery>
</cfloop>

I don't get any syntax errors, nor do I get any database errors.  The only problem is that none of the information is updated.  The total amount of records is correct, and the loop counter works like a charm.  I copied a bunch of this code from a sample I found off the 'net.  It worked great there, not so great for me!

Adrian

Bobby
08-19-2003 @ 9:38 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 21
Joined: Aug 2003

you sure that "#FORM.Records#" does not equal 0?

Ever go to eat a pork sausage and find its got hairs all over it?

PAGE: 1 2
Sponsored By...
iOpenSoft, LLC is a Houston, Texas Advanced Technology Studio Specializing in Web Design, Web Development, iPhone App Development and Android App Development.