如何在Oracle中创建脚本 [英] How to create script in oracle
问题描述
有人可以帮助我如何在Oracle中创建脚本吗?我创建了一个文件"a.sql",并执行了"@ a.sql".该文件包含创建表zxy(a number(4))"
它在一开始就完美执行.但是当我多次运行脚本时,由于表已经存在,它会引发错误.
有人可以帮我解决此问题吗?
Can anybody help me in how to create a script in Oracle. I created one file as "a.sql" and executed as "@a.sql". This file contains "create table zxy(a number(4))"
It is executed perfectly in the beginning. But when I run the script multiple times it is throwing an error as table already exists.
Can anybody help me to resolve this issue
推荐答案
it is throwing an error as table already exists.
由于第一次执行脚本时,已在数据库中创建了一个表.
现在您无法创建另一个具有相同名称的表.
你可以放桌子
并再次执行脚本,它将运行.
beacuse when you first time execute youer script , a table has been created in database.
and now you can not create another table with same name.
You can drop table
and execute script again,It runs.
create procedure myprocedure() is
begin
Drop table tablename;
Craete table query........
end;
这篇关于如何在Oracle中创建脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!