嗨,我有一个如下所示的存储过程:
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
现在,它捕获最后三个字母并验证并存储在数据库列中。但是不是捕获最后三个字母,而是在点之后捕获并将文件名存储为用户定义的相同文件名的任何其他方式。提前致谢!!