By the way, if you do everything in sql, you should use "SELECT scope_identity()" instead of "SELECT @@identity". The reason being that if your insert calls a trigger on that table that in turns inserts a row in another table, scope_identity() would return the id of the new row you explicitly inserted, while @@identity would return the id of the row inserted by the trigger.
On Wed, Jan 27, 2016 at 12:09 PM, Paul Kukiel <kuki...@gmail.com> wrote: > Less code, and database agnostic. Behind the scenes it probably does the > same thing. > > On Wed, Jan 27, 2016 at 12:01 PM, Mike K <afpwebwo...@gmail.com> wrote: > >> Whats the advantage of returning result.getPrefix().generatedkey rather >> than using the @@identity function of the database? >> >> Is it just to make it database agnostic? or is there another reason for >> it? >> >> >> Cheers >> Mike Kear >> Windsor, NSW, Australia >> Adobe Certified Advanced ColdFusion Developer >> AFP Webworks >> http://afpwebworks.com >> >> -- >> You received this message because you are subscribed to the Google Groups >> "cfaussie" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to cfaussie+unsubscr...@googlegroups.com. >> To post to this group, send email to cfaussie@googlegroups.com. >> Visit this group at https://groups.google.com/group/cfaussie. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Paul Kukiel > > -- > You received this message because you are subscribed to the Google Groups > "cfaussie" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cfaussie+unsubscr...@googlegroups.com. > To post to this group, send email to cfaussie@googlegroups.com. > Visit this group at https://groups.google.com/group/cfaussie. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to cfaussie@googlegroups.com. Visit this group at https://groups.google.com/group/cfaussie. For more options, visit https://groups.google.com/d/optout.