Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with stored proc

Status
Not open for further replies.

krisc13

Programmer
Jul 17, 2006
42
US
I am not sure this is the right forum. I am trying to use a stored procedure for mySql.

Code:
CREATE PROCEDURE `f_agent`.`cust_prop` ()
BEGIN
  INSERT INTO `f_agent`.`customer__property`
  (`cust_prop_cust_id`, `cust_prop_prop_id`)
  SELECT `customer`.`cust_id` `cust_prop_cust_id`, `property`.`prop_id` `cust_prop_prop_id`
  FROM `f_agent`.`customer`
  INNER JOIN `f_agent`.`property`
  ON `customer`.`prev_cust_id` = `property`.`prev_cust_id`
END

I get an error on my INSERT statement. Just trying to do a large data migration and find another way besides php. Thought maybe I could do this one in mySQL. I just want to populate my table with the customer ids and property ids that have matching previous customer ids. Any assistance would be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top