I'm the administrator of an ftp site. I have a spreadsheet (CSV file) that contains the names and information of all files uploaded to the site. While some of the filenames are static (e.g., fileA, fileB) others have a date/timestamp or random cycle number as part of their filename that varies from file to file (e.g., fileC_20120120, fileD_20120121) and therefore cannot be hardcoded into the spreadsheet. I need to be able to wildcard these filenames in the spreadsheet (e.g. fileC_%, fileD_%) in order to account for the changing part of the filename. The problem I'm having is that whenever one of these types of files is uploaded and I attempt to query it from the spreadsheet it's always interpreting the wildcard character % as a literal and therefore not matching the correct filename pattern.
My SQL query is as follows:
SELECT * FROM OB_FileUpload_Test.csv WHERE FN_IN LIKE %FS_FILE_NAME%
FN_IN represents the filename value contained in the CSV file.
%FS_FILE_NAME% variable represents the filename uploaded.
My question is how can I build a SQL query to match the filename wildcard values in my CSV file?
For example, if my spreadsheet contains an entry for a filename called TR%.A (FN_IN column) and I receive a file upload called TR20120123.A (%FS_FILE_NAME% variable), I want these values to match and for that row to be selected.
My SQL query is as follows:
SELECT * FROM OB_FileUpload_Test.csv WHERE FN_IN LIKE %FS_FILE_NAME%
FN_IN represents the filename value contained in the CSV file.
%FS_FILE_NAME% variable represents the filename uploaded.
My question is how can I build a SQL query to match the filename wildcard values in my CSV file?
For example, if my spreadsheet contains an entry for a filename called TR%.A (FN_IN column) and I receive a file upload called TR20120123.A (%FS_FILE_NAME% variable), I want these values to match and for that row to be selected.