Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > ColdFusion > Re: How do I up...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 1673 of 1699
Post > Topic >>

Re: How do I update a single column?

by Denard Springle <denard.springle@[EMAIL PROTECTED] > Jun 25, 2007 at 04:12 PM

Hey El,

   You can do this with a SQL statement pretty easily:

UPDATE <table> SET <field> = '<value>'

this will update all the records in the table, setting the field you
specify to the value you specify. You can prevent it from updating
everything in the database using a WHERE clause if need be (i.e. WHERE
<field> = '<value>').

An example in CF:

<cfquery name="myQuery" datasource="#myDs#">
UPDATE a_myTable SET myField = 'yes'
</cfquery>

Not that looping through each record and updating it individually
13,000+ times won't work (it will) but this UPDATE SQL will get the
job done in about 2 seconds vs. however long it would take to parse
and update 13,000+ records one by one! :) Hope this helps!

-- Denny
 




 3 Posts in Topic:
How do I update a single column?
"El Kabong" <  2007-06-24 14:51:26 
Re: How do I update a single column?
Denard Springle <denar  2007-06-25 16:12:38 
Re: How do I update a single column?
"El Kabong" <  2007-06-25 21:31:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 12:48:55 CDT 2008.