Function Edit and compile gives error

John Owen

Member
In the all objects list, by editing a function, but not changing it. When I compiled it I get compiled with errors.
Somehow PL/SQL Developer has changed the last line of the script and instead of END functionname; in Oracle it now reads END P$24041926$;

Since P$24041926$ was not my funtion name, Oracle doesn't like it.
 
Just a shot in the dark, but could that be the perference to compile a temporary version?

The preference is:

Window Types, Program Window, Safe compilation
 
You're right, if a de-select this option then it works o.k.

Ideally I'd prefer to use the safe option so that I don't screw anything up, but until the bug is fixed in a later version atleast this is a workaround I can use.
 
CREATE OR REPLACE FUNCTION "F_SUBLEDGERTYPELOOKUP2"
(v_compno IN VARCHAR,
v_orgunit IN VARCHAR2,
v_vendcat IN VARCHAR2,
v_vendno IN VARCHAR2,
v_countrycd IN VARCHAR2,
v_statgrp IN VARCHAR2
)
RETURN VARCHAR2
IS
-- PL/SQL Specification

v_accountstring VARCHAR2(30);
v_subledgertype VARCHAR2(10);
v_found BOOLEAN;

-- PL/SQL Block
BEGIN

v_subledgertype := null;

IF v_vendcat = 800 THEN v_subledgertype := 'F'; END IF;
IF v_vendcat = 801 THEN v_subledgertype := 'F'; END IF;
IF v_vendcat = 802 THEN v_subledgertype := 'F'; END IF;
IF v_vendcat = 803 THEN v_subledgertype := 'F'; END IF;

RETURN v_subledgertype;
END F_SUBLEDGERTYPELOOKUP2;
 
The problem seems to be caused by the fact that the function name is specified with quotes in the header, and without quotes at the end (in combination with the "Safe compilation" preference). We'll fix it.
 
Back
Top