Using user defined function inside package
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)
when others then
I perform the following select statement:
SELECT TRANSACTIONPROCESSDT INTO VTRANPRODTCHAR FROM TABLE1
VTRANPRODCHAR is defined as a BOOLEAN;
I perform my test
IF ISDATE(VTRANPRODTCHAR,'DD-Mon-YYYY') = 'FALSE'
INSERT INTO TEMP_ERR_CHK ( CLAIMNO , RESERVENO, TRANSACTIONPROCESSDT,ERROR_MESSAGE_CD,REPORTING_DATE,LOAD_PROCESS_DATE_TIME )
VALUES(VCLAIMNO , VRESERVENO , VTIME_DATE,310,VREPORTING_DATE,CURRENT_TIMESTAMP);
But I get the following error
PLS-00306: wrong number or types of arguments in call to 'ISDATE'
Why is this returning an error - who do i fix it?
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.
I think you need to call it something like
date_str VARCHAR2 := '01-Jan-2007';
IF NOT ISDATE(date_str,'DD-Mon-YYYY')
Click Here to Expand Forum to Full Width