Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: How to display all the content of the database?

by osama (Scribe)
on Jan 09, 2003 at 22:22 UTC ( [id://225667]=note: print w/replies, xml ) Need Help??


in reply to Re: How to display all the content of the database?
in thread How to display all the content of the database?

I agree with you completely, seems that the person who designed the database has no database experience....

In Oracle I would do:

create table organization( orgid number not null primary key, ordparent number, orgname varchar2(40) not null); alter table organization add constraint fk_parent foriegn key (orgpare +nt) references organization(orgid); -- start inserts for organizations insert into organization ....etc. -- end inserts for organizations create table orglevels( levelid number not null, levelname varchar2(20) not null); insert into orglevels values (1,'Sector'); insert into orglevels values (2,'Department'); insert into orglevels values (3,'Division');

You would probably get lots of data by running a query like this one (untested):

select orgid,orgname,orgparent,level,l.levelname from organization o s +tart with orgparent is null connect by prior orgid=orgparent left join orglevels l on l.levelid=level

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://225667]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-04-16 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found