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

Sonar Gerrit Plugin Release

I am happy to announce a first release of my Sonar Gerrit plugin. This plugin reports Sonar violations on your patchsets to your Gerrit server. Sonar analyses full project, but only files included in patchset are commented on Gerrit. Please forward to project page for installation instructions. This plugin is intended to use with Gerrit Trigger plugin for Jenkins CI server. Together they provide a great tool for automatic static code analysis.I am happy to announce a first release of my Sonar Gerrit plugin. This plugin reports Sonar violations on your patchsets to your Gerrit server. Sonar analyses full project, but only files included in patchset are commented on Gerrit. Please forward to project page for installation instructions. This plugin is intended to use with Gerrit Trigger plugin for Jenkins CI server. Together they provide a great tool for automatic static code analysis.