ORACLE cursor to select a race horses position will not work -


here table trying query using cursor:

    create table raceresult      (raceid number(5),     horseid number(5),     jockeyid number(5) not null,     position varchar2 (3)); 

i have written function query , return horse id's have come first in race.

  create or replace function get_horse   (horsepos in varchar2)   return varchar2     pos varchar2;    cursor c_horse      select horseid    raceresult   position=horsepos;   begin  open c_horse;  fetch c_horse pos;-  if pos%notfound  pos := 9999;  else if  c_horse = ('1st')  return pos;   end if;  close c_horse;  end get_horse; 

it not work, , beyond puzzled on try next.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -