Any idea why this is prompting me for the value? I'm calling the script via batch file:
DECLARE
precount NUMBER;
nowcount NUMBER;
BEGIN
SELECT COUNT(*) INTO precount FROM PLAN_OFFER_BK_PRE_SCRIPT WHERE COV_IN = 'Y' AND PLAN_IN = 'Y';
SELECT COUNT(*) INTO nowcount FROM PLAN_OFFER WHERE COV_IN = 'Y' AND PLAN_IN = 'Y';
END;
/
-- NUMBER OF MEC/MVP RECORDS
SPOOL logs\MVP_MEC_UPDATED.log APPEND
PROMPT &&CLIENTID &&precount &&nowcount
SPOOL OFF;
Thanks!
Best Answer
The ampersand character (
&
) prompts for values before execution time by default. That is not how you display values of variables. Try the below instead.Passing a variable to a script in SQL*Plus. The script, let's say,
1.sql
:Invoking it:
Where 101 is the
CLIENTID
. Or:Where
%CLIENTID%
is a variable in your batch script.