sql - Run plpgsql program to update the data in table -
i using postgres 8.4. want update data using plpgsql , cursor. when try run plpgsql generates error.
create or replace function updatescore() returns void $$ declare singletopiccriteriapercentage decimal(6,10); sitepercentage decimal(6,10); singlesitecriteriapercentage decimal(6,10); totalsocre decimal(6,10); cursor1 cursor select id sitereviews order id; cursor2 cursor select weight rating sitereviews_ratingcriteria site_id = id; id sitereviews.id%type; weight sitereviews_ratingcriteria.weight%type; begin singletopiccriteriapercentage := (10 / 120) * 100; sitepercentage : 0.0; singlesitecriteriapercentage := 0.0; totalsocre := 0.0; open cursor1; loop fetch cursor1 id; exit when not found; totalsocre := 0.0; open cursor2; loop fetch cursor2 weight; exit when not found; sitepercentage := singletopiccriteriapercentage * weight; singlesitecriteriapercentage := (sitepercentage / 100) * 10; totalsocre := singlesitecriteriapercentage + totalsocre; end loop; close cursor2; update sitereviews set weight = : round(totalsocre) current of cursor1; end loop close cursor1; end; $$ language 'plpgsql' following error when try run program :
error: not load library "c:/program files/postgresql/8.4/lib/plpgsql.dll": application has failed start because side-by-side configuration incorrect. please see application event log or use command-line sxstrace.exe tool more detail. sql state: 58p01
it postgresql installation not complete or broken. in older postgresql installators plpgsql optional. so, please, check installation.
Comments
Post a Comment