I created a button and in it I created a dynamic action so that it captures everything I type in the text field.
This is the code I put on the button:
DECLARE l_result VARCHAR2(4000); -- Run the typed PL/SQL command EXECUTE IMMEDIATE :P 2_INPUT INTO l_result;
-- Display the result in the output field :P 3_OUTPUT := l_result; EXCEPTION WHEN OTHERS THEN -- In case of error, display the message in the output field :P 3_OUTPUT := 'Error: ' || SQLERRM; END;
However, it is giving the error:
ORA-06550: line 1, column 114: PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following: ( - + case mod new not null continue avg count current exists max min prior SQL stddev sum variance execute forall merge time timestamp interval date pipe <an alternatively-quoted string literal.
My logic was:
I need a variable to receive what I typed, and another to receive the result of the query or action I typed, an output.