INSERT /*+ WITH_PLSQL */
INTO T1 (A1)
WITH FUNCTION T11 (P_A1 VARCHAR2)
RETURN NUMBER
IS
BEGIN
IF P_A1 = 'A'
THEN
RETURN 10 ;
ELSE
RETURN 100;
END IF;
END;
SELECT T11 ('A1') FROM DUAL;
is working fine now, but when I try this as
begin
INSERT /*+ WITH_PLSQL */
INTO T1 (A1)
WITH FUNCTION T11 (P_A1 VARCHAR2)
RETURN NUMBER
IS
BEGIN
IF P_A1 = 'A'
THEN
RETURN 10 ;
ELSE
RETURN 100;
END IF;
END;
SELECT T11 ('A1') FROM DUAL;
commit;
end;
am getting below error. Can't I use this in PL/SQL Block Connor?
ORA-06550: line 4, column 18:
PL/SQL: ORA-00905: missing keyword
ORA-06550: line 2, column 1:
PL/SQL: SQL Statement ignored
ORA-06550: line 12, column 5:
PLS-00103: Encountered the symbol "ELSE" when expecting one of the following:
( begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << continue close current delete fetch lock
insert open rollback savepoint set sql execute commit forall
merge pipe purge json_exists json_value json_query
json_object json_array
ORA-06550: line 15, column 5:
PLS-00103: Encountered the symbol "END"