Mark, here's an example of how we do it, this contains info specific to the
app we are using it in.

<cfif len(getmaxID.Max_ID)>
        <cfset caller.Max_ID = getmaxID.Max_ID + 1>
<cfelse>
        <cfset caller.Max_ID = "1">
</cfif>

        <!--- [EMAIL PROTECTED] Inserts UID pulled created from the getmaxid
result set and incremented--->
        <cfquery name="qaddhistory" datasource="#request.DSN#">
                update  #request.TBCR#.TBCOO4
                set     INT_VALUE = #caller.Max_ID#,
                                LAST_USERID = '#Trim(UCase(Session.UUID))#',
                                LAST_TIME = CURRENT TIMESTAMP
        </cfquery>

Hth.

Kind Regards - Mike Brunt, CTO
Webapper
http://www.webapper.com
Downey CA Office
562.243.6255
AIM - webappermb

"Webapper - Making the NET work"


-----Original Message-----
From: Mark Leder [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 13, 2002 2:42 PM
To: CF-Talk
Subject: Counter Function


I want to do an insert into a db of a query row incremented by one?
I know how to retrieve the MAX row from the db, but how do I write the
function that adds 1 to the value.

For example, query MAX returns a value of 1000.

Then I want to CFSET newvalue = 1000 + 1>

Thanks,
Mark


______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to