George Cross - 2004-12-08

Hi,

I just have to say LXR is the best tool!  I recently installed it on HP-UX11.00, with Oracle 8.1.7 server, and had to modify the initdb-oracle.sql file.  I've provided it here incase it might help anyone else.  lib/LXR/Index/Oracle.pm is also provided in another posting today to this newsgroup.

Cheers,  George

-- initdb-oracle.sql for lxr 0.9.3
----------------------------------------
drop sequence lxr_filenum;
drop sequence lxr_symnum;
drop sequence lxr_declnum;
drop table lxr_indexes;
drop table lxr_usage;
drop table lxr_symbols;
drop table lxr_releases;
drop table lxr_status;
drop table lxr_files;
drop table lxr_declarations;
drop trigger lxr_filenumtrigger;
drop trigger lxr_symnumtrigger;
drop trigger lxr_declnumtrigger;

commit;

create sequence lxr_filenum;
create sequence lxr_symnum;
create sequence lxr_declnum;

commit;

create table lxr_files (            
    filename    varchar2(250),
    revision    varchar2(250),
    fileid        number,
    constraint lxr_pk_files primary key (fileid)
);

create trigger lxr_filenumtrigger
    before insert on lxr_files
    for each row
    begin
            select lxr_filenum.NEXTVAL into :new.fileid FROM DUAL;
    end;
/

commit;

alter table lxr_files add unique (filename, revision);
create index lxr_i_files on lxr_files(filename);

commit;

create table lxr_symbols (               
    symname        varchar2(250),
    symid        number,
    constraint lxr_pk_symbols primary key (symid)
);
create trigger lxr_symnumtrigger
    before insert on lxr_symbols
    for each row
    begin
            select lxr_symnum.NEXTVAL into :new.symid FROM DUAL;
    end;
/

commit;

alter table lxr_symbols add unique(symname);

commit;

create table lxr_indexes (
    symid        number,
    fileid        number,
    line        number,
    type        varchar2(250),
    relsym        number,
    constraint lxr_fk_indexes_fileid foreign key (fileid) references lxr_files(fileid),
    constraint lxr_fk_indexes_symid foreign key (symid) references lxr_symbols(symid),
    constraint lxr_fk_indexes_relsym foreign key (relsym) references lxr_symbols(symid)
);
create index lxr_i_indexes on lxr_indexes(symid);

commit;

create table lxr_releases (   
    fileid        number,
    release        varchar2(250),
    constraint lxr_pk_releases primary key (fileid,release),
    constraint lxr_fk_releases_fileid foreign key (fileid) references lxr_files(fileid)
);

commit;

create table lxr_status (
    fileid        number,
    status        number,
    constraint lxr_pk_status primary key (fileid),
    constraint lxr_fk_status_fileid foreign key (fileid) references lxr_files(fileid)
);

commit;

create table lxr_usage (               
    fileid        number,
    line        number,
    symid        number,
    constraint lxr_fk_usage_fileid foreign key (fileid) references lxr_files(fileid),
    constraint lxr_fk_usage_symid foreign key (symid) references lxr_symbols(symid)
);

create table lxr_declarations
        (declid          number,
         langid         number,
         declaration    varchar2(255),
         constraint lxr_pk_declarations primary key (declid,langid)
);

create trigger lxr_declnumtrigger
    before insert on lxr_declarations
    for each row
    begin
            select lxr_declnum.NEXTVAL into :new.declid FROM DUAL;
    end;
/

commit;
create index lxr_i_usage on lxr_usage(symid);

commit;