This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01BFA09D.4F0AFC20
Content-Type: text/plain;
charset="iso-8859-1"
In referring to this article:
http://www.defusion.com/articles/index.cfm?ArticleID=72
The method below of inserting a record is not a
reliable way to get the corresponding record id
in Cold Fusion:
Is this article correct in stating this method does
not work, even if the code is wrapped in a
CFTRANSACTION??
What is the best, scalable method for retrieving
the identity field from the database, in the
anticipation of heavy traffic?
Thanks, Heres the code:
--------------------------------
<cftransaction>
<cfquery name="my_insert" datasource="whatever">
INSERT INTO myTable
...
</cfquery>
<cfquery name="get_id" datasource="whatever">
SELECT MAX(myTable.ID) as new_id
FROM myTable
</cfquery>
</cftransaction>
Scott Becker
Web Developer : ConnectWise, Inc.
www.ConnectWise.com
------_=_NextPart_001_01BFA09D.4F0AFC20
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>HELP Getting Identity Field Accurately</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Arial">In referring to this article: </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"><A =
HREF=3D"http://www.defusion.com/articles/index.cfm?ArticleID=3D72" =
TARGET=3D"_blank">http://www.defusion.com/articles/index.cfm?ArticleID=3D=
72</A> </FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">The method below of inserting a record =
is not a </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">reliable way to get the corresponding =
record id </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">in Cold Fusion:</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Is this article correct in stating =
this method does </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">not work, even if the code is wrapped =
in a </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">CFTRANSACTION?? </FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">What is the best, scalable method for =
retrieving </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">the identity field from the database, =
in the </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">anticipation of heavy traffic? =
</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks, Heres the code:</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">--------------------------------</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"><cftransaction></FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial"><cfquery =
name=3D"my_insert" =
datasource=3D"whatever"></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> INSERT INTO =
myTable</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
...</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"></cfquery></FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial"><cfquery name=3D"get_id" =
datasource=3D"whatever"></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> SELECT =
MAX(myTable.ID) as new_id</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> FROM myTable</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"></cfquery></FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial"></cftransaction></FONT>
</P>
<P><B><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"Verdana">Scott =
Becker</FONT></B>
<BR><FONT COLOR=3D"#000000" SIZE=3D1 FACE=3D"Verdana">Web Developer : =
ConnectWise, Inc.</FONT>
<BR><I><FONT COLOR=3D"#000000" SIZE=3D1 =
FACE=3D"Verdana">www.ConnectWise.com</FONT></I>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01BFA09D.4F0AFC20--
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.