DECLARE
Userid WEB_SITE.USERID % TYPE;
Id WEB_SITE.ID % TYPE;
CURSOR site IS select id, userid from web_site;
Begin
OPEN site;
LOOP
Fetch site into id, userid;
Exit when site % NOTFOUND;
Insert into web_model (id, userId, siteId, name, type, codeHeadLeft,
CodeHeadRight, code, codeEdit, codeWeb, model, bgColor, style)
Values (id + 1, userid, id, 'search', 'website default', '', 'search result list ',
'<Iframe id = searchDiv_dongtai width = 100% height = 2000px frameborder = no border = 0 marginwidth = 0 marginheight = 0> </iframe> <script src = "/webSite/webLink/fixed /search. js "type =" text/javascript "> </script> ',
'','', '0 ');
Insert into web_page (id, userId, siteId, model, fatherNode, fatherNodeName, name, title,
KeyWords, introduction, bgColor, posterCode, code, style, isShow, isShowImgHead, isShowNavigation,
IsShowFooter, pageType) values (id + 2, userid, id, '2', '0', '', 'search result ',
'','', '-1,-1,-1', 'widget-place-1 = | widget-place-2 = widget-' | (id + 1 ), '0', '0', '1', '1', '1', '1 ');
End loop;
Close site;
End;