You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
368 B

void myfunc1()
{
EXEC SQL create or replace
function my_func (in_str IN varchar2)
return date
IS
x date;
BEGIN
IF in_str IS NULL THEN
x: = NULL;
ELSIF substr(in_str, 5, 1) = '-' THEN
x := to_date(in_str, 'YYYY-MM-DD HH24:MI:SS');
END IF;
return x;
END my_func;
END-EXEC;
}