Usually we need to check the table is exist or not before create a new table, In Mysql database, that's very easy, 'cause mysql default sql statement support exist check, But in Oracle it's quite complicated. the following is a solution to validate the table is existable before create it in Oracle Platform:
Assuming APPVersion table already exist in database through the following sql statement:
create table AppVersion (
NAME varchar2(30) primary key not null,
VERSION varchar2(30) not null,
INSTALLED DATE not null
);
The Following PL/SQL can implement exist validation before create table APPVersion duplicated:
DECLARE
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE APPVERSION';
EXCEPTION WHEN OTHERS THEN NULL;
COMMIT;
END;
/
分享到:
相关推荐
log4j-99.0-does-not-exist.jar 处理logback和log4j的包冲突
前端开源库-check-files-exist检查文件是否存在,检查给定的文件选择器数组或单个选择器是否解析为文件。
Laravel开发-laravel-exist-db-client 为Laravel5的exist db提取XML RPC调用的客户端
- FIX: In THistory.DeleteActions added validation of FActionIndex (FActionIndex could appear beyond the list boundaries). Thanks to Giedrius Matonis. - ADD: Added the method TCustomProp.Assign - a ...
Laravel开发-exist-db-rest-client 用于通过RESTAPI查询和转换现有数据库结果的Laravel客户端
安装npx degit line-o/gulp-exist-example#main my-new-app你可以做的事假设您使用默认的admin帐户在localhost:8080上运行一个existdb 5。 否则,您需要更改.existdb.json的设置。第一次测试运行gulp install 看看...
GRANT CREATE TABLE TO klb; 那么这样授权是否就OK呢?答案是这样授权会报错“The specified schema name “dbo” either does not exist or you do not have permission to use it.” 需要授予下面权限,登录名klb...
# if the executables do not exist -- display error if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ] then echo "Oracle startup: cannot start" exit 1 fi # depending on parameter -- startup, ...
现在市面上的swagger UI不足之处 1、原生UI显示的有些不够漂亮和清晰,特别是request 的model部分 2、每个服务都需要引入一套资源文件,不能作为一个中间件为其他API使用 3、默认通用配置繁琐,每个项目都需要复制...
使用eXist的XML-RPC API部署并查询eXist-db的gulp插件。 先决条件 为了使用gulp-exist您将需要安装 (在版本4或更高版本中)。 当然,还有一个正在运行的实例(建议使用4.7.1或更高版本)。 安装 在您的项目文件夹...
exist-ws-commons-util-1.0.2.jar,base64 加密解密 在 Java 中把 .NET 使用 Convert.ToBase64String 转换出的 Base64 还原
使用user/repo#branch模式检查 github 存储库中是否存在给定的分支/标签/发布。...// first will check if branch exists// if not exist, will check if tag with name `master` exists// at last if not e
jar包,亲测可用
jar包,亲测可用
jar包,亲测可用
jar包,亲测可用
jar包,亲测可用
jar包,亲测可用
jar包,亲测可用
jar包,亲测可用