Here is my query:
PROCEDURE `fetch_g_qjo_attribute_link_pagination`(IN language varchar (255),
$pageNo int(10),
$pageSize int(10)
)
BEGIN
-- ----------------------------------------------------------------------------------
declare lang_id int;
declare rec_offset int;
if $pageNo is null
then
set $pageNo=1;
end if;
if $PageSize is null
then
set $PageSize=10;
end if;
set rec_offset = ($pageNo - 1)* $PageSize;
set lang_id = (select l.id from data_language l where l.iso_code = language);
-- -----------------------------------------------------------------------------------
(select sl.*, gn.attribute_name, gv.attribute_value, gs.subpart_name
from
g_qjo_attribute_link sl,
g_attribute_name_value_type_lin gl,
g_attribute_name gn,
g_attribute_value gv,
g_subpart gs
where gl.id = sl.attribute_id
and gl.attribute_name_code = gn.attribute_name_code
and gl.attribute_value_code = gv.attribute_value_code
and gl.subpart_code <>''
and gs.subpart_code = gl.subpart_code)
union
(select sl.*, gn.attribute_name, gv.attribute_value, '' as subpart_name
from
g_qjo_attribute_link sl,
g_attribute_name_value_type_lin gl,
g_attribute_name gn,
g_attribute_value gv,
g_subpart gs
where gl.id = sl.attribute_id
and gl.attribute_name_code = gn.attribute_name_code
and gl.attribute_value_code = gv.attribute_value_code
and gl.subpart_code ='')
order by id ASC
limit rec_offset,$pageSize;
END
It throws this error:
I am getting this error while executing the store procedure. Can anyone please help me to fix this issue. Thanks in advance.