I need help. I have a problem in constructing my PL/SQL block.
In the cursor, I have a query constructed, and i want to insert a filter on cursor. Below is an example:
DECLARE
code NUMBER;
parameters_amb myOthertable%ROWTYPE;
CURSOR test is SELECT id from mytable
if parameters_amb.test2 is not null then
where mytable.name = 'NAMETABLE'
else
where mytable.name = 'NAMETABLE2';
Can anyone assist me in this construction?
You can try it like this:
Or like this: