右欄
歡迎您:游客!請先
登錄
或
注冊
風格
恢復默認設置
|
展區
文件集瀏覽
圖片集瀏覽
Flash瀏覽
音樂集瀏覽
電影集瀏覽
|
搜索
|
社區游戲中心
曙海教育集團論壇
→
開發語言培訓專區
→
Oracle數據庫
→ Oracle上機試驗報告
新的主題
投票帖
交易帖
小字報
下一主題 >>
<< 上一主題
共有
6776
人關注過本帖
樹形
打印
主題:Oracle上機試驗報告
wangxinxin
小
大
1樓
個性首頁
|
博客
|
信息
|
搜索
|
郵箱
|
主頁
|
UC
加好友
發短信
等級:青蜂俠
帖子:
1393
積分:14038
威望:0
精華:0
注冊:
2010-11-12 11:08:23
Oracle上機試驗報告
Post By: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>
說明:
上面顯示的是代碼內容。您可以先檢查過代碼沒問題,或修改之后再運行.
支持
(
0
)
中立
(
0
)
反對
(
0
)
單帖管理
舉報帖子
使用道具
|
引用
|
回復
下一主題 >>
<< 上一主題
返回版面帖子列表
Oracle上機試驗報告
回復標題:
上傳附件:
簽名
:
不顯示
顯示
RSS2.0
Xhtml無圖版
Xslt無圖版
Copyright © 2000 - 2009
曙海
教育集團
Powered By
曙海教育集團
Version 2.2
頁面執行時間 0.01563 秒, 3 次數據查詢
主站蜘蛛池模板:
啊灬啊灬啊灬快灬深用力
|
强波多野结衣痴汉电车
|
催眠医生动漫在线观看
|
青娱乐精品视频在线观看
|
在线播放亚洲第一字幕
|
久久久久久亚洲精品中文字幕
|
欧美日韩一区二区在线视频
|
又黄又爽又色又刺激的视频
|
日产一区日产片
|
国产精品自产拍在线观看
|
中文字幕无码免费久久
|
最新版天堂中文在线官网
|
欧美野外疯狂做受xxxx高潮
|
日本伊人色综合网
|
亚洲第一成人在线
|
白桦楚然小说叫什么
|
国产又色又爽又黄刺激在线视频
|
97影院在线午夜
|
天干天干天啪啪夜爽爽AV
|
久久久亚洲欧洲日产国码二区
|
果冻传媒高清完整版在线观看
|
偷看农村妇女牲交
|
亚洲伊人精品综合在合线
|
精品国产人成亚洲区
|
国产大片b站免费观看推荐
|
91网站免费观看
|
天天在线天天综合网色
|
久久99蜜桃精品久久久久小说
|
日韩视频在线一区
|
亚洲电影免费观看
|
熟妇人妻VA精品中文字幕
|
四虎精品在线视频
|
野花社区视频www
|
国产精品一区二区电影
|
a级在线观看视频
|
奇米综合四色77777久久
|
久久99精品视免费看
|
日本成人不卡视频
|
亚洲一级毛片中文字幕
|
欧美多人野外伦交
|
亚洲综合无码无在线观看
|