You can simply include the value in the SELECT list. A simplified
version, using constants, though you would use values from your
application.
INSERT table_a(CourseID,Name,Address)
SELECT 1234, Name, Address
FROM table_a
WHERE Course ID = 5678
Roy Harvey
Beacon Falls, CT
On Mon, 12 May 2008 12:38:51 -0700 (PDT), ll <barn104_1999@[EMAIL PROTECTED]
>
wrote:
>I'm working on a way to copy most data columns from another row in the
>same table to a new row and insert the courseID value from the form
>that executes this action (the copy). Is it possible to have both
>"values" and "select" in the same Insert Into statement?
>Here's what I have (below). The "CopyCourseID" is the id of the
>course that is copied to the new row, although the new row will have a
>different course ID ("CourseID").
>---------------------------------------------------------------
>
>strCourseID=Request.Form("CourseID")
>Insert table_a(CourseID,Name,Address)
>Values(strCourseID)
>Select Name, Address
>From table_a
>Where Course ID = Request.Form("CopyCourseID")
>------------------------------------------------------------------
>
>Thanks,
>Louis


|