我想创建一个存储过程,但给我一个错误:子查询为以下查询返回多于1行。这可以使用游标来完成,但有没有其他方法可以直接在存储过程中运行此查询而无需使用游标,因为有多种查询需要在存储过程中添加多个表。存储过程错误:子查询返回多于1行
查询: -
UPDATE ipcc_patent_ipc_class
SET assignee_type = (
SELECT IF(ipcc_patent_master.assignee_type='$ipcc_config_param[0]',$ipcc_config_value[0],IF(ipcc_patent_master.assignee_type='$ipcc_config_param[1]',$ipcc_config_value[1],null))
FROM ipcc_patent_master
WHERE ipcc_patent_ipc_class.patent_id = patent_uid);
但这查询工作的多个领域: -
UPDATE ipcc_patent_ipc_class
SET geographies_id=(
SELECT ipcc_geographies.geographies_uid
FROM ipcc_patent_master,ipcc_geographies
WHERE ipcc_patent_master.geographies = ipcc_geographies.geographies
AND ipcc_patent_ipc_class.patent_id = ipcc_patent_master.patent_uid
),
jurisdictions_id =(
SELECT ipcc_jurisdictions.jurisdisctions_uid
FROM ipcc_patent_master,ipcc_jurisdictions
WHERE ipcc_patent_master.jurisdictions = ipcc_jurisdictions.jurisdictions
AND ipcc_patent_ipc_class.patent_id = ipcc_patent_master.patent_uid
),
country_code_id =(
SELECT ipcc_country_code.country_code_uid
FROM ipcc_patent_master,ipcc_country_code
WHERE ipcc_patent_master.country_code= ipcc_country_code.country_code
AND ipcc_patent_ipc_class.patent_id = ipcc_patent_master.patent_uid
);
你能确切的报价错误,并与您正在试图*确切的SQL *创建SP? – Unreason 2010-12-03 08:26:08