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でのステートメントを実行使い方 - 不明プリペアドステートメントハンドラを(最後のクエリ)ダイナミック使用している間、where句
よく私はそれが正しいクエリを返し、結果を返すselect文でクエリ結果を確認します。私はExecuteステートメントを使用して助けてください。
SQL構文プリペアドステートメントのための - のhttp://dev.mysql。 com/doc/refman/5.1/ja/sql-syntax-prepared-statements.html – Devart