I'm trying to create a CONCAT()
that gets the last number in the exp_id
column, then adds the filename to display as a separate column. The column would display the following.
copy \\\resfs\reo\reoexps\87\5\7040445i.pdf C:\temp\images
CONCAT('copy \\\resfs\reo\reoexps\87\',', SUBSTRING(exp_id, 1,CHAR_LENGTH(exp_id) -1) '\', file_name, 'C:\temp\images') AS D,
try this:
CONCAT('copy ','\\','\\','\\','resfs\\reo\\reoexps\\87\\', SUBSTRING(CAST(exp_id AS char), 1,CHAR_LENGTH(exp_id) -1),'\\', file_name, ' C:\\temp\\images') AS D