473,395 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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?
Nov 13 '05 #1
2 1128
-----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:
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?


Nov 13 '05 #2
"Richard Hollenbeck" <ri****************@verizon.net> wrote in message news:<R2******************@nwrddc03.gnilink.net>.. .
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?


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.
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: avinash | last post by:
hi my self avi i want to copy data from one table to other table,by giving certain condition and i want o use insert statement .in this i want to pass some value directly and some value from...
8
by: Rom | last post by:
I'm a bit confused as to how the STL set works with the <setname>.insert() and <setname>.find() functions Compiler used : CodeWarrior 5.0 My intial interpretation was that I needed to overload...
2
by: wenmang | last post by:
Hi, all: I am reading the book "The C++ Stadnard Library" by Josuttis. I have trouble to understand operations for the insert iterator(page 272). ++itr, *itr and itr++ are defined as no-op, and...
6
by: Mark P | last post by:
Some time ago I posted here about inserting into a set with a hint: ...
6
by: Marcel Hug | last post by:
Hi all ! I have a table in my database, which has 3 attributes. IDFailureControl, ControlDate and ControlVersion. In the following function I test, if the date of today allready exists. Then I...
3
by: brianbasquille | last post by:
Hello all, Strange little problem here... am just trying to insert some basic information into an Access Database using OleDB. I'm getting a "Syntax error in Insert Into statement" when it...
10
by: surya | last post by:
i have a table name is HH table it has two columns 'hhno' and hhname' HH tabele hhno hhname 100 suresh 101 baba 103 ram...
2
by: Sam | last post by:
Recently started using DB_DataObject with a Postgresql DB. Seems pretty nice, but I am not sure if insert() is supposed to be able to return the id of a recently returned object. It just seems to...
10
by: Aditya | last post by:
Hi All, I would like to know how it is possible to insert a node in a linked list without using a temp_pointer. If the element is the first element then there is no problem but if it is in...
5
by: maestroQC | last post by:
Hi, Its one of those days. I cannot solve this. Any help would be greatly appreciated! When I execute this: class Db(object): def insertAccount(self, date, accountNumber, description,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.