• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Create a table to store tree view structure

I want to create a table to store folder information, document information having functionality like windows explorer or tree view structure. Users can create as many as folders underneath the main folder and also they can add documents in any folder etc...Please help its very urgent expert
0
mark_land
Asked:
mark_land
  • 6
  • 3
  • 3
1 Solution
 
MikeOM_DBACommented:

Create Table Folders
(Folder_Id               VARCHAR2(40)
,Folder_Name          VARCHAR2(1024)
,Parent_Folder         VARCHAR(40));

0
 
mark_landAuthor Commented:
Thnaks..how can i write a sql query to populate data in tree view structure
0
 
MikeOM_DBACommented:

Using INSERT statements?

INSERT INTO FOLDERS VALUES('100','One Hundred',NULL);
INSERT INTO FOLDERS VALUES('110','One Hundred Ten','100');
INSERT INTO FOLDERS VALUES('111','One Hundred Eleven','110');
INSERT INTO FOLDERS VALUES('112','One Hundred Twelve','110');
INSERT INTO FOLDERS VALUES('120,'One Hundred Twenty','100');
INSERT INTO FOLDERS VALUES('121','One Hundred Twenty One','120');
INSERT INTO FOLDERS VALUES('122','One Hundred Twenty Two,'120');
INSERT INTO FOLDERS VALUES('130','One Hundred Thirty','100');
INSERT INTO FOLDERS VALUES('131','One Hundred Thirty One','130');
COMMIT:


0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
mark_landAuthor Commented:
each folder may contain documemnts too...how should i arrange the information to know which document which belongs to which folder....
0
 
abd00nCommented:
Let me continue...

Create Table Files
(Folder_Id      VARCHAR2(40)
,File_Name     VARCHAR2(1024)
,File_Type      VARCHAR(20)
,File_Size       number(18, 2)
,File_Date      Date)
,Remarks       VARCHAR(120)));
0
 
MikeOM_DBACommented:

And maybe the document itself:

Create Table Files
(Folder_Id      VARCHAR2(40)
,File_Name     VARCHAR2(1024)
,File_Type      VARCHAR(20)
,File_Size       number(18, 2)
,File_Date      Date
,Remarks       VARCHAR(120)
,Document_Source BLOB)
);
0
 
mark_landAuthor Commented:
Great ...thx...but how to store  permission information to each folder and document level for different users

say for example user1 and user2 has permission to folder 1 , folder2 and user 1 has permission to a document in folder 1

0
 
abd00nCommented:
First, you have to create the users table; following is a proposal
------------------
Create Table Users
(User_Id        VARCHAR2(10)
,User_Name   VARCHAR2(50)
,Extra_Info     VARCHAR(200)
);
------------------

Then the permissions details


Create Table Folder_Access
(Folder_Id      VARCHAR2(40)
,User_ID        VARCHAR2(10)
);
0
 
mark_landAuthor Commented:
good plan..but how to store user access level like full control, read, modify,write etc and also how can i link or join alll these table together to achieve the functionality
0
 
abd00nCommented:
Dear...
It seems that U R doing a home-work!
You don't have a clear plan for your requirements ;)
Pls comment
0
 
mark_landAuthor Commented:
you are right..its brian storming...
0
 
mark_landAuthor Commented:
i thought getting some input for my rugh requirement
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now