When doing a forum, you need to take out information about a sector in the forum. At the same time, it is necessary to obtain the moderator information (name and ID) of the sector, but the moderator may be multiple, not convenient to use the direct associated means to be implemented. It may cause a large amount of data, and increase the complexity of the program. After considering a variety of means, you can use a function to get all the master information, and spell them into a string. When the sector information is acquired, an Function is added to the SELECT statement, thereby obtaining the corresponding result. The following is a partial example: ---------- Using Function to get the moderator information Function GetownerOfTheme (p_themeid number) Return varcha2 is tempstr varcha2 (300); Tempcur Tcur; VuserId varcha2 (20); vusername varcha2 (20 ); BEGIN OPEN tempcur FOR SELECT a.userid, a.username FROM home_user a, home_forumowner b WHERE a.userid = b.userid AND b.themeid = p_themeId; LOOP FETCH tempcur INTO vuserid, vusername; EXIT WHEN tempcur% NOTFOUND OR tempcur % NOTFOUND IS NULL; TEMPSTR: = Tempstr || Vuserid || ':' || VuserName || ','; End Loop; Close Tempcur; Return Tempstr; End; --- In called stored procedure, in SELECT Calling Function PROCEDURE () IsBegin Select Themeid, GetownerOfTheme (Themeid) Owner from Home_forumTheme Order by ThemeId;