Solved

Getting the row I just inserted

Posted on 2000-02-17
2
118 Views
Last Modified: 2013-12-24
Using CFQUERY and SQL, how do I get the row I just inserted - I have a column that is an AutoNumber, and I need to get the number of the record I just added so I can refer to it in other tables. Help!
0
Comment
Question by:Arachn1d
2 Comments
 
LVL 4

Accepted Solution

by:
FRehman earned 50 total points
Comment Utility
<cfquery name="GetName" datasource="#DSN#">
select max(columnid) as maximum from table1
</cfquery>
use this columnid for another table
<cfquery name="hello" datasource="#DSN#">
select * from table2
where table2.testid=#GetName.maximum#
</cfquery>
this is you requrment
0
 

Author Comment

by:Arachn1d
Comment Utility
Not really what I was looking for, but I came up with an alternative in the mean time.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now