{"id":951,"date":"2025-01-15T00:30:09","date_gmt":"2025-01-14T16:30:09","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=951"},"modified":"2025-01-15T00:30:09","modified_gmt":"2025-01-14T16:30:09","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88%e5%9c%a8-oracle-%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%bc%95%e5%8f%b7%e4%bc%9a%e5%af%bc%e8%87%b4-%e8%a1%a8%e6%88%96%e8%a7%86%e5%9b%be%e4%b8%8d%e5%ad%98%e5%9c%a8","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/01\/15\/%e4%b8%ba%e4%bb%80%e4%b9%88%e5%9c%a8-oracle-%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%bc%95%e5%8f%b7%e4%bc%9a%e5%af%bc%e8%87%b4-%e8%a1%a8%e6%88%96%e8%a7%86%e5%9b%be%e4%b8%8d%e5%ad%98%e5%9c%a8\/","title":{"rendered":"\u4e3a\u4ec0\u4e48\u5728 Oracle \u4e2d\u4f7f\u7528\u5f15\u53f7\u4f1a\u5bfc\u81f4 \u2018\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728\u2019 \u9519\u8bef\uff1f\u89e3\u51b3\u65b9\u6cd5\u8be6\u89e3"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\uff0c\u5f53\u6211\u4eec\u5728\u67e5\u8be2\u8868\u65f6\u9047\u5230 <code>'\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728'<\/code> \u9519\u8bef\uff0c\u4e14\u5728\u8868\u540d\u4f7f\u7528\u4e86\u5f15\u53f7\u65f6\uff0c\u901a\u5e38\u662f\u7531\u4e8e\u5bf9\u8868\u540d\u7684\u5927\u5c0f\u5199\u654f\u611f\u5904\u7406\u5f15\u53d1\u7684\u95ee\u9898\u3002\u7406\u89e3\u8fd9\u4e00\u70b9\uff0c\u5bf9\u4e8e\u5728 Oracle \u4e2d\u7f16\u5199\u6709\u6548\u7684 SQL \u67e5\u8be2\u81f3\u5173\u91cd\u8981\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u4e3a\u4ec0\u4e48\u5728 Oracle \u4e2d\u5bf9\u8868\u540d\u4f7f\u7528\u5f15\u53f7\u4f1a\u5bfc\u81f4 <code>'\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728'<\/code> \u9519\u8bef\uff0c\u5e76\u89e3\u91ca\u5982\u4f55\u907f\u514d\u8fd9\u4e00\u95ee\u9898\u3002<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>Oracle \u7684\u5bf9\u8c61\u540d\u79f0\u5904\u7406<\/strong><\/h3>\n\n\n\n<p>Oracle \u6570\u636e\u5e93\u5728\u5904\u7406\u8868\u540d\u3001\u5217\u540d\u548c\u5176\u4ed6\u5bf9\u8c61\u540d\u79f0\u65f6\u6709\u7279\u5b9a\u7684\u89c4\u5219\uff0c\u5c24\u5176\u662f\u5728 <strong>\u5927\u5c0f\u5199\u5904\u7406<\/strong> \u548c <strong>\u5f15\u53f7\u4f7f\u7528<\/strong> \u4e0a\u3002\u5173\u952e\u70b9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5927\u5c0f\u5199\u654f\u611f<\/strong>\uff1a\u5f53\u5bf9\u8c61\u540d\u79f0\uff08\u5982\u8868\u540d\u3001\u5217\u540d\uff09\u7528\u5f15\u53f7\u62ec\u8d77\u6765\u65f6\uff0cOracle \u4f1a <strong>\u4e25\u683c\u533a\u5206\u5927\u5c0f\u5199<\/strong>\uff0c\u5373\u6240\u5b9a\u4e49\u7684\u540d\u79f0\u5fc5\u987b\u4e0e\u67e5\u8be2\u65f6\u5b8c\u5168\u5339\u914d\u5927\u5c0f\u5199\u3002<\/li>\n\n\n\n<li><strong>\u4e0d\u4f7f\u7528\u5f15\u53f7\u65f6<\/strong>\uff1a\u5982\u679c\u6ca1\u6709\u4f7f\u7528\u5f15\u53f7\uff0cOracle \u4f1a\u5c06\u8868\u540d\u548c\u5217\u540d\u8f6c\u6362\u4e3a\u5927\u5199\uff0c\u5e76\u5728\u67e5\u8be2\u65f6\u81ea\u52a8\u5ffd\u7565\u5927\u5c0f\u5199\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>\u4e3a\u4ec0\u4e48\u4f7f\u7528\u5f15\u53f7\u4f1a\u5bfc\u81f4 <code>'\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728'<\/code> \u9519\u8bef\uff1f<\/strong><\/h3>\n\n\n\n<p>\u5f53\u4f60\u5728\u521b\u5efa\u8868\u65f6\u4f7f\u7528\u5f15\u53f7\uff0cOracle \u4f1a\u5c06\u5bf9\u8c61\u540d\u79f0\u5b58\u50a8\u4e3a <strong>\u4e25\u683c\u7684\u5927\u5c0f\u5199<\/strong> \u683c\u5f0f\u3002\u95ee\u9898\u7684\u6838\u5fc3\u5728\u4e8e\uff0cOracle \u5728\u6267\u884c\u67e5\u8be2\u65f6\u5e76\u4e0d\u4f1a\u81ea\u52a8\u5c06\u5e26\u5f15\u53f7\u7684\u5bf9\u8c61\u540d\u8f6c\u6362\u4e3a\u5927\u5199\uff0c\u800c\u662f\u5fc5\u987b\u5b8c\u5168\u5339\u914d\u5b9a\u4e49\u65f6\u4f7f\u7528\u7684\u5927\u5c0f\u5199\u683c\u5f0f\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2.1. <strong>\u521b\u5efa\u8868\u65f6\u4f7f\u7528\u5f15\u53f7<\/strong><\/h4>\n\n\n\n<p>\u5047\u8bbe\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u8868\u65f6\u4f7f\u7528\u5f15\u53f7\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE \"EmployeeDetails\" (\n    \"EmployeeID\" NUMBER,\n    \"EmployeeName\" VARCHAR2(100)\n);<\/code><\/pre>\n\n\n\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cOracle \u4f1a\u5c06\u8868\u540d <code>\"EmployeeDetails\"<\/code> \u548c\u5217\u540d <code>\"EmployeeID\"<\/code>\u3001<code>\"EmployeeName\"<\/code> \u5b58\u50a8\u4e3a <strong>\u4e25\u683c\u7684\u5927\u5c0f\u5199\u683c\u5f0f<\/strong>\uff0c\u5373\u5b58\u50a8\u4e3a <code>\"EmployeeDetails\"<\/code>, <code>\"EmployeeID\"<\/code>, \u548c <code>\"EmployeeName\"<\/code>\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2.2. <strong>\u67e5\u8be2\u8868\u65f6\u4f7f\u7528\u9519\u8bef\u7684\u5927\u5c0f\u5199<\/strong><\/h4>\n\n\n\n<p>\u5047\u5982\u6211\u4eec\u5c1d\u8bd5\u4f7f\u7528\u4e0d\u540c\u7684\u5927\u5c0f\u5199\u67e5\u8be2\u8be5\u8868\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT employeeid, employeename FROM employeedetails;<\/code><\/pre>\n\n\n\n<p>\u7531\u4e8e\u8868\u540d <code>\"EmployeeDetails\"<\/code> \u548c\u5217\u540d <code>\"EmployeeID\"<\/code>\u3001<code>\"EmployeeName\"<\/code> \u5728\u521b\u5efa\u65f6\u90fd\u7528\u4e86\u5f15\u53f7\uff0cOracle \u4f1a\u8ba4\u4e3a\u8fd9\u4e9b\u540d\u79f0 <strong>\u5fc5\u987b\u5b8c\u5168\u5339\u914d\u5927\u5c0f\u5199<\/strong>\u3002\u7531\u4e8e\u6211\u4eec\u67e5\u8be2\u65f6\u6ca1\u6709\u6309\u7167\u521b\u5efa\u65f6\u7684\u51c6\u786e\u5927\u5c0f\u5199\uff0cOracle \u4f1a\u629b\u51fa\u4ee5\u4e0b\u9519\u8bef\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ORA-00942: \u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>\u4e3a\u4ec0\u4e48\u4f1a\u629b\u51fa <code>'\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728'<\/code> \u9519\u8bef\uff1f<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u4e2a\u9519\u8bef\u7684\u53d1\u751f\u662f\u56e0\u4e3a\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5927\u5c0f\u5199\u654f\u611f\u6027<\/strong>\uff1a\u5f53\u8868\u540d\u548c\u5217\u540d\u88ab\u5f15\u53f7\u62ec\u8d77\u6765\u65f6\uff0cOracle \u4f1a\u5b58\u50a8\u8fd9\u4e9b\u540d\u79f0 <strong>\u6309\u5b57\u9762\u503c<\/strong>\uff08\u5373\u5305\u62ec\u5927\u5c0f\u5199\u5dee\u5f02\uff09\u3002\u56e0\u6b64\uff0c\u5f53\u4f60\u5728\u67e5\u8be2\u4e2d\u4e0d\u5b8c\u5168\u5339\u914d\u8fd9\u4e9b\u5927\u5c0f\u5199\u65f6\uff0cOracle \u4f1a\u65e0\u6cd5\u627e\u5230\u5bf9\u5e94\u7684\u8868\u6216\u5217\uff0c\u4ece\u800c\u629b\u51fa <code>'\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728'<\/code> \u9519\u8bef\u3002<\/li>\n\n\n\n<li><strong>\u9690\u5f0f\u8f6c\u6362\u95ee\u9898<\/strong>\uff1a\u6ca1\u6709\u5f15\u53f7\u65f6\uff0cOracle \u4f1a\u81ea\u52a8\u5c06\u8868\u540d\u548c\u5217\u540d\u8f6c\u6362\u4e3a\u5927\u5199\u3002\u56e0\u6b64\uff0c\u4f60\u53ef\u4ee5\u5728\u67e5\u8be2\u65f6\u4f7f\u7528\u4efb\u4f55\u5927\u5c0f\u5199\u683c\u5f0f\uff0c\u800c Oracle \u4f1a\u81ea\u52a8\u505a\u8f6c\u6362\u3002\u4f46\u662f\uff0c\u4f7f\u7528\u5f15\u53f7\u521b\u5efa\u7684\u540d\u79f0\u4e0d\u4f1a\u8fdb\u884c\u8f6c\u6362\uff0c\u5fc5\u987b\u5b8c\u5168\u5339\u914d\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>\u5982\u4f55\u907f\u514d <code>'\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728'<\/code> \u9519\u8bef\uff1f<\/strong><\/h3>\n\n\n\n<p>\u4e3a\u4e86\u907f\u514d <code>'\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728'<\/code> \u9519\u8bef\uff0c\u53ef\u4ee5\u9075\u5faa\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4.1. <strong>\u907f\u514d\u4f7f\u7528\u5f15\u53f7<\/strong><\/h4>\n\n\n\n<p>\u6700\u4f73\u7684\u505a\u6cd5\u662f\u5728\u521b\u5efa\u8868\u548c\u5217\u65f6\u5c3d\u91cf <strong>\u907f\u514d\u4f7f\u7528\u5f15\u53f7<\/strong>\u3002\u8fd9\u6837\uff0cOracle \u4f1a\u81ea\u52a8\u5c06\u6240\u6709\u5bf9\u8c61\u540d\u79f0\u8f6c\u6362\u4e3a\u5927\u5199\uff0c\u4f60\u5728\u67e5\u8be2\u65f6\u5c31\u4e0d\u5fc5\u62c5\u5fc3\u5927\u5c0f\u5199\u4e0d\u5339\u914d\u7684\u95ee\u9898\u3002\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE EmployeeDetails (\n    EmployeeID NUMBER,\n    EmployeeName VARCHAR2(100)\n);<\/code><\/pre>\n\n\n\n<p>\u67e5\u8be2\u65f6\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u5927\u5c0f\u5199\u683c\u5f0f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT employeeid, employeename FROM employeedetails;  -- \u6b63\u5e38\u6267\u884c<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">4.2. <strong>\u5728\u67e5\u8be2\u4e2d\u59cb\u7ec8\u4f7f\u7528\u6b63\u786e\u7684\u5927\u5c0f\u5199<\/strong><\/h4>\n\n\n\n<p>\u5982\u679c\u786e\u5b9e\u9700\u8981\u4f7f\u7528\u5f15\u53f7\u6765\u4fdd\u6301\u5927\u5c0f\u5199\uff08\u4f8b\u5982\uff0c\u8868\u540d\u4e2d\u5305\u542b\u7a7a\u683c\u6216\u7279\u6b8a\u5b57\u7b26\uff09\uff0c\u90a3\u4e48\u5728\u67e5\u8be2\u65f6\u5fc5\u987b <strong>\u4e25\u683c\u5339\u914d<\/strong> \u521b\u5efa\u65f6\u4f7f\u7528\u7684\u5927\u5c0f\u5199\u3002\u4f8b\u5982\uff0c\u5047\u8bbe\u8868\u540d\u548c\u5217\u540d\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE \"EmployeeDetails\" (\n    \"EmployeeID\" NUMBER,\n    \"EmployeeName\" VARCHAR2(100)\n);<\/code><\/pre>\n\n\n\n<p>\u67e5\u8be2\u65f6\uff0c\u5fc5\u987b\u5b8c\u5168\u6309\u7167\u521b\u5efa\u65f6\u7684\u5927\u5c0f\u5199\u683c\u5f0f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT \"EmployeeID\", \"EmployeeName\" FROM \"EmployeeDetails\";<\/code><\/pre>\n\n\n\n<p>\u4efb\u4f55\u5927\u5c0f\u5199\u4e0d\u4e00\u81f4\u7684\u67e5\u8be2\u90fd\u4f1a\u5bfc\u81f4 <code>'\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728'<\/code> \u9519\u8bef\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4.3. <strong>\u4f7f\u7528\u7edf\u4e00\u7684\u547d\u540d\u7ea6\u5b9a<\/strong><\/h4>\n\n\n\n<p>\u5982\u679c\u4f60\u5728\u9879\u76ee\u4e2d\u4f7f\u7528\u4e86\u5f15\u53f7\u5e76\u4e25\u683c\u533a\u5206\u5927\u5c0f\u5199\uff0c\u786e\u4fdd\u6240\u6709\u5f00\u53d1\u4eba\u5458\u9075\u5faa\u76f8\u540c\u7684\u547d\u540d\u7ea6\u5b9a\u3002\u5bf9\u4e8e\u56e2\u961f\u5f00\u53d1\uff0c\u53ef\u4ee5\u901a\u8fc7 <strong>\u4ee3\u7801\u5ba1\u67e5<\/strong> \u6216 <strong>\u89c4\u8303\u6587\u6863<\/strong> \u5f3a\u5236\u6267\u884c\u4e00\u81f4\u7684\u5927\u5c0f\u5199\u89c4\u5219\uff0c\u4ee5\u907f\u514d\u7531\u4e8e\u5927\u5c0f\u5199\u4e0d\u5339\u914d\u800c\u5bfc\u81f4\u7684\u9519\u8bef\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>\u603b\u7ed3<\/strong><\/h3>\n\n\n\n<p>\u5728 Oracle \u4e2d\uff0c\u5bf9\u8868\u540d\u4f7f\u7528\u5f15\u53f7\u4f1a\u5bfc\u81f4 <code>'\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728'<\/code> \u9519\u8bef\uff0c\u539f\u56e0\u662f Oracle \u4f1a <strong>\u4e25\u683c\u4fdd\u7559\u5bf9\u8c61\u540d\u79f0\u7684\u5927\u5c0f\u5199<\/strong>\u3002\u8fd9\u610f\u5473\u7740\u5728\u67e5\u8be2\u65f6\uff0c\u5fc5\u987b\u5b8c\u5168\u5339\u914d\u8868\u540d\u548c\u5217\u540d\u7684\u5927\u5c0f\u5199\u683c\u5f0f\u3002\u5982\u679c\u67e5\u8be2\u65f6\u672a\u80fd\u4e25\u683c\u5339\u914d\uff0cOracle \u4f1a\u629b\u51fa <code>'\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728'<\/code> \u9519\u8bef\u3002\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u95ee\u9898\uff0c\u5efa\u8bae\u5c3d\u91cf\u4e0d\u4f7f\u7528\u5f15\u53f7\uff0c\u6216\u8005\u5728\u4f7f\u7528\u5f15\u53f7\u65f6\u786e\u4fdd\u67e5\u8be2\u65f6\u4e5f\u4e25\u683c\u5339\u914d\u5bf9\u8c61\u540d\u79f0\u7684\u5927\u5c0f\u5199\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\uff0c\u5f53\u6211\u4eec\u5728\u67e5\u8be2\u8868\u65f6\u9047\u5230 &#8216;\u8868\u6216\u89c6\u56fe\u4e0d\u5b58\u5728&#8217; \u9519\u8bef\uff0c\u4e14\u5728\u8868\u540d\u4f7f\u7528\u4e86\u5f15\u53f7\u65f6\uff0c\u901a\u5e38\u662f\u7531\u4e8e\u5bf9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69],"tags":[],"class_list":["post-951","post","type-post","status-publish","format-standard","hentry","category-oracle"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=951"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/951\/revisions"}],"predecessor-version":[{"id":952,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/951\/revisions\/952"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}