MySqlTalk.com  

Go Back   MySqlTalk.com > MySQL > Database Design
User Name
Password
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread
Old 11-11-2004, 05:41 PM   #1
kfschaefer
Junior Member
 
Join Date: Nov 2004
Posts: 2 kfschaefer is on a distinguished road
Creating a table/view of a Window's Directory

Is it possible to create a view of a specific Windows File Directory & its contents.

I have a file directory containing numerous txt files that I will need to access and update a table in SQL - comparing file name and last date modified.



Any suggestions will be greatly appreciated.



Karen
kfschaefer is offline   Fork this post Reply With Quote
Old 12-01-2004, 05:00 AM   #2
Vmusic
Junior Member
 
Join Date: Dec 2004
Posts: 11 Vmusic is on a distinguished road
Re: Creating a table/view of a Window's Directory

Karen,
What you have is a hierarchical relationship. A file can (at one time) be in only one folder, or have one parent.

Even if I copy a file, so it's in two folders, it's really a different instance of the file.

This hierarchical relationship can be defined through recursion. I might suggest something like:

table file
file_id (auto increment), file_type, file_nm, file_extension, file_description, creation_dt, creation_userid, last_update_dt, last_update_userid, parent_id

If I have a file 'myfile.txt' in a folder or directory called MyDocuments, then I have two rows in the file table

One row for the MyDocuments folder or directory, where the file_type might be 'DIRECTORY' (as opposed to 'FILE'), and the file_exention and parent_id would be NULL. Here the file_id = 23

One row for the 'myfile.txt' where the file_type is 'FILE', and the file_id here is 37 and the parent_id =23.

NOW.... If I move this file to another folder, then I have to change the parent_id.


I have done some of this in php and MySQL for web sites... it's a little trciky because you have to be sure every piece of code that can change your files also updates your database. This is a GREAT WAY to capture additional meta data about your files however.

Hope that helps!!!
Vmusic
Vmusic is offline   Fork this post Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Navicat (Windows) version 6.1.10 is now released NavicatGuy Announcements 0 01-11-2005 11:55 PM
3.3 Creating and Using a Database Administrator Documentation 13 06-09-2004 04:56 PM
2 Installing MySQL Administrator Documentation 103 06-09-2004 02:53 AM



All times are GMT -4. The time now is 06:12 AM.



Powered by: vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Google
  Web http://www.mysqltalk.com
DISCLAIMERS:
1. We have no commercial interest in this site.
Banner Ads and Subscriptions will only be used to help pay for hosting and maintenance costs.
2. MySQLTalk.com is NOT affiliated with MySQL AB in any way.
3. MySQLTalk.com is NOT endorsed by MySQL AB in any way.
4. Please do not post any content that is harmful to MySQL or MySQL AB, meaning no misleading or obsolete information will be tolerated.
Well-founded constructive criticism meant to help the community is permitted.
5. This website is founded with the goal of improving the MySQL community.
We not only tolerate newbies, we encourage them.
Please do not ask newbies to "read the manual".