hi i have a stored procedure like below:
ALTER PROCEDURE "DBA"."my_enr_test"(in file_name char(255), in uploaded_by char(100))
/* RESULT( column_name column_type, ... ) */
BEGIN
declare filepath char(100);
declare validatefile char(255);
// declare rc bit;
set filepath = file_name;
set Filename = Substr(FilePath, PatIndex('.', FilePath),3);
if filepath <> 'xml' and filepath <> 'csv' then
set validatefile = 'Invalid File Format'
else
set validatefile = 'Valid'
end if;
INSERT INTO DBA.pro_import_paths(filename, filevalidate, updated_by) values(filename, validatefile, uploaded_by);
// RETURN rc;
END
Noow, its capture the last three letters and validate and stored in the database column. But instead of capturing the last three letters, is it any other way to capture after the dot and store the filename as the same of user defined. Thanks in advance!!