22.3 ASSERT_FILE_TYPE Function

This function checks whether the extension of the file name matches the specified file type.

Syntax

APEX_DATA_PARSER.ASSERT_FILE_TYPE (
    p_file_name IN VARCHAR2,
    p_file_type IN t_file_type )
RETURN BOOLEAN;

Parameters

Parameter Description
p_file_name File name to get the file type.
p_file_type File type as t_file_type.

Returns

TRUE, if the file name matches the specified extension. FALSE otherwise.

Example

The following example checks if the passed-in file name is the CSV file type.

DECLARE
	is_valid_file_type boolean;
BEGIN
	is_valid_file_type := apex_data_parser.assert_file_type(
		p_file_name => 'test.csv',
		p_file_type => apex_data_parser.c_file_type_csv );
END;