{"id":2107,"date":"2011-08-22T13:22:49","date_gmt":"2011-08-22T11:22:49","guid":{"rendered":"http:\/\/touk.pl\/blog\/?p=2107"},"modified":"2023-03-22T12:18:19","modified_gmt":"2023-03-22T11:18:19","slug":"date-lub-number-jako-nazwa-kolumny","status":"publish","type":"post","link":"https:\/\/touk.pl\/blog\/2011\/08\/22\/date-lub-number-jako-nazwa-kolumny\/","title":{"rendered":"DATE lub NUMBER jako nazwa kolumny"},"content":{"rendered":"<p>Wydawa\u0142oby si\u0119, \u017ce skoro mo\u017cna nazwa\u0107 kolumn\u0119 &#8220;DATE&#8221; je\u015bli umie\u015bci si\u0119 ten wyraz w cudzys\u0142owach to jest to bezpieczne. Okazuje si\u0119 jednak, \u017ce u\u017cywanie tej nazwy powoduje nast\u0119puj\u0105cy b\u0142\u0105d kompilacji w procedurze wykorzystuj\u0105cej na wej\u015bciu typ wierszowy na tej tabeli: ORA-06552: PL\/SQL: Compilation unit analysis terminated ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed Dzieje si\u0119 tak, mimo \u017ce widok na tej tabeli dzia\u0142a poprawnie i mo\u017cna przez niego wrzuca\u0107 dane. Podobny b\u0142\u0105d wyst\u0119puje, gdy kolumna nazywa si\u0119 NUMBER, ale dla VARCHAR, VARCHAR2, INTEGER, FLOAT, TIMESTAMP, CLOB, LOB, CHAR, LONG precedura dzia\u0142a poprawnie. Poni\u017cej test dla typu DATE<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">create table test_date ( \"DATE\" date );\r\ncreate table test_date2 ( \"DATE2\" date );\r\n\r\n-- ta procedura si\u0119 nie kompiluje\r\ncreate procedure pr_test_date(p_date test_date%rowtype) as\r\nbegin\r\n null;\r\nend;\r\n\r\ncreate procedure pr_test_date2(p_date2 test_date2%rowtype) as\r\nbegin\r\n null;\r\nend;\r\n\r\ncreate view v_test_date as select * from test_date;\r\ncreate view v_test_date2 as select * from test_date2;\r\n\r\ninsert into v_test_date(\"DATE\") values (sysdate);<\/pre>\n","protected":false},"excerpt":{"rendered":"Wydawa\u0142oby si\u0119, \u017ce skoro mo\u017cna nazwa\u0107 kolumn\u0119 &#8220;DATE&#8221; je\u015bli umie\u015bci si\u0119 ten wyraz w cudzys\u0142owach to jest to&hellip;\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[687,13],"_links":{"self":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/2107"}],"collection":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/comments?post=2107"}],"version-history":[{"count":8,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/2107\/revisions"}],"predecessor-version":[{"id":15477,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/2107\/revisions\/15477"}],"wp:attachment":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/media?parent=2107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/categories?post=2107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/tags?post=2107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}