RobReynolds
Technical User
I have an Impromptu report off an Oracle database that uses direct SQL to retrieve a value from the previous row. Ex this query:
select c1, lag(c1,1) over (order by c1) c2
from table;
will return:
c1 c2
row1
row2 row1
row3 row2
I would like to be able to use an Impromptu user defined function as to avoid the direct SQL. On the orfunct.ini under the database specific function list I've added an entry for
lag=
under the details:
[lag]
label=lag
param=3
return=A
1=DA,DT,NM,CH,IN,TM:A;Expr
2=NM;Expr
3=DA,DT,NM,CH,IN,TM:A;Expr
exp=lag ( ^1 , ^2 ) over ( order by [ , ^3 ] * )
tip=Syntax: UDF Function for previous row
tip1=Enter first expression
tip2=enter offset
tip3=Order by
I've created a cogudfor.sql with:
DECLARE DATABASE FUNCTION LAG( STRING, NUMBER ) OVER (ORDER BY STRING)
RETURNS STRING
FUNCTION NAME LAG;
when I go into Impromptu I don't see the new function 'lag'. Has anyone else tried to do this? Any ideas?
select c1, lag(c1,1) over (order by c1) c2
from table;
will return:
c1 c2
row1
row2 row1
row3 row2
I would like to be able to use an Impromptu user defined function as to avoid the direct SQL. On the orfunct.ini under the database specific function list I've added an entry for
lag=
under the details:
[lag]
label=lag
param=3
return=A
1=DA,DT,NM,CH,IN,TM:A;Expr
2=NM;Expr
3=DA,DT,NM,CH,IN,TM:A;Expr
exp=lag ( ^1 , ^2 ) over ( order by [ , ^3 ] * )
tip=Syntax: UDF Function for previous row
tip1=Enter first expression
tip2=enter offset
tip3=Order by
I've created a cogudfor.sql with:
DECLARE DATABASE FUNCTION LAG( STRING, NUMBER ) OVER (ORDER BY STRING)
RETURNS STRING
FUNCTION NAME LAG;
when I go into Impromptu I don't see the new function 'lag'. Has anyone else tried to do this? Any ideas?