Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting the row I just inserted

Posted on 2000-02-17
2
Medium Priority
?
153 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
FRehman earned 100 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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

688 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