Solved

Getting the row I just inserted

Posted on 2000-02-17
2
136 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
ID: 2534350
<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
ID: 2536263
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

840 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