如何在oracle sql脚本中创建if-then-else语句?
我正在编写一个sql脚本,whitch应该问一个问题,是否继续将取决于用户的输入 我试过这个:如何在oracle sql脚本中创建if-then-else语句?,oracle,prompt,sql-scripts,Oracle,Prompt,Sql Scripts,我正在编写一个sql脚本,whitch应该问一个问题,是否继续将取决于用户的输入 我试过这个: prompt script started accept partitioning prompt "Do you want to partition the table? (Y/N):" if ($partitioning=Y) prompt ok, it will be partitioned else prompt ok, it won't be partitioned end;
prompt script started
accept partitioning prompt "Do you want to partition the table? (Y/N):"
if ($partitioning=Y)
prompt ok, it will be partitioned
else
prompt ok, it won't be partitioned
end;
但我明白了
ORA-00900异常,此处不允许使用if语句
有没有一种方法可以在单个sql脚本中使用if-then-else?如果可能的话,请给我举个例子。在评论中,我得到了答案:
你在使用哪个SQL客户机?oracle,我编辑了这个问题,对不起,我认为你把sqlplus和SQL搞混了。但是你可以试试这个——Oracle是DBMS,不是SQL客户机。链接断了