plsql - ORACLE PL/SQL: Table or view does not exist -
i'd appreciate on topic since making first steps pl/sql:
when trying create function, error: "table or view not exist" 5 select statements (and statement in cursor declaration well). sure tables exist.
many in advance.
create or replace function zinskalk (vtid in number, intart in integer) return number j integer := 0; p number := 1; q number := 0; t number := 1; r number := 0; lz integer := 0; modusvn integer := 0; w1 number := 0; w2 number := 0; integer := 0; type array_typ varray (200) of number (10, 2); rarray array_typ; cursor c1 select vtobslpos.anzahl, vtobslpos.betrag vtobsl, vtobslpos vtobsl.sysid = vtobslpos.sysvtobsl , vtobsl.sysid in (select max (vtobsl.sysid) vtobsl vtobsl.sysvt = vtid , vtobsl.rang = 100) order vtobslpos.rang asc; begin select sum (vtobslpos.anzahl) lz vtobslpos, vtobsl vtobslpos.sysvtobsl = vtobsl.sysid , vtobsl.sysvt = vtid , vtobsl.sysid in (select max (sysid) vtobsl sysvt = vtid , rang = 100); select vtobsl.modus modusvn vtobsl vtobsl.sysid in (select max (sysid) vtobsl sysvt = vtid , rang = 100); select bgextern - sz + (case intart when 1 0 when 2 - (sz2 + disagio) when 3 (sz2 + disagio - provision) else 0 end) w1 vt sysid = vtid; select rw + rsv w2 vt sysid = vtid; := (case when modusvn = 0 1 else 0 end); rarray (1) := -w1; rarray (lz + 1) := w2; x in c1 loop y in 1 .. x.anzahl loop := + 1; rarray (i) := rarray (i) + x.betrag; end loop; end loop; while abs (p) >= 0.001 loop p := 0; q := 0; j := 0; z in 1 .. lz + 1 loop j := j + 1; p := p + rarray (j) * power (t, j - 1); q := q + (j - 1) * rarray (j) * power (t, j - 2); end loop; t := t - p / q; end loop; r := 1200 / t - 1200; return r; exception when others return 0; end;
i assume table belong schema schema function compiled. if have granted select on these table via role rather directly, oracle give ora-00942
.
see this stackoverflow question more information.
Comments
Post a Comment