473,606 Members | 2,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

importing problem

I am changing my church band scheduling system from Excel to Database. I
have assigned a schedule table in MySQL database that will be my master
schedule. It contains the following fields:

SCHEDULE TABLE
-----------------------------------------
eventid (refers to a field in my events table that contain dates
and types of events on that date)
playerid (refers to a field in my players table that contains a
list of my players)
instrumentid (refers to a field in my instruments table that contains a
list of instruments we use)
level (Lead or secondary player in your instrument)
-----------------------------------------

I have imported my Excel file into a table (temp) so I can manipulate it
within MySQL it contains the following fields:

TEMP TABLE
-----------------------------------------
eventdate (date of event they are playing on. Corresponds to the
eventdate field in my events table)
nick (my designation for each player in Excel. I created a
corresponding field in the players table to help translate)
-----------------------------------------

I need to insert into my schedule table the information from my temp table
changing the nick field into a playerid and changing the eventdate field
into an eventid. Below is my query that does not work. Instead of
inserting 209 rows (the number of records in my temp table) it inserts over
35000 rows.

INSERT INTO schedule (eventid, playerid)
SELECT p.id AS playerid, e.id AS eventid
FROM players AS p, events AS e
INNER JOIN temp AS t ON p.nick=t.nick
INNER JOIN temp ON e.eventdate=t.e ventdate

How do I limit the records I want inserted to the records in my temp table?
Jul 19 '05 #1
0 1164

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

Similar topics

12
2376
by: qwweeeit | last post by:
The pythonic way of programming requires, as far as I know, to spread a big application in plenty of more manageable scripts, using import or from ... import to connect the various modules. In some cases there is a further complication: module importing through an indirect mechanism, like: exec "from " + xxx + " import *". A part the fact that I have not understood the "real" difference between import and from ... import (or also from......
2
2726
by: steve | last post by:
Hi, I have researched but have not found a good solution to this problem. I am importing large amounts of data (over 50 Meg) into a new mysql db that I set up. I use >mysql dbname < importfile.txt But I keep getting timeouts and errors due to the data being too large. I know that since if I break the imported data into multiple chuncks (by importing a few tables at a time) then everything works.
11
3393
by: Grim Reaper | last post by:
I am importing a .csv file into Access that has 37 fields. My problem is that sometimes the last field only has data at the end of the column (it looks like when you import a file into Access, for the last field, it only checks the top few 'cells' to see if there is any data, if not, the field is not imported). How do I 'force' Access to import the field, regardless if there is data in the top of the field or not? For instance, I might...
2
3913
by: kuhni | last post by:
Hi everybody, I am totally desperate because I cannot solve a really simple problem: I have a specific text-file which I want to import into an existing database. The problem is that the columns have different names so I receive an error message when importing via the "Get External Data"-Wizard. The second problem is that this text file includes several rows without any relevant data, only symbols like "-----" in the various columns. I...
3
1806
by: Mark | last post by:
All, As you can see below, I have had problems with inquisitive souls looking at data they shouldn't be. I though disabling the ability to create new databases using my workgroup would stop this but it doesn't. All they have to do now is create a new database using the default wrkgroup, close it and then open it again whilst joined to my workgroup and they can import again. Can someone please help me stop these people importing from the FE...
5
3170
by: dixie | last post by:
If I sent a user an empty database container - dB with no tables and I needed them to import their tables into it and one of their tables was a hidden table with the prefix Usys, is there any way in code I can get that table imported without them having to go to options and show hidden tables and then import it manually? dixie
7
3296
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte buffer into the character pointer. The code looks like the following: #include <stdio.h> #include <stdlib.h> #include "stdafx.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call,
11
2436
by: kaisersose1995 | last post by:
Hi, I've got an import procedure working, using a standard import specification to import a .csv file into a temporary table. The problem i'm having is that i have 4 different sets of borrower details on the same line e.g. B1-Title, B1-Initials, B1-Surname, B2-Title, B2-Initials, B2-Surname, etc. all linked to my main borrower table via an unique account number. My 1st append query matches which account numbers are new to the main...
5
3162
by: hharriel | last post by:
Hi, I am hoping someone can help me with an issue I am having with excel and ms access. I have collected data (which are in individual excel files) from 49 different school districts. All districts have used the same excel template and populated the same 32 data fields (columns). I created one large excel file from all 49 files which gives me a master table of 60,000 or so records. I have tried to import this master table into access...
0
1601
by: James Minns | last post by:
Hi all, I have a problem with Excel 2007: it crashes when importing certain xml data, exported from another software This is the smallest file which reproduces the problem: <?xml version="1.0" standalone="yes"?> <ds_S3 xmlns="http://tempuri.org/ds_S3.xsd"> <tblTags> <StartDateAndTime>2000-01-01T00:00:00+01:00</StartDateAndTime> </tblTags>
0
8016
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7955
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8096
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8306
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5966
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5466
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2448
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1557
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.