CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.

YesSoftware Forums -> CodeCharge Studio -> ColdFusion

 After Insert C ode Snippet

Print topic Send  topic

Author Message
Graham Pearson
Posted: 11/02/2005, 11:37 AM

On this Event, is their a function that will give me the Primary Key of
the record which was just inserted into a table. I am trying to retrieve
this number so I can send an email about this newly inserted record of a

Posts: 5971
Posted: 11/02/2005, 11:49 AM

There is no such function because each application and database may handle this differently, while some databases may not provide such key at all.
However, there is related example in CCS Example Pack: "Multi-Step User Registration".
When a user enters his information on Step 1, a record is created in the database, the application retrieves the last inserted key, then redirects the user to Step 2 while passing the newly created user_id to it.
You can review the related ColdFusion event to see how it was implemented.
Peter R.
YesSoftware Forums Moderator
For product support please visit
View profile  Send private message

Posts: 283
Posted: 11/02/2005, 12:21 PM

There was a lot of talk on this in the old forums. Here a link to one of the tips:
If your backend is oracle, life is easy, just grab the sequence.next_val before doing the insert (select myseq.next_val from dual) and put that in your PK field.
View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Web Database

Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.