J. Doe
J. Doe

Reputation: 530

SQLdeveloper automatically adds FORCE EDITIONABLE

Is it possible to prevent that SQL Developer automatically adds FORCE EDITIONABLE to created views?

I create them via the view menu:

enter image description here

While editing there is no FORCE EDITIONABLE. But after I saved it and view the SQL code via the SQL tab I have the following:

CREATE OR REPLACE FORCE EDITIONABLE VIEW "Databsename"."viewName" ("INFORMATION") AS 

Is there a way to prevent this. I'm sure that when I started to create views the view creation was without force and the strings with my database name.

Upvotes: 2

Views: 1191

Answers (2)

FCA69
FCA69

Reputation: 311

Changing the version from "Compatible" to, for instance, 11.2.0, should remove the "EDITIONABLE" keyword, which was introduced in version 19 of the database.

Upvotes: 0

Jon Heller
Jon Heller

Reputation: 36807

The FORCE option is not a property of the view; it is only in the SQL because SQL Developer assumes that if you create the view again you will want to use the FORCE option. There are several ways to tell SQL Developer not to use that option in the generated DDL.

Not all SQL Developer dialogs give you an option, but if right-click on the view and select "Export", there is an option named "Add Force to Views". enter image description here

Another way to prevent FORCE is to call DBMS_METADATA manually, like this:

begin
    dbms_metadata.set_transform_param (dbms_metadata.session_transform,'FORCE',false);
end;
/

select dbms_metadata.get_ddl('VIEW', 'TEST_VIEW') from dual;

Upvotes: 1

Related Questions