Connecting Tech Pros Worldwide Help | Site Map

INSERT INTO confusion

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 01:33 AM
Richard Hollenbeck
Guest
 
Posts: n/a
Default INSERT INTO confusion

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, 01:33 AM
MGFoster
Guest
 
Posts: n/a
Default 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, 01:33 AM
Pieter Linden
Guest
 
Posts: n/a
Default 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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.