【问题标题】:How to create if-then-else statement in an oracle sql script?如何在 oracle sql 脚本中创建 if-then-else 语句?
【发布时间】:2015-11-20 15:11:13
【问题描述】:

我正在编写一个 sql 脚本,我应该问一个问题,然后继续取决于用户的输入。

我试过这个:

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?如果可能,请给我一个例子。

【问题讨论】:

标签: oracle prompt sql-scripts


【解决方案1】:

【讨论】:

  • 链接失效
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多