On Tue, Jan 03, 2012 at 11:57:46AM +0530, Durga D scratched on the wall: > Kreibich, > > You understood the problem perfectly. Thank you. > > *>>I would just suggest using a single composite path value, >>rather > than trying to break the path value down into >>individual components > and store those each in their own >>column.* > > I already with single column (/root/local/bin/create_db), but search > and listing is very difficult with single query. for ex: under root, lising > distinct folders and files.
True. LIKE and substr() could get you fairly far, but it might take two or three queries. REGEXP would get you even further, but that requires extra support. You could simply do both. Have a "path" column and a "parent" column, and use the appropriate data for the task. You are, conceptually, duplicating data, and there are issues with that. Manipulations (insert/update/delete) become a bit more costly, and the database won't be able to maintain consistancy between the two columns using simple constraints. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users