I am trying to get the following PL/SQL statement to work in a package, but have not had any success.
I have created a function called ISDATE - The ddl is below:
create or replace function isdate
( p_string in varchar2,
p_fmt in varchar2 := null)
return boolean
as
l_date date;
begin
l_date :=
to_date(p_string,p_fmt);
return TRUE;
exception
when others then
return FALSE;
end;
I perform the following select statement:
SELECT TRANSACTIONPROCESSDT INTO VTRANPRODTCHAR FROM TABLE1
WHERE .....
VTRANPRODCHAR is defined as a BOOLEAN;
I perform my test
IF ISDATE(VTRANPRODTCHAR,'DD-Mon-YYYY') = 'FALSE'
THEN
you have defined your function to accept to in parameters of type varchar2, but then you pass a boolean variable 'VTRANPRODTCHAR' into it as the first parameter.
Bookmarks