Connecting Tech Pros Worldwide Help | Site Map

INSERT INTO confusion

  #1  
Old November 13th, 2005, 02:33 AM
Richard Hollenbeck
Guest
 
Posts: n/a
In a gradebook database, every new semester, several classes will have
identical groups of activities (i.e. "Participation," "Essays," "Exams,
etc.) They will also have the same weights as in other semesters. So when
creating a new class (or course) I have a form with two combo boxes: one
that selects [courses].[courseCode] to copy from and another that selects
[courses].[courseCode] for a newer course to copy to. Now I want to copy
[groups].[groupWeight] and [groups].[groupDescription] from the older course
and add [groups].[courseCode] from the new course and append all these
groups into the new course.

Example:

courseCode: 12345
Participation 25
Essays 50
Exams 25

might be appended to same table as

courseCode: 23456
Participation 25
Essays 50
Exams 25

where 23456 is the courseCode of the new course and 12345 is the course I'm
copying from.

Do I first need to assemble the data into a temporary table then append the
temp table data back into the groups table? Or can I do it directly with a
query?


  #2  
Old November 13th, 2005, 02:33 AM
MGFoster
Guest
 
Posts: n/a

re: INSERT INTO confusion


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

INSERT INTO Table1 (courseCode, Participation, Essays, Exams)
SELECT 23456, Participation, Essays, Exams
FROM Table1
WHERE courseCode = 12345

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQQ/Yp4echKqOuFEgEQJJ1gCfSnCPf+5pz8K4AgZfM8GD/rE7bYIAoNHb
JllM30HYmxOcCBOZNfaZ4goc
=W2Tv
-----END PGP SIGNATURE-----


Richard Hollenbeck wrote:
[color=blue]
> In a gradebook database, every new semester, several classes will have
> identical groups of activities (i.e. "Participation," "Essays," "Exams,
> etc.) They will also have the same weights as in other semesters. So when
> creating a new class (or course) I have a form with two combo boxes: one
> that selects [courses].[courseCode] to copy from and another that selects
> [courses].[courseCode] for a newer course to copy to. Now I want to copy
> [groups].[groupWeight] and [groups].[groupDescription] from the older course
> and add [groups].[courseCode] from the new course and append all these
> groups into the new course.
>
> Example:
>
> courseCode: 12345
> Participation 25
> Essays 50
> Exams 25
>
> might be appended to same table as
>
> courseCode: 23456
> Participation 25
> Essays 50
> Exams 25
>
> where 23456 is the courseCode of the new course and 12345 is the course I'm
> copying from.
>
> Do I first need to assemble the data into a temporary table then append the
> temp table data back into the groups table? Or can I do it directly with a
> query?[/color]

  #3  
Old November 13th, 2005, 02:33 AM
Pieter Linden
Guest
 
Posts: n/a

re: INSERT INTO confusion


"Richard Hollenbeck" <richard.hollenbeck@verizon.net> wrote in message news:<R2MPc.18102$Je5.8560@nwrddc03.gnilink.net>.. .[color=blue]
> In a gradebook database, every new semester, several classes will have
> identical groups of activities (i.e. "Participation," "Essays," "Exams,
> etc.) They will also have the same weights as in other semesters. So when
> creating a new class (or course) I have a form with two combo boxes: one
> that selects [courses].[courseCode] to copy from and another that selects
> [courses].[courseCode] for a newer course to copy to. Now I want to copy
> [groups].[groupWeight] and [groups].[groupDescription] from the older course
> and add [groups].[courseCode] from the new course and append all these
> groups into the new course.
>
> Example:
>
> courseCode: 12345
> Participation 25
> Essays 50
> Exams 25
>
> might be appended to same table as
>
> courseCode: 23456
> Participation 25
> Essays 50
> Exams 25
>
> where 23456 is the courseCode of the new course and 12345 is the course I'm
> copying from.
>
> Do I first need to assemble the data into a temporary table then append the
> temp table data back into the groups table? Or can I do it directly with a
> query?[/color]

I see no reason why you can't do it directly. You could use a form to
select the old course Code and type in a new one. then you could
validate both of them and run the insert.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert into MySQL Database with PHP POST Method ctrap answers 3 December 19th, 2007 03:47 PM
C# / SQL Related - what's wrong with this Insert Into syntax? brianbasquille@gmail.com answers 3 February 16th, 2006 07:45 AM
OleDBDataAdapter => Insert and Update of data values in a Database Marcel Hug answers 6 December 31st, 2005 04:15 PM
DataView confusion Steve answers 13 November 20th, 2005 01:32 PM