DDL generation doubt - version 1.5.4
Hi,
When SQL Developer generates DDL for a table, it gives ENABLE after all the NOT NULL columns.
Why it is happening, plese advice.
Thanks,
Vanathi
Because that's the default state of a created constraint. See http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_7002.htm#i2062565
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> drop table t purge;
Table dropped.
SQL>
SQL> create table t(x int not null);
Table created.
SQL>
SQL> set long 500
SQL> select dbms_metadata.get_ddl('TABLE','T') from dual;
DBMS_METADATA.GET_DDL('TABLE','T')
CREATE TABLE "HR"."T"
( "X" NUMBER(*,0) NOT NULL ENABLE
) SEGMENT CREATION DEFERRED
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
TABLESPACE "USERS"
Similar Messages
-
Toplink.ddl-generation doesn't seem to be working
I can't get my project to persist. Why is this?
I have a skeleton project using JSF2, EJB3, Glassfish3, JPA/toplink, Helios. When I run the deployed project, I get this error:
+Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseException+
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.bar' doesn't exist
Error Code: 1146
A blank DB called test exists on mySQL
I have a connection pool in glassfish with a URL=jdbc:mysql://localhost:3306/test
user=root, pass=root
A mySQL connector jar exists in $glassfishHome/glassfish/lib
My code is as follows:
newBook.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Creates a new book</title>
</h:head>
<h:body>
<h1>Create a new book</h1>
<hr />
<h:form>
<h:panelGrid columns="2">
<h:outputLabel value="ISBN : " />
<h:inputText value="#{bookController.book.isbn}" />
<h:outputLabel value="Title :" />
<h:inputText value="#{bookController.book.title}" />
<h:outputLabel value="Price : " />
<h:inputText value="#{bookController.book.price}" />
<h:outputLabel value="Description : " />
<h:inputTextarea value="#{bookController.book.description}" cols="20"
rows="5" />
<h:outputLabel value="Number of pages : " />
<h:inputText value="#{bookController.book.nbOfPage}" />
<h:outputLabel value="Illustrations : " />
<h:selectBooleanCheckbox value="#{bookController.book.illustrations}" />
</h:panelGrid>
<h:commandButton value="Create a book"
action="#{bookController.doCreateBook}" />
</h:form>
<hr />
<i>APress - Beginning Java EE 6</i>
</h:body>
</html>
BookController.java
package controllers;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import ejb.BookEJB;
import entities.Book;
@ManagedBean
@RequestScoped
public class BookController {
@EJB
private BookEJB bookEJB;
private Book book = new Book();
private List<Book> bookList = new ArrayList<Book>();
public String doCreateBook() {
book = bookEJB.createBook(book);
bookList = bookEJB.findBooks();
return "listBooks.xhtml";
public BookController() {
public BookEJB getBookEJB() {
return bookEJB;
public void setBookEJB(BookEJB bookEJB) {
this.bookEJB = bookEJB;
public Book getBook() {
return book;
public void setBook(Book book) {
this.book = book;
public List<Book> getBookList() {
return bookList;
public void setBookList(List<Book> bookList) {
this.bookList = bookList;
BookEJB.java
package ejb;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import entities.Book;
@Stateless
public class BookEJB {
@PersistenceContext(unitName = "jdbc/test") //java:comp/env/jdbc/
private EntityManager em;
public List<Book> findBooks() {
TypedQuery<Book> query = em
.createNamedQuery("findAllBooks", Book.class);
return query.getResultList();
public Book createBook(Book book) {
em.persist(book);
return book;
Book.java
package entities;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
@Table(name="bar")
@Entity
@NamedQuery(name = "findAllBooks", query = "SELECT b FROM Book b")
public class Book {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String title;
private Float price;
@Column(length = 2000)
private String description;
private String isbn;
private Integer nbOfPage;
private Boolean illustrations;
public Book() {
public Long getId() {
return id;
public void setId(Long id) {
this.id = id;
public String getTitle() {
return title;
public void setTitle(String title) {
this.title = title;
public Float getPrice() {
return price;
public void setPrice(Float price) {
this.price = price;
public String getDescription() {
return description;
public void setDescription(String description) {
this.description = description;
public String getIsbn() {
return isbn;
public void setIsbn(String isbn) {
this.isbn = isbn;
public Integer getNbOfPage() {
return nbOfPage;
public void setNbOfPage(Integer nbOfPage) {
this.nbOfPage = nbOfPage;
public Boolean getIllustrations() {
return illustrations;
public void setIllustrations(Boolean illustrations) {
this.illustrations = illustrations;
persistence.xml (located under src/META-INF)
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="jdbc/test">
<jta-data-source>jdbc/test</jta-data-source>
<class>entities.Book</class>
<properties>
<property name="toplink.ddl-generation" value="drop-and-create-tables"></property>
<property name="toplink.ddl-generation.output-mode" value="database"></property>
<property name="toplink.logging.level" value="finest"/>
<property name="toplink.logging.logger" value="DefaultLogger"/>
<property name="toplink.jdbc.user" value="root"/>
<property name="toplink.jdbc.password" value="root"/>
</properties>
</persistence-unit>
</persistence>It seems that Glassfish 3 uses eclipseLink as a default and not TopLink. I've reconfigured using eclipseLink.
-
DDL generation - sequence of views
Hello,
I'm using several cascading database views. After DDL generation the sequence of the views in the script is not correct for database creation, so the script has to be adjusted before running.
Is there are way to define dependencies between views as a hint for DDL generation?
Regards DirkHi David,
my Datamodeler version is 3.1.2.704.
In a simple test with 1 table and 3 cascading views it worked for an Oracle generation, but I use SQLServer and SQLServer (2000 and 2005) DDL generation uses alphabetical order of view names.
It is the same with the new 3.3.0.734 version.
On the other hand some of the SQLServer views loaded into the model from data dictionary are too complex to be opened by the query editor, so dependencies may not be recognized.
So I hoped a manual hint would be possible.
Regards Dirk -
I have an Ipod touch 2nd generation with version 4.2.1 IOs and it is no longer recognized as a device when I plug into my computer. This means I can not change synch settings - any ideas on what I need to do ?
See:
iOS: Device not recognized in iTunes for Windows
I would start with:
Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
or
Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP -
Hi all,
for some strange reason the DDL generation has stopped working. See below. The physical model is definitely selected and also all the objects in it.
Any suggestions?
Thanks and regards, Garry
-- Generated by Oracle SQL Developer Data Modeler 3.1.0.687
-- at: 2012-05-02 16:00:12 CDT
-- site: Oracle Database 11g
-- type: Oracle Database 11g
-- Oracle SQL Developer Data Modeler Summary Report:
-- CREATE TABLE 0
-- CREATE INDEX 0
-- ALTER TABLE 0
-- CREATE VIEW 0
-- CREATE PACKAGE 0
-- CREATE PACKAGE BODY 0
-- CREATE PROCEDURE 0
-- CREATE FUNCTION 0
-- CREATE TRIGGER 0
-- ALTER TRIGGER 0
-- CREATE STRUCTURED TYPE 0
-- CREATE COLLECTION TYPE 0
-- CREATE CLUSTER 0
-- CREATE CONTEXT 0
-- CREATE DATABASE 0
-- CREATE DIMENSION 0
-- CREATE DIRECTORY 0
-- CREATE DISK GROUP 0
-- CREATE ROLE 0
-- CREATE ROLLBACK SEGMENT 0
-- CREATE SEQUENCE 0
-- CREATE MATERIALIZED VIEW 0
-- CREATE SYNONYM 0
-- CREATE TABLESPACE 0
-- CREATE USER 0
-- DROP TABLESPACE 0
-- DROP DATABASE 0
-- ERRORS 0
-- WARNINGS 0Hi Garry,
This could be because you asked it not to generate objects on a previous DDL Generation. When you do your DDL Generation, a "DDL Generation Options" panel is displayed. This has various tabs (Tables, PK and UK Constraints, etc.). I suggest you open these tabs and check that the "Selected" tick-boxes for the relevant objects are set.
If this doesn't help, please can you check whether there are any relevant error messages in your log file (this is normally the file datamodeler.log in the folder datamodeler\datamodeler\log).
David -
Hello, i'm having a very strange error during ddl-generation, i'm using Netbeans 5.5, Glassfish V2 and Mysql 5.0.26. Toplink bug?
JDO76609: Got SQLException executing statement "ALTER TABLE ana_ute DROP FOREIGN KEY UNQ_ana_ute_0": java.sql.SQLException: Error on rename of './lbdb_test/ana_ute' to './lbdb_test/#sql2-11af-1e' (errno: 152)probably i found the problem...
Toplink generate this:
ALTER TABLE ana_ute DROP FOREIGN KEY UNQ_ana_ute_0;
but with Mysql the correct command is:
ALTER TABLE ana_ute DROP KEY UNQ_ana_ute_0;
This problem is only for the Unique Key. -
DDL Generation/Conversion Tools
I am looking for a DDL generation tool, preferably command line, that can convert DDL of one RDBMS to another - say DDL of Oracle schema/table to MySQL/SQL Server & vice-versa. I have reviewed Oracle's SQL Developer - its DDL generation is one way MySQL to Oracle, SQL Server to Oracle etc.
I would prefer a general-purpose DDL conversion tool/utility if one exists! Also, is there a way to use GGs DDLGEN for this ? I have explored this a bit but it seems all conversions are from Tandem DDL to DDL of various RDBMS.
Thanks,
SatishSatish,
You can use DDLGEN to perform some basic DDL between systems but you'll likely need to make modifications to the .tpl file. Otherwise you may want to look into some other paid tools on the market.
Good luck,
-joe -
Problem with materialized views DDL generation
Hi, there is no check box in the *'Drop' Selection* tab for materialized views so no option to drop this objet type. It does drop the corresponding table but not the MV. Is there another way to automatically drop this type of object when generating DDL ??? More on, I have created a primary key for the same MV, based on two fields , checked the Generate check box but the command is not included in the DDL. Is this a known issue ???
Thanks.
Edited by: Gordrien on 2011-06-21 10:04Hi Gordrien,
More on, I have created a primary key for the same MV, based on two fields , checked the Generate check box but the command is not included in the DDLCan you elaborate on that. It's not clear what you are doing and what you are expecting as result in DDL generation.
Philip -
i recently updated my ipod touch 4th generation to version 6.1 and it's awful it didn't restore my music, videos or any of my apps.!!!! it only restored my photos and that's it! im also noticing that it updated as if it was an iphone. help!!!
The iPod backup that iTunes makes does not inlcuded synced media like apps and music. If that media is not in the iTunes library then it is gone after the update/restore.
You can redownload iTunes purchases by:
Downloading past purchases from the App Store, iBookstore, and iTunes Store -
SQL Datamodeler ddl generation looses foreign keys
My problem is that when I open my relational model, I select generate of DDL selection Oracle 10g as the physical. I can see the list of referential contraints under the Foreign Key tab. I generate once and all is fine, save the model and exit. I then restart the model and go through the same procedure. This time I can still see the entries under foreign keys tab but when I generate there are no foreign key entries. If I select 11g on the generate then they re-appear. Save it and go back in, select 11g and generate and they have gone again. Select 10g and generate and they are back.
This means I cannot use the physical model attributes (users, synonyms etc) because I keep jumping from 10g to 11g generation models.
Any ideas?
Sql Modeler 2.0.0. build 584.Hi,
I've got exactly this behaviour - and the exact same workaround to fix it. i.e. Save, change Physical to 11g and save again.
Re-open, won't generate some physical parts correctly i.e. fk constraints.
Swap to 10g and regenerate fine.
You may have to import some fks manually from a DDL file into the physical model to make this happen? Modelled ones seem to work?
If there a switch variable in the DM code gone awry?
Nigel -
How to Disable Syntax Checker for DDL Generation
Would like to include shell script commands before a create table statement. Modified the .xdb but PowerDesigner does not recognize this code as it is not native to the database. Is there a way to disable the syntax check so that the create table script can include these statements rather than a number of errors? Running v15.2 of PowerDesigner. Any feedback would be appreciated!
Hello. Yes. To be more specific, want to be able to run the create table DDL for Teradata from BTEQ. I added the following statements to a customized version of the Terada .xdb for the table BeforeCreate:
.logon ${TD_SERVER}/${TD_USERNAME},${TD_PASSWORD}
select 1
from dbc.tables
where DatabaseName = [%QUALIFIER%]
and TableName = '%TABLE%'
.if errorcode > 0 then .goto error
.if activitycount <> 1 then .goto create_tbl
drop table %TABLE%;
.if errorcode > 0 then .goto error
.label create_tbl
The DDL shows up with syntax errors as follows. So clearly, there is something that is attempting to validate the code:
3 error(s), 0 warning(s)
(1) (Table "DATE_DIM"):
[syntax error] unknown macro: logon ${TD_SERVER}/${TD_USERNAME},${TD_PASSWORD}
(8) (Table "DATE_DIM"):
[syntax error] condition parsing error
(16) (Table "DATE_DIM"):
[syntax error] expecting .endif -
Apple TV 2nd generation firmware versions
Does anyone know if Apple released Apple TV 2nd Generation with firmware versions 5.0 or 5.1, or were all Apple TV 2's released with firmware under 5.0 ?
Thank you.Yes all ATV2 were sold with a firmware under 5.0. Before the 5.0 release the last 4.0 firmware was 4.4.4, which can no longer be installed on the ATV2. However,all ATV2's can be upgraded to firmware version 5.0.
5.1 is for the iPhone/iPad. -
Toplink DDL-generation has no delimiter
Toplink creates DDL scripts without terminating the SQL statements with a delimiter. In the case when you are using, say, a maven sql plugin that relies on the ANT SQL task that expects at least a default delimiter of ';' what can we do with those generated scripts? Was this a conscious choice? If not, anyone have an idea how we might at least define a default delimiter for these generated files? Parsing fthe files after generation to add a delimiter is a PITA. :)
Thanks!Toplink creates DDL scripts without terminating the SQL statements with a delimiter. In the case when you are using, say, a maven sql plugin that relies on the ANT SQL task that expects at least a default delimiter of ';' what can we do with those generated scripts? Was this a conscious choice? If not, anyone have an idea how we might at least define a default delimiter for these generated files? Parsing fthe files after generation to add a delimiter is a PITA. :)
Thanks! -
3rd Generation iPod version update
I have a 3rd generation iPod touch(I've checked already), would it be possible for me to update to the LATEST (iOS 5 I think...) version? If so, how?
Yeah its been going tup to 5.1.1 only. A friend sent me to this website: http://www.macworld.com/article/1163339/update_ipodtouch.html
What do you think of it? -
IPod Nano 2nd generation software version
Hi
I need to grab a used iPod Nano 2nd Generation to replace the one I left on the plane : (
It's quite amazing how much value these units hold on eBay. My question is, what is the latest (or possibly the last) software version that Apple has released for this unit? I want to make sure that I ask the eBay seller what version of the software is installed on the one I'm looking at, as I feel that a currently updated unit will have the best chance of functioning properly. I am running Windows 7 on my home computer.
One of the ones I'm looking at has a picture of the information screen on the unit and it says it has software version 1.1.3. That can't be anywhere close to the last/best one, can it?
I assume that 2GB, 4GB and 8GB are the same in terms of software. I am looking for a 4GB version, or possibly an 8GB.
Any help is appreciated.
NickThat is correct. Version 1.1.3 was the last firmware update released for the 2G Nano.
B-rock
Maybe you are looking for
-
How to mount a volume on an Ubuntu server in Finder?
I am a newbe in such advanced functions, but I like to find solutions and it is hard for me to give up. I have a MacBook 13,3 and an Ubuntu server. I have managed to connect to the a USB printer connected to the server. But I have not found out how t
-
Updated itunes to v12 and ipod frozen
Today I updated my itunes to version 12 and also updated my Ipod touch to newer OS , i think from 3 to 4 , it took about 90mins to back up and then update , the itunes update seems Ok but at the end of update to Ipod , the update crashed . The device
-
How can i lock app on iphone 5
Hi. How can i lock my apps on iphone 5 ??
-
Is it possible to install Oracle 9i and SQL server on same machine
1. Is it possible to install Oracle 9i and SQL server on same machine ? 2. If yes, what are the problems i may encounter during installation 3. What should be hardware configuration for installing both databases in same machine like hard disk space,
-
How much time should the installation take?
It has been an hour and its still 50%.