It's theResult.generatedKey
On Jun 4, 2011 4:46 PM, "Robert Rhodes" <[email protected]> wrote:
>
> I am frustrated. :(
>
> In the cf9 docs, it says that cfquery is supposed to return, in the result
> variable, the identity column value of the inserted record. However it is
> not working from me.
>
> Would one of you kind souls point out my mistake?
>
> <cfquery datasource="someDsn" name="insertRecord" result="theResult">
> INSERT INTO
> someTable
> (
> firstName,
> lastName
> )
> VALUES
> (
> <cfqueryparam cfsqltype="cf_sql_varchar" maxlength="20"
> value="#arguments.firstName#">,
> <cfqueryparam cfsqltype="cf_sql_varchar" maxlength="20"
> value="#arguments.lastName#">
> )
> </cfquery>
>
> <cfoutput>#theResult.identityCol#</cfoutput>
>
> When I run this, identityCol is not there.
>
> I am indeed using an autonumbering identity column in the database.
>
> Yes, I know I can just add a select to this query to get at it, but I
really
> want this to work, dammit!
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345069
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to