Inside the function ,
I am having the following function,
create or replace
FUNCTION DiffMaxMinPrice
return double precision
is
diffprice double precision := 0;
minprice long;
maxprice long;
value long;
indexid number(19,0);
begin
for row in
(SELECT x.* into minprice , maxprice
FROM sampletable ,
XMLTABLE ('//book'
PASSING sampletable.xmlcol
COLUMNS maxprice VARCHAR2(30) PATH '@maxprice',
minprice VARCHAR2(30) PATH '@minprice') x
where sampletable.indexid = 2)
LOOP
....
END LOOP;
return 1;
end;
Instead of hard coding with 2, i would like to substiute the variable idxid. I keep getting invalid number when I substituted a variable there.
indexid :=2
And the where part of the select statement as
sampletable.indexid = indexid