At 02:56 PM 9/28/2004, you wrote:

Then I need help getting on the right track here. What I really want to do
is something like the following:

INSERT INTO wow.resume_erp (Candidate_ID, Section_ID, Section_Value) SELECT
* FROM wow.resume r WHERE r.Candidate_ID = '13103';

You need to match up the columns in the Insert to the Select statement (they both have to have the same number of columns and same column types are preferred). So explicitly specify the columns in the Select statement as:


INSERT INTO wow.resume_erp (Candidate_ID, Section_ID, Section_Value) SELECT
Candidate_ID, Section_ID, Section_Value FROM wow.resume r WHERE r.Candidate_ID = '13103';


Using "*" on your Select statements to fill an Insert is dangerous because the table structure could change in the future.

Mike


INSERT INTO wow.candidate_erp
(Candidate_ID, Vendor_ID, Last_Name, First_Name, Middle_Initial,
Condition_Type, Employer, Country_ID, Visa_Status, Dt_Visa, MMDD_Birth, SSN,
CSG_Comments, Working, Available, Start_Date, Location, HoldOnPeriod,
Relocation, Tech_Ranking, Comm_Ranking, Availability, Cert_Comments,
Dt_Submitted, Def_Rate, Def_Rate_Unit, Other_Country, Currency_id,
Interview_Availability, Interview_Contact, US_Experience, Location_Country)
SELECT *
FROM wow.candidate c
WHERE c.Candidate_ID = '13103';

Yet pulled from the resultset in this query:

SELECT * FROM wow.resume r INNER JOIN wow.candidate c WHERE r.Section_ID =
'1' AND MATCH (r.Section_Value) AGAINST ('+baan' IN BOOLEAN MODE) AND
c.Candidate_ID = r.Candidate_ID;

Perhaps the above isn't set up correctly, as when I attempt these queries:

INSERT INTO wow.candidate_erp
(Candidate_ID, Section_ID, Section_Value)
SELECT SQL_CALC_FOUND_ROWS *
FROM wow.candidate;

INSERT INTO wow.resume_erp
(Candidate_ID, Vendor_ID, Last_Name, First_Name, Middle_Initial,
Condition_Type, Employer, Country_ID, Visa_Status, Dt_Visa, MMDD_Birth, SSN,
CSG_Comments, Working, Available, Start_Date, Location, HoldOnPeriod,
Relocation, Tech_Ranking, Comm_Ranking, Availability, Cert_Comments,
Dt_Submitted, Def_Rate, Def_Rate_Unit, Other_Country, Currency_id,
Interview_Availability, Interview_Contact, US_Experience, Location_Country)
SELECT SQL_CALC_FOUND_ROWS *
FROM wow.resume;

...it returns an error of 1136: Column count doesn't match value count at
row 1. The query "INSERT INTO wow.resume_erp (Candidate_ID, Section_ID,
Section_Value) SELECT * FROM wow.resume r WHERE r.Candidate_ID = '13103';"
is impractical when my results are over 400.

Thanks,
Eve


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to