Member Avatar for jward50

Hi
I am trying to create a stored procedure to list node titles with either a Y or a N if there is a coresponding record in another table, I am very new to stored procedures and am not sure how I get the data out and into a list, I am not even sure if this stored procedure makes any sense any help appreciated.

CREATE PROCEDURE test ()
BEGIN
if exists
(select b.tid
from node a,taxonomy_index b, taxonomy_term_data c
where c.tid = b.tid
and c.vid= 3
and b.tid = 11
and c.tid = b.tid
and a.nid = b.nid)
then select a.title,'Y';
else select a.title,'N';
END IF;
END;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.