[Full]
完整版
[Rss]
訂閱
[Xml]
無圖版
[Xhtml]
無圖版
Rss
& SiteMap
曙海教育集團論壇
http://www.bjzhda.cn
曙海教育集團論壇
◎
曙海教育集團論壇
→
Oracle數據庫
→
Oracle上機試驗報告
共1 條記錄, 每頁顯示 10 條, 頁簽:
[1]
[瀏覽完整版]
標題:Oracle上機試驗報告
1樓
wangxinxin
發表于:2010-12-11 10:58:44
以下內容含腳本,或可能導致頁面不正常的代碼
環境<font face="宋體 ">:</font><font face="Times New="New" Roman="Roman" ">SQLPlus</font><font face="宋體 ">下</font> <table class="t_table" cellspacing="0"> <tbody> <tr> <td width="609"><font size="3">SQL> select * from v$version;</font> <font size="3">BANNER</font> <font size="3">----------------------------------------------------------------</font> <font size="3">Oracle9i Release 9.2.0.1.0 - Production</font> <font size="3">PL/SQL Release 9.2.0.1.0 - Production</font> <font size="3">CORE 9.2.0.1.0 Production</font> <font size="3">TNS for 32-bit Windows: Version 9.2.0.1.0 - Production</font> <font size="3">NLSRTL Version 9.2.0.1.0 - Production</font> </td></tr></tbody></table><font face="Times New="New" Roman="Roman" "></font> <strong><font face="宋體 ">問題一:</font></strong> <strong><font face="宋體 ">問題名稱</font></strong><font face="宋體 ">:輸入字符</font><font face="Times New="New" Roman="Roman" ">&</font><font face="宋體 ">的問題</font> <strong><font face="宋體 ">問題描述</font></strong><font face="宋體 ">:在</font><font face="Times New="New" Roman="Roman" ">INSERT INTO DEPARTMENT VALUES('4','Math & Science','444');</font><font face="宋體 ">插入該條記錄的時候發現</font><font face="Times New="New" Roman="Roman" ">&</font><font face="宋體 ">及后面的字符被忽略掉了,不能正確插入(</font><font face="Times New="New" Roman="Roman" ">department</font><font face="宋體 ">表已建立,且記錄符合約束)。</font> <strong><font face="宋體 ">問題分析</font></strong><font face="宋體 ">:在</font><font face="Times New="New" Roman="Roman" ">Oracle9i</font><font face="宋體 ">中</font><font face="Times New="New" Roman="Roman" ">&</font><font face="宋體 ">是有特殊含義的字符,默認狀態其功能為指出一個變量,故不能正確插入,若想輸入必須禁用此功能或者繞過此功能。</font> <strong><font face="宋體 ">問題<span class="t_tag" onclick="tagshow(event)" href="tag.php?name=%BD%E2%BE%F6">解決</span></font></strong><font face="宋體 ">:經過檢索資料以及實驗發現有四種方法可以解決該問題。</font> <font face="Times New="New" Roman="Roman" "></font> <strong><font face="宋體 ">解決方法</font><font face="Times New="New" Roman="Roman" ">1</font></strong><font face="宋體 ">:在</font><font face="Times New="New" Roman="Roman" ">SQLPlus</font><font face="宋體 ">中使用</font><font face="Times New="New" Roman="Roman" ">set scan off</font><font face="宋體 ">命令關閉輸入檢測</font> <table class="t_table" cellspacing="0"> <tbody> <tr> <td width="595"><font size="3"> SQL>set scan off</font> <font size="3">SQL>INSERT INTO DEPARTMENT VALUES('4','Math & Science','444');</font> <font size="3"><font face="宋體 ">已創建</font> 1 <font face="宋體 ">行。</font></font> <font size="3">SQL> select * from department;</font> <font size="3"> </font><font size="3">DEPTID DEPTNAME FACULTYID</font> <font size="3">---------- -------------------- ----------</font> <font size="3"> 4 Math & Science 444</font> </td></tr></tbody></table><font face="Times New="New" Roman="Roman" "> </font> <strong><font face="宋體 ">解決方法</font><font face="Times New="New" Roman="Roman" ">2</font></strong><font face="宋體 ">:在</font><font face="Times New="New" Roman="Roman" ">SQLPlus</font><font face="宋體 ">中利用</font><font face="Times New="New" Roman="Roman" ">set define off</font><font face="宋體 ">命令關閉定義在符號</font><font face="Times New="New" Roman="Roman" ">&</font><font face="宋體 ">上的功能</font> <table class="t_table" cellspacing="0"> <tbody> <tr> <td width="595"><font size="3">SQL> set scan on</font> <font size="3">SQL> truncate table department;</font> <font size="3"><font face="宋體 ">表已截掉。</font></font> <font size="3">SQL> set define off</font> <font size="3">SQL>INSERT INTO DEPARTMENT VALUES('4','Math & Science','444');</font> <font size="3"><font face="宋體 ">已創建</font> 1 <font face="宋體 ">行。</font></font> <font size="3">SQL> select * from department;</font> <font size="3"> </font> <font size="3">DEPTID DEPTNAME FACULTYID</font> <font size="3">---------- -------------------- ----------</font> <font size="3"> 4 Math & Science 444</font> </td></tr></tbody></table><font face="Times New="New" Roman="Roman" "></font> <font face="Times New="New" Roman="Roman" "> </font><strong><font face="宋體 ">解決方法</font><font face="Times New="New" Roman="Roman" ">3</font></strong><font face="宋體 ">:利用變量輸入來繞過</font><font face="Times New="New" Roman="Roman" ">&</font><font face="宋體 ">功能</font> <table class="t_table" cellspacing="0"> <tbody> <tr> <td width="595"><font size="3">SQL> set define on</font> <font size="3">SQL> truncate table department;</font> <font size="3"><font face="宋體 ">表已截掉。</font></font> <font size="3">SQL>INSERT INTO DEPARTMENT VALUES('4',&MAJOR,'444');</font> <font size="3"><font face="宋體 ">輸入</font> major <font face="宋體 ">的值</font>: 'Math & Science'</font> <font size="3"><font face="宋體 ">原值</font>1: INSERT INTO DEPARTMENT VALUES('4',&MAJOR,'444')</font> <font size="3"><font face="宋體 ">新值</font>1: INSERT INTO DEPARTMENT VALUES('4','Math & Science','444')</font> <font size="3"><font face="宋體 ">已創建</font> 1 <font face="宋體 ">行。</font></font> <font size="3">SQL> select * from department;</font><font size="3"> DEPTID DEPTNAME FACULTYID</font> <font size="3">---------- -------------------- ----------</font><font size="3"> 4 Math & Science 444</font> </td></tr></tbody></table><font face="Times New="New" Roman="Roman" "></font> <strong><font face="宋體 ">解決方法</font><font face="Times New="New" Roman="Roman" ">4</font></strong><font face="宋體 ">:用</font><font face="Times New="New" Roman="Roman" ">chr</font><font face="宋體 ">函數來替換</font><font face="Times New="New" Roman="Roman" ">'&'</font><font face="宋體 ">字符</font> <table class="t_table" cellspacing="0"> <tbody> <tr> <td width="595"><font size="3">SQL> truncate table department;</font> <font size="3"><font face="宋體 ">表已截掉。</font></font> <font size="3">SQL> select ascii('&') from dual;</font> <font size="3">ASCII('&')</font> <font size="3">----------</font> <font size="3"> 38</font> <p align="left"><font size="3">SQL>INSERT INTO DEPARTMENT VALUES('4','Math '||chr(38)||' Science','444');</font> <font size="3"><font face="宋體 ">已創建</font> 1 <font face="宋體 ">行。</font></font> <font size="3">SQL> select * from department;</font><font size="3"> DEPTID DEPTNAME FACULTYID</font> <font size="3">---------- -------------------- ----------</font> <font size="3"> 4 Math & Science 444</font> </td></tr></tbody></table><font face="Times New="New" Roman="Roman" "></font><strong><font face="宋體 ">問題總結</font></strong><font face="宋體 ">:在上述問題的解決方法中方法</font><font face="Times New="New" Roman="Roman" ">1</font><font face="宋體 ">與方法</font><font face="Times New="New" Roman="Roman" ">2</font><font face="宋體 ">屬于</font><font face="Times New="New" Roman="Roman" ">SQLPlus</font><font face="宋體 ">命令類型,且只能用于</font><font face="Times New="New" Roman="Roman" ">SQLPlus</font><font face="宋體 ">環境中,通用性不夠。方法</font><font face="Times New="New" Roman="Roman" ">3</font><font face="宋體 ">需要人機交互,不適合<span class="t_tag" onclick="tagshow(event)" href="tag.php?name=%CF%B5%CD%B3">系統</span>的大規模的記錄。方法</font><font face="Times New="New" Roman="Roman" ">4</font><font face="宋體 ">是函數法,通用性與批處理能力都不錯,只是在可讀性方面差點。</font> <font face="Times New="New" Roman="Roman" "></font> <font face="Times New="New" Roman="Roman" "></font> <font face="Times New="New" Roman="Roman" "> B06060314</font> <font face="Times New="New" Roman="Roman" "> </font><font face="宋體 ">davelv</font>
說明:
上面顯示的是代碼內容。您可以先檢查過代碼沒問題,或修改之后再運行.
共1 條記錄, 每頁顯示 10 條, 頁簽:
[1]
Copyright © 2000 - 2009
曙海
教育集團
Powered By
曙海教育集團
Version 2.2
Processed in .03027 s, 2 queries.
[Full]
完整版
[Rss]
訂閱
[Xml]
無圖版
[Xhtml]
無圖版
主站蜘蛛池模板:
最近中文字幕国语免费完整
|
在线永久免费观看黄网站
|
精品少妇ay一区二区三区
|
黑人与中国女一级毛片不卡
|
www在线观看免费视频
|
中文字幕在线视频观看
|
久久国产综合精品swag蓝导航
|
国产在线精彩视频
|
国产精品亚洲欧美日韩一区在线
|
在线视频一区二区三区四区
|
快穿之青梅竹马女配
|
天天狠天天透天干天天怕∴
|
日本护士XXXXHD少妇
|
日韩电影中文字幕在线观看
|
污污网站在线看
|
美国式禁忌4桥矿超棒
|
顶级欧美色妇xxxxx
|
视频精品一区二区三区
|
蜜桃成熟时33d在线
|
男人j桶进女人p无遮挡在线观看
|
日韩在线视频免费播放
|
在线观看成人免费视频
|
久久亚洲sm情趣捆绑调教
|
桃花视频性视频
|
伊人婷婷综合缴情亚洲五月
|
青草青草视频2免费观看
|
国产精品毛片va一区二区三区
|
国产日韩精品一区二区三区
|
两个人看的WWW在线观看
|
日本69xxxx
|
亚洲二区在线视频
|
欧美成成人免费
|
免费A级毛片无码免费视频
|
精品国产三级a∨在线
|
国产在线19禁免费观看
|
5x社区精品视频在线播放18
|
在线观看中文字幕第一页
|
中文在线最新版天堂
|
把女人弄爽大黄a大片片
|
久久综合精品国产二区无码
|
最近中文字幕免费mv视频8
|