CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

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
table.
peterr


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 http://support.yessoftware.com
View profile  Send private message
E43509

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: http://www.gotocode.com/art.asp?art_id=222&
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 http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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