DATE lub NUMBER jako nazwa kolumny

Wydawałoby się, że skoro można nazwać kolumnę “DATE” jeśli umieści się ten wyraz w cudzysłowach to jest to bezpieczne. Okazuje się jednak, że używanie tej nazwy powoduje następujący błąd kompilacji w procedurze wykorzystującej na wejściu 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ę tak, mimo że widok na tej tabeli działa poprawnie i można przez niego wrzucać dane. Podobny błąd występuje, gdy kolumna nazywa się NUMBER, ale dla VARCHAR, VARCHAR2, INTEGER, FLOAT, TIMESTAMP, CLOB, LOB, CHAR, LONG precedura działa poprawnie. Poniżej test dla typu DATE

create table test_date ( "DATE" date );
create table test_date2 ( "DATE2" date );

-- ta procedura się nie kompiluje
create procedure pr_test_date(p_date test_date%rowtype) as
begin
 null;
end;

create procedure pr_test_date2(p_date2 test_date2%rowtype) as
begin
 null;
end;

create view v_test_date as select * from test_date;
create view v_test_date2 as select * from test_date2;

insert into v_test_date("DATE") values (sysdate);
You May Also Like

Micro services on the JVM part 1 – Clojure

Micro services could be a buzzword of 2014 for me. Few months ago I was curious to try Dropwizard framework as a separate backend, but didn’t get the whole idea yet. But then I watched a mind-blowing “Micro-Services Architecture” talk by Fred George. Also, the 4.0 release notes of Spring covers microservices as an important rising trend as well. After 10 years of having SOA in mind, but still developing monoliths, it’s a really tempting idea to try to decouple systems into a set of independently developed and deployed RESTful services.

Micro services could be a buzzword of 2014 for me. Few months ago I was curious to try Dropwizard framework as a separate backend, but didn’t get the whole idea yet. But then I watched a mind-blowing “Micro-Services Architecture” talk by Fred George. Also, the 4.0 release notes of Spring covers microservices as an important rising trend as well. After 10 years of having SOA in mind, but still developing monoliths, it’s a really tempting idea to try to decouple systems into a set of independently developed and deployed RESTful services.