Ask a Question related to Coldfusion Database Access, Design and Development.
-
gbrownuk #1
Finding the Record-no after CFINSERT
I've created a vehicle maintence cf database. On the new record page the user
enters the service details and then picks parts from a like that have been
replaced. When the submit button is pressed the action page creates a new
record in the MaintenceRecord table and then needs to know the record number
which will be added to each part record insertes into the PartsReplaced table.
On creating the primary key record in the MaintenceRecord table how do I read
it for use in the ReplacedParts table. Can the CFINSERT command return the
value. If I have to do a database QUERY other record may have been created
since my record was created and I'm worried I will not receive the correc value
and the ReplacedParts may appear againce another record.
Any help would be much appreciated.
Graham Brown
gbrownuk Guest
-
cfinsert help
I would like to have people insert information into a database. It's a single table in a database, so I thought I would try <cfinsert> I'm... -
cfinsert from javascript
I have write javascript to create form field when button is click. function addEvent(myTable){ var lastRow = myTable.rows.length; var... -
Finding the most recent record in a table with otherwiseidentical field values
Hello, Would anyone be able to share how they find the MOST recent record among otherwise identical records in for example a transaction table? -
CFInsert
Hi. I was hoping I could get help on an issue. I am using CFInsert to add data from a form into two tables that are related. Table 1: Members... -
finding first unread record
I am looking for a simple way to query a table and pull up the first record with an empty value in the date_processed column. I have tried a... -
The ScareCrow #2
Re: Finding the Record-no after CFINSERT
<cftransaction>
<cfinsert>
<cfquery name="getId">
Select Max(ID) As MaxId
From myTable
</cfquery>
</cftransaction>
The cftransaction ensures that both actions are performed together.
But if your using ms access 2k or above or ms sql you can use
<cftransaction>
<cfinsert>
<cfquery name="getId">
Select @@Identity As MaxId
From myTable
</cfquery>
</cftransaction>
Ken
The ScareCrow Guest
-
gbrownuk #3
Re: Finding the Record-no after CFINSERT
That's great, I can use that. Thankyou
Graham
gbrownuk Guest



Reply With Quote

