I'm creating a package dynamically ie:
DECLARE
vpackageletras VARCHAR2(2000);
vvalorpossuia VARCHAR2(10);
vvalorpossuib VARCHAR2(10);
BEGIN
IF letras.possuia THEN
vvalorpossuia := 'TRUE';
ELSE
vvalorpossuia := 'FALSE';
END IF;
IF letras.possuib THEN
vvalorpossuib := 'TRUE';
ELSE
vvalorpossuib := 'FALSE';
END IF;
vpackageletras := 'CREATE OR REPLACE PACKAGE letras AS' || CHR(13) ||
' possuiA CONSTANT BOOLEAN NOT NULL := ' || vvalorpossuia || ';' || CHR(13) ||
' possuiB CONSTANT BOOLEAN NOT NULL := ' || vvalorpossuia || ';' || CHR(13) ||
'END letras;';
EXECUTE IMMEDIATE vpackageletras;
END;
If I want to add a new CONSTANT, I just add it, for example, to OwnC, and I guarantee that I will not lose the data that already exists in PACKAGE.
However when I run this script the package letters are getting invalid, and editing via PLSQL and executing is valid.