Hi all,
I am a newbie using Automation Designer of TOAD 12.6.
I want to make an app :
- prompt for a value
- query a database table to check that the prompted value is
the last id - Then I will execute some functions.
My steps are
- Create a variable (let it be PAYMENT_ID).
- Make a prompt action for the above variable.
- Create a file with contents with the following code
DECLARE
v_db_id NUMBER;
v_user_id NUMBER;
BEGIN
v_user_id := %PAYMENT_ID%;
SELECT ID
INTO v_db_id
FROM ( SELECT ID
FROM TABLE1
ORDER BY DESC)
WHERE ROWNUM < 2;
IF v_db_id = v_user_id THEN
RAISE_APPLICATION_ERROR(-20000, 'Missmatch');
ELSIF
NULL;
END;
END;
- Execute the above script
The problem I have is that RAISE_APPLICATION_ERROR is not recognized.
Moreover, I would like if the script fails to create an error message action.
Any ideas please ?
Thanks in advance
PS :
I tried also actionable query as follow :
(SELECT ID
FROM ( SELECT ID
FROM TABLE1
ORDER BY DESC)
WHERE ROWNUM < 2) = %PAYMENT_ID%
But the variable is not recognized..