Oracle JDeveloper 126.96.36.199.0 Generates Invalid SQL Scripts in Alter Mode from Offline Database
(Doc ID 1086390.1)
Last updated on FEBRUARY 07, 2019
Applies to:Oracle JDeveloper - Version 188.8.131.52.0 and later
Information in this document applies to any platform.
When working with Offline Databases in JDeveloper 184.108.40.206.0 the "generate to" function generates a SQL script but with some code that is causing errors in ALTER mode.
For a simple column, JDeveloper generates the following, and is not expected:
Drop column X
Add column X1 (same as X)
Rename column X1 to X
Expected would be that the DROP and ADD commands are not generated.
Steps to reproduce the issue using JDeveloper 220.127.116.11.0
- Create new GENERIC application
- Choose "Database (Offline) in the Project Technologies.
- Click "Finish"
- Create new Project
- Choose "Offline Database Objects" in Tab "Current Technologies" in List "Categories"
- Choose "Offline Database" in List "Items"
- Name Database "Test"
- Choose Oracle10g R1 for Database emulation
- Click OK
- Generate Database connection. Use any schema, for example any test schema provided by Oracle.
- Right-click in Application Navigator on Item "Test"
- Choose "Copy to Projects" from the context menu
- Choose the Database connection, which you created on step 10.
- On "Specify Target" the default should be ok.
- On "Object Picker" click "Query" to get the whole schema
- Then put all objects from the left list to the right list.
- On "Choose Operation" leaf the default (should be CREATE) and click finish.
- Right click on any offline table and choose "duplicate..." and Rename it to any unique name (for instance "TABLE2"). Then click OK.
- Double click on the new table, rename a Column adding a numeric prefix (for instance COL to COL2)
- Add new Unique Constrains for another column.
- Click OK.
- Right click on the newly created offline table (TABLE2) and Choose "Generate to..."->"SQL-script".
- Choose "ALTER" and then finish. (this is the ONLY option)
Then, repeat the following steps:
24. Right click on the offline table and choose "Generate to..." -> "SQL-script".and
25. Choose "ALTER" and then click finish. (No other options are needed).
After that you will see the number added and the ADD and DROP commands.
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document