PLS-00382: expression is of wrong type [message #250169] |
Mon, 09 July 2007 00:26 |
mandesh
Messages: 2 Registered: July 2007
|
Junior Member |
|
|
Hi,
I am new to strings and procedures and am getting this error message when trying to create a procedure.
the code is as below -
CREATE OR REPLACE FUNCTION CREATE_VIEW_FT_OB_DTLS (REPORTDATE IN DATE) RETURN NUMBER IS
SQL_STMT VARCHAR2(1000);
BEGIN
BEGIN
SQL_STMT:= 'CREATE OR REPLACE VIEW VW_FT_OB_DETAILS'
|| ' AS SELECT '
|| 'PID,'
|| 'TRANSACTION_AMOUNT TX_AMOUNT,'
|| 'TRANSACTION_DATE TXN_DATE,'
|| 'TRANSACTION_TYPE TXN_TYPE,'
|| 'FROM '
|| 'TABLE_TEMP'
|| 'WHERE '
|| 'TRANSACTION_DATE BETWEEN TRUNC(TO_DATE('
|| ''''
|| REPORTDATE
|| ''''
|| ' ,''MM/DD/YYYY''),''MONTH'') AND LAST_DAY('
|| ''''
|| REPORTDATE
|| ''''
|| ')';
EXCEPTION
WHEN OTHERS THEN
ORA_RAISERROR (SQLCODE,'ERROR WHILE ASSIGNING VALUE', 40);
END;
BEGIN
EXECUTE IMMEDIATE SQL_STMT;
RETURN 0;
EXCEPTION
WHEN OTHERS THEN
ORA_RAISERROR (SQLCODE,'ERROR WHILE EXECUTING STATEMENT',50);
END;
EXCEPTION
WHEN OTHERS THEN
ORA_RAISERROR (SQLCODE,'ERROR WHILE CREATING VIEW',50);
END;
/
I am getting error -
ORA-06550: line 6, column 17:
PLS-00382: expression is of wrong type
ORA-06550: line 6, column 3:
PL/SQL: Statement ignored
Can you please help me?
|
|
|
|
|
|
|