Below is my store procedure .please help........
BEGIN
DECLARE selectQuery VARCHAR(2000);
declare finalquery varchar(2000);
declare stmt3 varchar(2000);
SET selectQuery = 'SELECT tbl_property.intId, strAddressLine1,(select strItemName from tbl_lk_item where intId=tbl_property.intPropertyCountyTypeId) as strCountyName ,(select strItemName from tbl_lk_item where intId=tbl_property.intPropertyCountryTypeId) as strCountryName ,strpostCode,(tbl_pro_adver_matchcriteria.floatAskingPrice),tbl_pro_adver_matchcriteria.intBedrooms
FROM tbl_property LEFT OUTER JOIN tbl_pro_adver_matchcriteria on tbl_property.intId = tbl_pro_adver_matchcriteria.intPro
set finalquery =CONCAT(selectQuery,strSqlQuery,' AND tbl_property.intId=1 ');
execute finalquery;
END
在MySQL執行語句 - 未知準備語句處理程序(最後查詢)給EXECUTE如何使用,同時使用動態where子句
以及我檢查查詢結果通過選擇語句它給出了正確的查詢和返回結果。所以請幫助我使用Execute語句。
SQL語法用於預處理語句 - HTTP://dev.mysql。 com/doc/refman/5.1/en/sql-syntax-prepared-statements.html – Devart