I need to call a procedure from a CASE-WHEN statement, from a script. Is this permissible? I want to do something like:
SQL SCRIPT:
set autoprint on
set linesize 80
set serveroutput on
SELECT type,
(COUNT(CASE WHEN (called_procedure(field1,field2) = 1)
THEN (CASE WHEN EXISTS (SELECT 1
FROM TABLE
WHERE ....)
THEN NULL ELSE 1 END)
ELSE 0 END)) as alias1,
......
FROM TABLE;
--------
CREATE OR REPLACE procedure pairs_comb (v_field1 IN VARCHAR2, v_field2 IN NUMBER)
AS
begin
.....
.....
end;
Could someone please give me an example of how this could be done?
Thanks
ponderena
SQL SCRIPT:
set autoprint on
set linesize 80
set serveroutput on
SELECT type,
(COUNT(CASE WHEN (called_procedure(field1,field2) = 1)
THEN (CASE WHEN EXISTS (SELECT 1
FROM TABLE
WHERE ....)
THEN NULL ELSE 1 END)
ELSE 0 END)) as alias1,
......
FROM TABLE;
--------
CREATE OR REPLACE procedure pairs_comb (v_field1 IN VARCHAR2, v_field2 IN NUMBER)
AS
begin
.....
.....
end;
Could someone please give me an example of how this could be done?
Thanks
ponderena