SQL getting the next available ID

2006-12-07 Thread Doug Brown
I am needing to get the next available ID from my (permanent)advertisements table and be able to hang onto it until a user checks out and I do a final insert. What happens is the user does the following things. 1. User clicks on (Create advertisement) link and that is when I need to get the

Re: SQL getting the next available ID

2006-12-07 Thread JediHomer
Why not set your ID to be a uniqueue identifier, then generate the ID with CF... This should keep the ID unique for that Add... On 07/12/06, Doug Brown [EMAIL PROTECTED] wrote: I am needing to get the next available ID from my (permanent)advertisements table and be able to hang onto it until

RE: SQL getting the next available ID

2006-12-07 Thread Bobby Hartsfield
Subject: SQL getting the next available ID I am needing to get the next available ID from my (permanent)advertisements table and be able to hang onto it until a user checks out and I do a final insert. What happens is the user does the following things. 1. User clicks on (Create advertisement) link

Re: SQL getting the next available ID

2006-12-07 Thread Doug Brown
Hartsfield [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Thursday, December 07, 2006 7:28 AM Subject: RE: SQL getting the next available ID Entering it temporarily will ensure that it isn't used again... ever Also, a simple flag like 'verified' as a bit field would make

RE: SQL getting the next available ID

2006-12-07 Thread Bobby Hartsfield
. ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Doug Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, December 07, 2006 9:49 AM To: CF-Talk Subject: Re: SQL getting the next available ID Bobby, So basically what I would do is add a column to my advertisements table (bit

Re: SQL getting the next available ID

2006-12-07 Thread Doug Brown
I am using SQL2K. I am not quite sure I am following the createUUID() Are you saying to use this value as the adid versus using auto increment? Regards, Doug ~| Create robust enterprise, web RIAs. Upgrade

Re: SQL getting the next available ID

2006-12-07 Thread Matt Robertson
yes thats what he's saying. Since you create the UUID yourself with createuuid() you can reference it early and often anytime, without any added cfqueries or whatever. I like to use a replace function to remove the underscores from the uuid, but thats as much personal preference as it is

RE: SQL getting the next available ID

2006-12-07 Thread Bobby Hartsfield
To: CF-Talk Subject: Re: SQL getting the next available ID yes thats what he's saying. Since you create the UUID yourself with createuuid() you can reference it early and often anytime, without any added cfqueries or whatever. I like to use a replace function to remove the underscores from

RE: SQL getting the next available ID

2006-12-07 Thread Bobby Hartsfield
Subject: RE: SQL getting the next available ID What he said... I also like to remove non alphanumeric chars :-) Another option would be to create your own uuid based on the current date and time (you could even get the time down to the millisecond with some java) and append or prepend the users ID