Hello:
Here is the situation:
There is a table (FILELOCATION) with two columns, one has an ID
(integer) and another one is called FILES (string). BTW, these are
not
my creation!
The FILES column contain location of various files. Examples are as
follows:
ID Files
---
------------------------------------------------------------------
1 C:\WINDOWS\Help\AGT0406.HLP
2 C:\WINDOWS\Help\iisHelp\common\400.htm
3 C:\WINDOWS\Help\masked98.chi
and so on.
The requirement is to select files from FileLocation table
and display the data as following columns:
FilesPath Folder Path FileName Prefix Suffix
------------- --------- ------- ------------- --------
--------
Example result of the above columns after running query would be as
follows:
FilesPath
Folder FileName Prefix Sufix
-------------------------------------------------
--------- -------------- --------
-------
C:\WINDOWS\Help\masked98.chi C:\WINDOWS\Help\ masked98.chi masked
98
Essentially, the data shown in Files column of the FileLocation table
has to be parsed and shown in five different results columns. If there
is no
Prefix or Suffix, NULL should be displayed (Example above: "400.htm"
which
has no suffix whereas "masked98" has a suffix of "masked").
Pseudo code may look as follows:
select files as FilesPath, files as xxxx(xxxx,xxxx) Folder,
files as xxxx(xxxx,xxxx) as FileName
and so on.
Will appreciate your quick thoughts. Thanks!
Regards,
Victor