Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE VIRTUAL PROCEDURE GetVals(IN filters string) RETURNS (json clob) OPTIONS (UPDATECOUNT 0, "REST:METHOD" 'GET', "REST:URI" 'get_vals')
- AS
- BEGIN execute immediate
- 'SELECT JSONOBJECT(JSONARRAY_AGG(JSONOBJECT(
- col1,
- col2,
- col3,
- col4,
- col5,
- col6,
- ....
- ....
- )) as "data"
- ) as json FROM(
- SELECT SUM((CASE
- WHEN ((CASE
- .....
- ....
- .....
- FROM ex_table AS ex
- JOIN table1
- ON ...
- .....
- WHERE a=b AND ' || filters || '
- GROUP BY col)
- ) AB';
- END
Add Comment
Please, Sign In to add comment