㈠ 如何在oracle中使用存儲過程創建表,如果存在就先刪除
沒有許可權?具體點 或者貼圖!
不過應該是沒有create table和drop table的許可權吧,你試試賦下給此用戶看看
㈡ 由於dm-0的存在而無法創建存儲怎麼辦
如果是沒有許可權的話,照這下面做就OK了:
grant sysdba, dba, create session, create any table , create any view , create any index , create any procere ,
alter any table , alter any procere , drop any table , drop any view , drop any index , drop any procere ,
select any table , insert any table , update any table , delete any table
to test_data(資料庫用戶名);
首先我覺得你的邏輯有問題,既然資料庫裡面存在了表你就刪除,但是你卻把創建表的執行代碼寫在了else 條件裡面;那意思如果資料庫存在了你要創建的這張表,你的邏輯只是把它刪除,但是卻沒有創建。
下面是我整理的代碼你看看:
create or replace procere createtable(
tname varchar2
)
is
v_createsql varchar2(400);
v_dropsql varchar2(100);
v_count number(9);
begin
v_createsql:='create table '||tname||'(
a number(8) primary key,
b varchar2(20))';
v_dropsql:='drop table '||tname||' cascade constraints';
select count(*) into v_count from user_tables where table_name=upper('java7');
if v_count>0 then
execute immediate v_dropsql;
commit;
end if;
execute immediate v_createsql;
commit;
end;
begin
createtable('java7');
end;
-- select * from java7
㈢ SQL2005中怎樣批量刪除表
declare @Sql nvarchar(100); declare @dropSql nvarchar(100); declare my_cursor cursor for select name from sysobjects where name like 'R%' Open my_cursor fetch my_cursor into @Sql while @@fetch_status=0 begin set @dropSql='drop table'+' '+@Sql; EXECUTE sp_executesql @dropSql; end close my_cursor deallocate my_cursor return go 補充: 不好意思少寫一個 declare @Sql nvarchar(100); declare @dropSql nvarchar(100); declare my_cursor cursor for select name from sysobjects where name like 'R%' Open my_cursor fetch my_cursor into @Sql while @@fetch_status=0 begin set @dropSql='drop table'+' '+@Sql; EXECUTE sp_executesql @dropSql; fetch my_cursor into @Sql end close my_cursor deallocate my_cursor return go 追問: 還是不行啊,報錯,我搞不懂了! 消息3705,級別 16,狀態 1,第 1 行 無法將 DROP TABLE 用於 'rsSetSignByGrade',因為 'rsSetSignByGrade' 是 過程。請使用 DROP PROCEDURE。 消息3705,級別 16,狀態 1,第 1 行 無法將 DROP TABLE 用於 'rsCaculateTotalByGrade',因為 'rsCaculateTotalByGrade' 是 過程。請使用 DROP PROCEDURE。 消息3705,級別 16,狀態 1,第 1 行 無法將 DROP TABLE 用於 'rsAddB20ToTables',因為 'rsAddB20ToTables' 是 過程。請使用 DROP PROCEDURE。
㈣ 騰訊雲(還有誰)個人博客織夢系統源碼 php版
下面直接上代碼 復制代碼 代碼如下: <?php //date_default_timezone_set("Asia/Shanghai"); /* function create_siteinfo DONE:網站信息表 Author: DATE:2010-3-30 表結構: title 網站名 keyword 網站關鍵詞 description 網站描述 */ function create_siteinfo() { global $conn; $sql = "create table siteinfo ( title varchar(100) not null, keyword varchar(200) not null, description varchar(200) not null )"; $dropsql = "drop table if exists siteinfo"; mysql_query($dropsql,$conn)or die("刪除表siteinfo失敗!"); mysql_query($sql,$conn)or die("創建表siteinfo失敗!"); } /* function:create_article() DONE:mysql創建文章表sql語句 Author: 表結構: id 文章ID cid 歸屬類別ID abstract 文章摘要 title 文章標題 posttime 發布時間 aurhor 作者 comefrom 文章來源 comeurl 來源URL content 正文內容 keyword 關鍵詞 rank 文章等級 views 瀏覽次數 */ function create_article() { global $conn,$table_article; $sql ="create table $table_article( id int(11) auto_increment not null, cid int(5) not null, abstract varchar(300) not null, title varchar(50) not null, posttime datetime not null, author varchar(30) not null, comefrom varchar(50) not null, comeurl varchar(50) not null, content TEXT not null, keyword varchar(20) not null, rank int(2) not null, views int(5) not null, PRIMARY KEY(id) )"; $dropsql = "drop table if exists $table_article"; mysql_query($dropsql,$conn)or die("刪除資料庫失敗!"); mysql_query($sql,$conn)or die("創建資料庫失敗!"); } /* function:create_member() DONE:mysql創建會員表sql語句 Author: uid 會員ID u_name 會員名稱 u_passwd 密碼 rank 會員等級 */ function create_member() { global $conn,$table_member; $sql = "create table $table_member( uid int(5) auto_increment not null, u_name varchar(20) not null UNIQUE, u_passwd varchar(100) not null, rank int(2) not null, PRIMARY KEY(uid) )"; $dropsql = "drop table if exists $table_member"; mysql_query($dropsql,$conn)or die("刪除資料庫失敗!"); mysql_query($sql,$conn)or die("創建資料庫失敗!"); } /* function:create_class DONE:sql創建分類sql語句 Author: 表結構: cid 類類別ID cname 類名 */ function create_class() { global $conn,$table_class; $sql = "create table $table_class( cid int(5) auto_increment not null, cname varchar(50) not null UNIQUE, PRIMARY KEY(cid) )"; $dropsql = "drop table if exists $table_class"; mysql_query($dropsql,$conn)or die("刪除".$table_class."失敗!"); mysql_query($sql,$conn)or die("創建表".$table_class."失敗"); } /* function:create_guest DONE:sql創建留言板sql語句 Author: 表結構: gid 留言ID g_name 留言用戶名 g_site 用戶個人主頁 g_mail 用戶郵箱 g_cid 留言位置(哪篇文章或者是留言板) */ function create_guest() { global $conn,$table_guest; $sql = "create table $table_guest( gid int(11) auto_increment not null, g_name varchar(50) not null, g_site varchar(50) not null, g_mail varchar(50) not null, g_cid int(5) not null, PRIMARY KEY(gid) )"; $dropsql = "drop table if exists $table_guest"; mysql_query($dropsql,$conn)or die("刪除表".$table_guest."失敗"); mysql_query($sql,$conn)or die("創建表".$table_guest."失敗"); } function create_sql() { global $table_article,$table_member,$table_class,$table_guest,$conn; echo "創建siteinfo表\r……"; create_siteinfo(); echo "完成<br>"; echo "創建".$table_article."表\r……"; create_article(); echo "完成<br>"; echo "創建".$table_member."表\r……"; create_member(); echo "完成<br>"; echo "創建".$table_class."表\r……"; create_class(); echo "完成<br>"; echo "創建".$table_guest."表\r……"; create_guest(); echo "完成<br>"; mysql_close($conn); } ?>
㈤ Teardrops In The Rain 歌詞
歌曲名:Teardrops In The Rain
歌手:Joe Brown&The Bruvvers
專輯:The Joe Brown Story: The Piccadilly/Pye Anthology
TEARDROPS IN THE RAIN
C.N.BLUE
NOW OR NEVER
qlseven製作
no one ever sees
no one feels the pain
teardrops in the rain
i wish upon a star i wonder where you are
i wish you're coming back to me again
and everything's the same like it used to be
...
i see the days go by and still i wonder why
i wonder why it has to be this way
why can't i have you here just like it used to be
i don't know which way to choose
how can i find a way to go on
i don't know if i can go on without you oh
......
even if my heart's still beating just for you
i really know you are not feeling like i do
and even if the sun is shining over me
how come i still freeze?
no one ever sees no one feels the pain
i shed teardrops in the rain
i wish i could fly i wonder what you say
i wish you're flying back to me again
hope everything's same like it used to be
i don't know which way to choose
how can i find a way to go on
i don't know if i can go on without you oh
even if my heart's still beating just for you
i really know you are not feeling like i do
and even if the sun is shining over me
how come i still freeze?
no one ever sees no one feels the pain
i shed teardrops in the rain
i shed teardrops in the rain
teardrops in the rain
even if my heart's still beating just for you
i really know you are not feeling like i do
and even if the sun is shining over me
how come i still freeze?
no one ever sees no one feels the pain
i shed teardrops in the rain
teardrops in the rain
teardrops in the rain
teardrops in the rain
http://music..com/song/7566394
㈥ 幫忙看一下這個存儲過程,sqlserver200的,執行的時候報錯
其實你可以把報錯信息也貼上來,這樣也省大家時間;
內容沒細看,看起來應該是
Exec(@SQLString)
出錯了;
這種最容易出現的是引號不匹配,多一個少一個,或者字串長度不夠被截了,或者字元串中出現了全形字元~
不管怎樣,建議在Exec之前,先Print 一下~
直接看Print出來的語句,我想你應該就不用求助別人了~
這個方法很好用,我一直用~
㈦ oracle下面如何使用'create table create table
想問什麼??