过程创建索引

xiaoxiao2021-02-28  83

假设不知道现在是不是已经存在这个索引,重新创建这个索引的话,可能会已存在导致报错。用存储过程来处理。 存储过程中直接create index的话会报错PL-00103。需要用execute语句来处理。

declare sqlCreateIndex varchar2(200); begin sqlCreateIndex:= 'create index ind_ab on aa(a,b)'; execute immediate sqlcreate; EXCEPTION when others then null; end; /
转载请注明原文地址: https://www.6miu.com/read-27108.html

最新回复(0)