Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
103 lines (58 sloc) 1.22 KB

OOS_UTIL_VALIDATION

IS_NUMBER Function

Checks if string is numeric

Syntax

function is_number(p_str in varchar2)
  return boolean
  deterministic

Parameters

Name Description
p_str String to validate
return True of p_str is number

Example

begin
  dbms_output.put_line(oos_util_string.to_char(oos_util_validation.is_number('123')));
  dbms_output.put_line(oos_util_string.to_char(oos_util_validation.is_number('abc')));
end;
/

TRUE
FALSE

IS_DATE Function

Checks if string is a valid date

Syntax

function is_date(
  p_str in varchar2,
  p_date_format in varchar2)
  return boolean
  deterministic

Parameters

Name Description
p_str
p_date_format
return True if date is valid

Example

begin
  dbms_output.put_line(oos_util_string.to_char(
    oos_util_validation.is_date('01-JAN-2015', 'DD-MON-YYYY')));
  dbms_output.put_line(oos_util_string.to_char(
    oos_util_validation.is_date('not-a-date', 'DD-MON-YYYY')));
end;
/

TRUE
FALSE
You can’t perform that action at this time.