RE: grabbing the id of a newly created item..

2005-02-01 Thread Calvin Ward
, February 01, 2005 2:18 AM To: CF-Talk Subject: Re: grabbing the id of a newly created item.. That's something you should know about your DB. There are reasons to use transactions even if your DB doesn't support them. For instance, if you need 100% assurance that a series of statements will be executed

RE: grabbing the id of a newly created item..

2005-01-31 Thread Craig Dudley
Which DB are you using? -Original Message- From: Protoculture [mailto:[EMAIL PROTECTED] Sent: 31 January 2005 15:10 To: CF-Talk Subject: grabbing the id of a newly created item.. How would I modify an insert query to grab the id ( autonum, primary key ) of the item that I just

Re: grabbing the id of a newly created item..

2005-01-31 Thread Protoculture
ACCESS ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192335 Archives:

Re: grabbing the id of a newly created item..

2005-01-31 Thread Tony Weeg
select @@identity from tableName will return the last inserted id, assuming mssql tw On Mon, 31 Jan 2005 16:09:10 -, Craig Dudley [EMAIL PROTECTED] wrote: Which DB are you using? -Original Message- From: Protoculture [mailto:[EMAIL PROTECTED] Sent: 31 January 2005 15:10 To:

Re: grabbing the id of a newly created item..

2005-01-31 Thread Jim Campbell
If you're using SQL Server, you can put the insert in a procedure, wrap it in a transaction, and run something like this at the end: SET @NEWID = SCOPE_IDENTITY() This will return the most recent primary key created. - Jim Protoculture wrote: How would I modify an insert query to grab the id

Re: grabbing the id of a newly created item..

2005-01-31 Thread Protoculture
what about using access ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message:

RE: grabbing the id of a newly created item..

2005-01-31 Thread Craig Dudley
[mailto:[EMAIL PROTECTED] Sent: 31 January 2005 15:17 To: CF-Talk Subject: Re: grabbing the id of a newly created item.. ACCESS ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start

Re: grabbing the id of a newly created item..

2005-01-31 Thread Protoculture
Thanks Craig. Just to confirm that code.. Select For Max(ID) ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message:

RE: grabbing the id of a newly created item..

2005-01-31 Thread Craig Dudley
More like; Select Max(ID) as MyNewID FROM yourtablename -Original Message- From: Protoculture [mailto:[EMAIL PROTECTED] Sent: 31 January 2005 15:34 To: CF-Talk Subject: Re: grabbing the id of a newly created item.. Thanks Craig. Just to confirm that code.. Select For Max(ID

RE: grabbing the id of a newly created item..

2005-01-31 Thread COLLIE David
I don't think there's a neat way of doing it for Access, I could be wrong though. http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=79 Couple of methods ... Could be rewritten in CF if needed -- dc ~| Logware

RE: grabbing the id of a newly created item..

2005-01-31 Thread Calvin Ward
-Talk Subject: Re: grabbing the id of a newly created item.. select @@identity from tableName will return the last inserted id, assuming mssql tw On Mon, 31 Jan 2005 16:09:10 -, Craig Dudley [EMAIL PROTECTED] wrote: Which DB are you using? -Original Message- From: Protoculture

RE: grabbing the id of a newly created item..

2005-01-31 Thread kola.oyedeji
: RE: grabbing the id of a newly created item.. I don't think there's a neat way of doing it for Access, I could be wrong though. http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=79 Couple of methods ... Could be rewritten in CF if needed -- dc

RE: grabbing the id of a newly created item..

2005-01-31 Thread Matthew Small
That is correct, I used it a few years ago when Access 2000 came out. - Matt Small -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 31, 2005 12:03 PM To: CF-Talk Subject: RE: grabbing the id of a newly created item.. Actually IIRC this is now

Re: grabbing the id of a newly created item..

2005-01-31 Thread Bryan Stevenson
Ummm...don't you mean CFTRANSACTION...and not CFLOCK?? Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com

Re: grabbing the id of a newly created item..

2005-01-31 Thread Matt Robertson
[EMAIL PROTECTED] wrote: Ummm...don't you mean CFTRANSACTION...and not CFLOCK?? It should be both if using that kinda dated method. http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_17000 That article is a golden oldie but it explains the reasons why rather well. I personally do

RE: grabbing the id of a newly created item..

2005-01-31 Thread Calvin Ward
:38 PM To: CF-Talk Subject: Re: grabbing the id of a newly created item.. Ummm...don't you mean CFTRANSACTION...and not CFLOCK?? Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL

Re: grabbing the id of a newly created item..

2005-01-31 Thread Joe Rinehart
cflock won't work across multiple servers in a load balanced environment... And I hope no one uses Access for that! -Joe -- For Tabs, Trees, and more, use the jComponents: http://clearsoftware.net/client/jComponents.cfm ~|

Re: grabbing the id of a newly created item..

2005-01-31 Thread Jochem van Dieten
Calvin Ward wrote: In either case, cftransaction isn't guaranteed (it's only a recommendation, and does it work with Access?) cftransaction is not a recommendation, it sends transaction commands to the database. What the database does with it is something entirely different, and MySQL is the

RE: grabbing the id of a newly created item..

2005-01-31 Thread Dave Watts
In either case, cftransaction isn't guaranteed (it's only a recommendation, and does it work with Access?) ... I don't think this is correct. When you specify BEGIN TRANSACTION within an SQL batch (which is the raw SQL equivalent of the CFTRANSACTION tag), it isn't a recommendation, but rather

Re: grabbing the id of a newly created item..

2005-01-31 Thread Barney Boisvert
What the database does with it is something entirely different, and MySQL is the usual suspect if something blows up, not Access. What do you mean, Jochem? Aside from some quirks with temporary tables and ALTER TABLE statements in 4.0, I've not run into issues with MySQL's transaction

Re: grabbing the id of a newly created item..

2005-01-31 Thread Jochem van Dieten
Barney Boisvert wrote: What the database does with it is something entirely different, and MySQL is the usual suspect if something blows up, not Access. What do you mean, Jochem? Aside from some quirks with temporary tables and ALTER TABLE statements in 4.0, I've not run into issues with

Re: grabbing the id of a newly created item..

2005-01-31 Thread Barney Boisvert
MyISAM tables don't support transactions. Or are you saying if you use CFTRANSACTION on MyISAM tables, it blows up? I've never seen that behaviour either, though I don't know if I've tried it with CFMX, only BD (because BD doesn't do the single threading of requests to connections thing).

Re: grabbing the id of a newly created item..

2005-01-31 Thread Jochem van Dieten
Barney Boisvert wrote: MyISAM tables don't support transactions. Exactly. But if you try to use a cftransaction on them, no error is thrown. So you only find out much later that rollbacks didn't work etc. Jochem ~| Logware

Re: grabbing the id of a newly created item..

2005-01-31 Thread Protoculture
So how would I use the code below in context of an insert statement? select @@identity from tableName ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours

RE: grabbing the id of a newly created item..

2005-01-31 Thread Calvin Ward
Me either, but one can never be sure! -Original Message- From: Joe Rinehart [mailto:[EMAIL PROTECTED] Sent: Monday, January 31, 2005 2:33 PM To: CF-Talk Subject: Re: grabbing the id of a newly created item.. cflock won't work across multiple servers in a load balanced environment

RE: grabbing the id of a newly created item..

2005-01-31 Thread Calvin Ward
Sorry, got my wires crossed on that one. I still prefer the UUID approach (or use a stored procedure - not available in Access). - Calvin -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Monday, January 31, 2005 3:00 PM To: CF-Talk Subject: RE: grabbing the id

Re: grabbing the id of a newly created item..

2005-01-31 Thread Barney Boisvert
Does Access let you do multiple statements in a single CFQUERY tag like SQL Server? Not a stored proc, but close, because they'll run in the same connection. Should be sufficient for this scenario cheers, barneyb. On Mon, 31 Jan 2005 15:41:10 -0500, Calvin Ward [EMAIL PROTECTED] wrote:

Re: grabbing the id of a newly created item..

2005-01-31 Thread Barney Boisvert
That's something you should know about your DB. There are reasons to use transactions even if your DB doesn't support them. For instance, if you need 100% assurance that a series of statements will be executed on a single connection, and no other statements will be interspersed between them. If