如何处理标签未找到的错误? 以下是我认为相关的代码:
DECLARE
vSQL VARCHAR2 (4000);
var NUMBER;
BEGIN
vSQL := 'F_INSERT_ORDER_DATA(:P_CUSTOMER_ID,:P_NOTES);';
EXECUTE IMMEDIATE vSQL USING 1000, 'TEST' RETURNING INTO var;
DBMS_OUTPUT.PUT_LINE (var);
END;
整个代码(如果你需要,可以免费使用)
@echo off
:start
cls
title EPIC BATCH!!!
echo welcome to the epic batch file there are lots of things you can do like
echo create (create a text file)
echo exit (close this window)
echo shutdown (shutdown your computer)
echo photos (look at some pictures)
echo color (change the color of the text and the background)
echo command prompt (open command prompt)
echo anti shutdown
echo.
echo type back at any time to go back
set /p PROGRAM= What do you want do?
答案 0 :(得分:0)
您似乎没有标签:start
,因此任何尝试goto start
的例程都会导致“找不到标签”错误并终止该程序。如果你通过点击和傻笑来运行它,那么窗口就会显示为关闭。
如果您运行cmd
,则会更容易调试批处理脚本,因为这样会显示错误。
答案 1 :(得分:0)
"label not found"
错误是由goto
或call
命令引起的,但您的“相关代码”中没有任何错误!我假设 goto %PROGRAM%
下面缺少cls
行...
你应该知道:
goto notExist
错误。但是:call :notExist
错误。在这种情况下,errorlevel
值设置为1,因此所有有效的“标签”(子例程)必须通过exit /B 0
命令返回错误级别等于零的值。此外,可以隐藏错误消息将其重定向到NUL。见这个例子:
@echo off
setlocal
:start
cls
echo One
echo Two
set /p PROGRAM=What you want to do?
call :%PROGRAM% 2>NUL
if errorlevel 1 echo Error: option not valid
pause
goto start
:One
echo Option One
exit /B 0
:Two
echo Option Two
exit /B 0
无论如何,您应该使用choice
命令代替set /P
...