{"id":5027,"date":"2024-11-14T08:06:34","date_gmt":"2024-11-14T00:06:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5027\/"},"modified":"2024-11-14T08:06:34","modified_gmt":"2024-11-14T00:06:34","slug":"oracle%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b%e6%80%8e%e4%b9%88%e6%b5%8b%e8%af%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5027\/","title":{"rendered":"oracle\u6570\u636e\u7c7b\u578b\u600e\u4e48\u6d4b\u8bd5"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u6d4b\u8bd5 oracle \u6570\u636e\u7c7b\u578b\uff1a\u521b\u5efa\u6d4b\u8bd5\u8868\uff0c\u6307\u5b9a\u8981\u6d4b\u8bd5\u7684\u6570\u636e\u7c7b\u578b\u7684\u5217\u3002\u63d2\u5165\u5305\u542b\u4e0d\u540c\u503c\u7684\u6570\u636e\uff0c\u4ee5\u6d4b\u8bd5\u8303\u56f4\u548c\u8fb9\u754c\u6761\u4ef6\u3002\u67e5\u8be2\u6570\u636e\u5e76\u68c0\u67e5\u6570\u636e\u7c7b\u578b\u662f\u5426\u6309\u9884\u671f\u5de5\u4f5c\u3002\u9a8c\u8bc1\u67e5\u8be2\u7ed3\u679c\u4e2d\u663e\u793a\u7684\u6570\u636e\u7c7b\u578b\u4e0e\u6307\u5b9a\u7c7b\u578b\u76f8\u7b26\u3002\u6d4b\u8bd5\u8fb9\u754c\u6761\u4ef6\uff0c\u4f8b\u5982\u63d2\u5165\u8d1f\u503c\u6216\u8d85\u51fa\u8303\u56f4\u7684\u503c\uff0c\u786e\u4fdd\u4f1a\u5f15\u53d1\u9519\u8bef\u6216\u622a\u65ad\u3002\u6d4b\u8bd5 null \u503c\u5904\u7406\uff0c\u786e\u4fdd\u4e0d\u4f1a\u610f\u5916\u622a\u65ad\u6216\u5f15\u53d1\u9519\u8bef\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/21\/2024052111271874383.jpg\" class=\"aligncenter\" title=\"oracle\u6570\u636e\u7c7b\u578b\u600e\u4e48\u6d4b\u8bd5\u63d2\u56fe\" alt=\"oracle\u6570\u636e\u7c7b\u578b\u600e\u4e48\u6d4b\u8bd5\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u6d4b\u8bd5 Oracle \u6570\u636e\u7c7b\u578b<\/strong><\/p>\n<p>Oracle \u6570\u636e\u7c7b\u578b\u662f\u7528\u6765\u5b9a\u4e49\u5b58\u50a8\u5728\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u7684\u683c\u5f0f\u548c\u8303\u56f4\u3002\u4e3a\u4e86\u786e\u4fdd\u6570\u636e\u7684\u51c6\u786e\u6027\u548c\u4e00\u81f4\u6027\uff0c\u6d4b\u8bd5\u6570\u636e\u7c7b\u578b\u975e\u5e38\u91cd\u8981\u3002\u4ee5\u4e0b\u6b65\u9aa4\u4ecb\u7ecd\u4e86\u5982\u4f55\u6d4b\u8bd5 Oracle \u6570\u636e\u7c7b\u578b\uff1a<\/p>\n<p><strong>1. \u521b\u5efa\u6d4b\u8bd5\u8868<\/strong><\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u8868\u6765\u6d4b\u8bd5\u6570\u636e\u7c7b\u578b\u3002\u786e\u4fdd\u6307\u5b9a\u8981\u6d4b\u8bd5\u7684\u6570\u636e\u7c7b\u578b\u7684\u5217\u3002\u4ee5\u4e0b\u793a\u4f8b\u521b\u5efa\u4e00\u4e2a\u5305\u542b\u5404\u79cd\u6570\u636e\u7c7b\u578b\u7684\u6d4b\u8bd5\u8868\uff1a<\/p>\n<pre>CREATE TABLE test_datatypes (\n  id NUMBER,\n  name VARCHAR2(255),\n  age NUMBER,\n  salary NUMBER(10, 2),\n  dob DATE,\n  created_at TIMESTAMP\n);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u63d2\u5165\u6d4b\u8bd5\u6570\u636e<\/strong><\/p>\n<p>\u5c06\u5305\u542b\u4e0d\u540c\u503c\u7684\u6570\u636e\u63d2\u5165\u6d4b\u8bd5\u8868\u4e2d\u3002\u8fd9\u5c06\u5e2e\u52a9\u60a8\u6d4b\u8bd5\u6570\u636e\u7c7b\u578b\u7684\u8303\u56f4\u548c\u8fb9\u754c\u6761\u4ef6\u3002\u4ee5\u4e0b\u793a\u4f8b\u63d2\u5165\u4e00\u4e9b\u6d4b\u8bd5\u6570\u636e\uff1a<\/p>\n<pre>INSERT INTO test_datatypes (id, name, age, salary, dob, created_at) VALUES (\n  1, 'John', 30, 10000.00, '1990-01-01', '2023-01-01'\n);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u67e5\u8be2\u6570\u636e<\/strong><\/p>\n<p>\u4f7f\u7528 SQL \u67e5\u8be2\u6765\u68c0\u7d22\u8868\u4e2d\u7684\u6570\u636e\u5e76\u68c0\u67e5\u6570\u636e\u7c7b\u578b\u662f\u5426\u6309\u9884\u671f\u5de5\u4f5c\u3002\u4f8b\u5982\uff0c\u4ee5\u4e0b\u67e5\u8be2\u68c0\u7d22\u8868\u4e2d\u7684\u6240\u6709\u884c\u5e76\u663e\u793a\u6bcf\u5217\u7684\u6570\u636e\u7c7b\u578b\uff1a<\/p>\n<pre>SELECT id, name, age, salary, dob, created_at\nFROM test_datatypes;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u9a8c\u8bc1\u7ed3\u679c<\/strong><\/p>\n<p>\u6bd4\u8f83\u67e5\u8be2\u7ed3\u679c\u4e2d\u663e\u793a\u7684\u6570\u636e\u7c7b\u578b\u4e0e\u60a8\u5728\u521b\u5efa\u8868\u65f6\u6307\u5b9a\u7684\u7c7b\u578b\u3002\u786e\u4fdd\u6570\u636e\u7c7b\u578b\u6b63\u786e\u5e76\u6309\u9884\u671f\u5de5\u4f5c\u3002<\/p>\n<p><strong>5. \u6d4b\u8bd5\u8fb9\u754c\u6761\u4ef6<\/strong><\/p>\n<p>\u6d4b\u8bd5\u6570\u636e\u7c7b\u578b\u65f6\uff0c\u91cd\u8981\u7684\u662f\u6d4b\u8bd5\u8fb9\u754c\u6761\u4ef6\u3002\u4f8b\u5982\uff0c\u5411 age \u5217\u63d2\u5165\u4e00\u4e2a\u8d1f\u503c\u6216\u5411 salary \u5217\u63d2\u5165\u4e00\u4e2a\u8d85\u51fa\u6307\u5b9a\u8303\u56f4\u7684\u503c\u3002\u786e\u4fdd\u8fd9\u4e9b\u503c\u4f1a\u5f15\u53d1\u9519\u8bef\u6216\u622a\u65ad\uff0c\u4ee5\u786e\u4fdd\u6570\u636e\u5b8c\u6574\u6027\u3002<\/p>\n<p><strong>6. \u6d4b\u8bd5 NULL \u503c<\/strong><\/p>\n<p>\u8bb8\u591a\u6570\u636e\u7c7b\u578b\u5141\u8bb8\u63d2\u5165 NULL \u503c\u3002\u6d4b\u8bd5 NULL \u503c\u5904\u7406\u4e5f\u5f88\u91cd\u8981\u3002\u786e\u4fdd NULL \u503c\u4e0d\u4f1a\u610f\u5916\u622a\u65ad\u6216\u5f15\u53d1\u9519\u8bef\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6570\u636e\u7c7b\u578b\u600e\u4e48\u6d4b\u8bd5\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u6d4b\u8bd5 oracle \u6570\u636e\u7c7b\u578b\uff1a\u521b\u5efa\u6d4b\u8bd5\u8868\uff0c\u6307\u5b9a\u8981\u6d4b\u8bd5\u7684\u6570\u636e\u7c7b\u578b\u7684\u5217\u3002\u63d2\u5165\u5305\u542b\u4e0d\u540c\u503c\u7684\u6570\u636e\uff0c\u4ee5\u6d4b\u8bd5\u8303\u56f4\u548c\u8fb9\u754c\u6761\u4ef6\u3002\u67e5\u8be2\u6570\u636e\u5e76\u68c0\u67e5\u6570\u636e\u7c7b\u578b\u662f\u5426\u6309\u9884\u671f\u5de5\u4f5c\u3002\u9a8c\u8bc1\u67e5\u8be2\u7ed3\u679c\u4e2d\u663e\u793a\u7684\u6570\u636e\u7c7b\u578b\u4e0e\u6307\u5b9a\u7c7b\u578b\u76f8\u7b26\u3002\u6d4b\u8bd5\u8fb9\u754c\u6761\u4ef6\uff0c\u4f8b\u5982\u63d2\u5165\u8d1f\u503c\u6216\u8d85\u51fa\u8303\u56f4\u7684\u503c\uff0c\u786e\u4fdd\u4f1a\u5f15\u53d1\u9519\u8bef\u6216\u622a\u65ad\u3002\u6d4b\u8bd5 null \u503c\u5904\u7406\uff0c\u786e\u4fdd\u4e0d\u4f1a\u610f\u5916\u622a\u65ad\u6216\u5f15\u53d1\u9519\u8bef\u3002 \u5982\u4f55\u6d4b\u8bd5 Oracle \u6570\u636e\u7c7b\u578b Oracle \u6570\u636e\u7c7b\u578b\u662f\u7528\u6765\u5b9a\u4e49\u5b58\u50a8\u5728\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u7684\u683c\u5f0f\u548c\u8303\u56f4\u3002\u4e3a\u4e86\u786e\u4fdd\u6570\u636e\u7684\u51c6\u786e\u6027\u548c\u4e00\u81f4\u6027\uff0c\u6d4b\u8bd5\u6570\u636e\u7c7b\u578b\u975e\u5e38\u91cd\u8981\u3002\u4ee5\u4e0b\u6b65\u9aa4\u4ecb\u7ecd\u4e86\u5982\u4f55\u6d4b\u8bd5 Oracle \u6570\u636e\u7c7b\u578b\uff1a 1. \u521b\u5efa\u6d4b\u8bd5\u8868 \u521b\u5efa\u4e00\u4e2a\u65b0\u8868\u6765\u6d4b\u8bd5\u6570\u636e\u7c7b\u578b\u3002\u786e\u4fdd\u6307\u5b9a\u8981\u6d4b\u8bd5\u7684\u6570\u636e\u7c7b\u578b\u7684\u5217\u3002\u4ee5\u4e0b\u793a\u4f8b\u521b\u5efa\u4e00\u4e2a\u5305\u542b\u5404\u79cd\u6570\u636e\u7c7b\u578b\u7684\u6d4b\u8bd5\u8868\uff1a CREATE TABLE test_datatypes ( id NUMBER, name VARCHAR2(255), age NUMBER, salary NUMBER(10, 2), dob DATE, created_at TIMESTAMP ); \u767b\u5f55\u540e\u590d\u5236 2. \u63d2\u5165\u6d4b\u8bd5\u6570\u636e \u5c06\u5305\u542b\u4e0d\u540c\u503c\u7684\u6570\u636e\u63d2\u5165\u6d4b\u8bd5\u8868\u4e2d\u3002\u8fd9\u5c06\u5e2e\u52a9\u60a8\u6d4b\u8bd5\u6570\u636e\u7c7b\u578b\u7684\u8303\u56f4\u548c\u8fb9\u754c\u6761\u4ef6\u3002\u4ee5\u4e0b\u793a\u4f8b\u63d2\u5165\u4e00\u4e9b\u6d4b\u8bd5\u6570\u636e\uff1a INSERT INTO test_datatypes (id, name, age, salary, dob, created_at) VALUES ( 1, &#8216;John&#8217;, 30, 10000.00, &#8216;1990-01-01&#8217;, &#8216;2023-01-01&#8217; ); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-5027","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=5027"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5027\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}