HI,
How do I rewrite the first query using the datafrom query 2 so that I
can do multipe inserts for all the units given this input:
@.EnrolmentID,
@.dteEnroled,
@.Outcome,
@.CourseID
-- 1. This creates one unit enrolment using parameters
INSERT INTO tblUnitEnrolment (EnrolmentID,EnrolDate,Outcome,
QualUnitID) VALUES (@.EnrolmentID,@.dteEnroled,@.Outcome, @.QualUnitID)
-- 2. This gets a list of Unit ID's for a given Course
SELECT QualUnitID FROM QualUnits WHERE QualID=(SELECT QualID FROM
COURSES WHERE CourseID=@.intCourse)Hi
I'm not sure understand your question
INSERT INTO tblUnitEnrolment (EnrolmentID,EnrolDate,Outcome,
QualUnitID) SELECT @.EnrolmentID,@.dteEnroled,@.Outcome, QualUnitID FROM
QualUnits WHERE QualID=(SELECT QualID FROM
COURSES WHERE CourseID=@.intCourse)
"hals_left" <cc900630@.ntu.ac.uk> wrote in message
news:1130322728.990452.313140@.g43g2000cwa.googlegroups.com...
> HI,
> How do I rewrite the first query using the datafrom query 2 so that I
> can do multipe inserts for all the units given this input:
> @.EnrolmentID,
> @.dteEnroled,
> @.Outcome,
> @.CourseID
>
> -- 1. This creates one unit enrolment using parameters
> INSERT INTO tblUnitEnrolment (EnrolmentID,EnrolDate,Outcome,
> QualUnitID) VALUES (@.EnrolmentID,@.dteEnroled,@.Outcome, @.QualUnitID)
> -- 2. This gets a list of Unit ID's for a given Course
> SELECT QualUnitID FROM QualUnits WHERE QualID=(SELECT QualID FROM
> COURSES WHERE CourseID=@.intCourse)
>|||Thanks - that does the trick
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment