JPA - TroubleShooting - Error in Datatypes used in Creating Tables

h1. JPA - TroubleShooting - Error in Datatypes used in Creating Tables
h2. Error Description
The error appears when JPA is trying to automatically
generate tables from Entities. It uses types it shouldn't because they aren't
supported by the Database Engine. If you examine the createDDL.jdbc file you
are going to find not supported data types. You could run the statements that
are listed there directly to your Database Engine and find out that they don`t
run generating syntax errors like the error posted below.
h3. Query example (statement)
CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50), SEQ_COUNT NUMBER(19))h3. PostgreSQL Error whent trying to execute the statment
CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50),
SEQ_COUNT NUMBER(19))": org.postgresql.util.PSQLException: ERROR: syntax
error near "("
h3. MSSQL 2000 Error when trying to execute the statement:
[CREATE - 0 row(s), 0.578 secs] [Error Code: 2715, SQL State: HY000] [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer]Column or parameter #1: Cannot find data type NUMBER
h3. FireBird Error when trying to execute the statment
Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, char 62
Statement: CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50),
SEQ_COUNT NUMBER(19))
h2. TroubleShooting
Looks like it wants "NUMERIC", not "NUMBER".
[http://www.postgresql.org/docs/8.1/interactive/datatype.html#DATATYPE-NUMERIC]
I had this problem using Firebird. I found out it had to do
with the database jdbc driver. I tried using a different database engine, like
Microsoft SQL Server 2000 with the corresponding driver and it worked as it
should. I suspect the JDBC driver has to supply in some way the datatypes it
supports to JPA TopLink Library.
Edited by: juanemc2 on Apr 1, 2008 7:39 AM

In Hibernate you can supply the "dialect" to use for SQL generation. I assume TopLink to have a similar functionality.
This is not a generic JPA issue, but rather something with the specific implementation you're using.
Or rather it is a generic SQL issue, caused by different database engines using slightly (or not so slightly) different SQL syntax which causes problems when generating SQL automatically.

Similar Messages

  • When I try to open an embedded PDF file I get an error "The program used to create this object is AcroExch.exe.

    When I try to open an embedded PDF file (Word doc) I get an error "The program used to create this object is AcroExch.exe. That program is either not installed on your computer, or is corrupt..."  I've tried  about everything from unchecking
    protected mode at startup to removing & reinstalling Adobe.  Nothing seems to fix this issue.  Any other ideas?
    This is happening on Adobe reader 9, 10 & 11 with MS Word 2010 & 2013.  I've uninstalled, cleaned & reinstalled Reader 9, 10 & 11, as well as Acrobat 10 Pro & 11 Standard.  Removed "Protected mode at startup, and changed
    the default program for viewing from reader to Acrobat.  This will not go away.  It is affecting production at our company.

    " Help > Troubleshooting Information > Profile Directory: Open Containing Folder" . i can't find open containing folder in profile directory. it does give me the option to open the places.sqlite file using graphic converter. when i try that, graphic converter gives me a window saying that it can't be opened because it is corrupted or is not a file type supported by graphic converter.
    i appreciate your help with a workaround to get the old bookmarks. that works. however, the problem has morphed from that concern to why adobe reader [the default app.] won't open firefox .sqlite files. is the problem in adobe reader or firefox? also, how can i tell if the places.sqlite file is corrupt?
    i'm getting in over my head here and do appreciate your help.

  • Query plan changes when query is used in CREATE TABLE AS

    We've puzzled by the fact that EXPLAIN PLAN gives a much different output for a SELECT statement than it does when the same statement is used for CREATE TABLE . . . AS SELECT.
    The bad part is that the CREATE TABLE version performs very badly, and that's what we want the query for.
    Why does this happen? Is there a difference (from the database's point of view) between retrieving a set of rows to display to the user and putting that same set into a new table? Doesn't this make it harder to diagnose and fix query performance problems?
    Here's our query:
    create table query_test AS
    select term, parentTerm, apidb.tab_to_string(cast(collect(trim(to_char(internal)))
                       as apidb.varchartab), ', ') as internal
                 from (
                     select distinct ga.organism as term,
                                     ga.species as parentTerm,
                                     tn.taxon_id as internal
                     from apidb.GeneAttributes ga, SRES.TaxonName tn, sres.Taxon t,
                          dots.AaSequence aas, dots.SecondaryStructure ss
                     where ga.organism = tn.name
               and tn.taxon_id = t.taxon_id
                       and t.taxon_id = aas.taxon_id
       and aas.aa_sequence_id = ss.aa_sequence_id
               and t.rank != 'species'
               union
                     select distinct ga.species as term,
                       '' as parentTerm,
                                     ts.taxon_id as internal
                     from apidb.GeneAttributes ga, SRES.TaxonName tn, apidb.taxonSpecies ts,
                          dots.aasequence aas, dots.SecondaryStructure ss
                     where ga.organism = tn.name
                      and tn.taxon_id = ts.taxon_id
                      and ts.taxon_id = aas.taxon_id
                     and aas.aa_sequence_id = ss.aa_sequence_id
       group by term,parentTerm;Without the CREATE TABLE, the plan looks like this:
    | Id  | Operation                             | Name                      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | CREATE TABLE STATEMENT                |                           |  2911 |  5986K|       | 18840   (1)| 00:03:47 |
    |   1 |  LOAD AS SELECT                       | QUERY_TEST                |       |       |       |            |          |
    |   2 |   VIEW                                |                           |  2911 |  5986K|       | 18669   (1)| 00:03:45 |
    |   3 |    SORT GROUP BY                      |                           |  2911 |   332K|       | 18660   (1)| 00:03:44 |
    |   4 |     VIEW                              |                           |  2911 |   332K|       | 18659   (1)| 00:03:44 |
    |   5 |      SORT UNIQUE                      |                           |  2911 |   292K|       | 18659   (6)| 00:03:44 |
    |   6 |       UNION-ALL                       |                           |       |       |       |            |          |
    |*  7 |        HASH JOIN                      |                           |  2907 |   292K|  2160K| 17762   (1)| 00:03:34 |
    |   8 |         TABLE ACCESS FULL             | GENEATTRIBUTES10650       | 40957 |  1679K|       |   795   (1)| 00:00:10 |
    |*  9 |         HASH JOIN                     |                           | 53794 |  3204K|  1552K| 16675   (1)| 00:03:21 |
    |* 10 |          HASH JOIN                    |                           | 37802 |  1107K|       | 12326   (1)| 00:02:28 |
    |* 11 |           HASH JOIN                   |                           | 37945 |   629K|       | 10874   (1)| 00:02:11 |
    |  12 |            INDEX FAST FULL SCAN       | SECONDARYSTRUCTURE_REVIX9 | 37945 |   222K|       |    33   (0)| 00:00:01 |
    |  13 |            INDEX FAST FULL SCAN       | AASEQUENCEIMP_REVIX6      |  7886K|    82M|       | 10816   (1)| 00:02:10 |
    |* 14 |           TABLE ACCESS FULL           | TAXON                     |   514K|  6530K|       |  1450   (1)| 00:00:18 |
    |  15 |          TABLE ACCESS FULL            | TAXONNAME                 |   760K|    22M|       |  2721   (1)| 00:00:33 |
    |* 16 |        HASH JOIN                      |                           |     4 |   380 |       |   886   (1)| 00:00:11 |
    |  17 |         NESTED LOOPS                  |                           |   730 | 64970 |       |   852   (1)| 00:00:11 |
    |* 18 |          HASH JOIN                    |                           |     1 |    78 |       |   847   (1)| 00:00:11 |
    |  19 |           NESTED LOOPS                |                           |       |       |       |            |          |
    |  20 |            NESTED LOOPS               |                           |    17 |   612 |       |    51   (0)| 00:00:01 |
    |  21 |             TABLE ACCESS FULL         | TAXONSPECIES10646         |    12 |    60 |       |     3   (0)| 00:00:01 |
    |* 22 |             INDEX RANGE SCAN          | TAXONNAME_IND01           |     1 |       |       |     2   (0)| 00:00:01 |
    |  23 |            TABLE ACCESS BY INDEX ROWID| TAXONNAME                 |     1 |    31 |       |     4   (0)| 00:00:01 |
    |  24 |           TABLE ACCESS FULL           | GENEATTRIBUTES10650       | 40957 |  1679K|       |   795   (1)| 00:00:10 |
    |* 25 |          INDEX RANGE SCAN             | AASEQUENCEIMP_REVIX6      |   768 |  8448 |       |     5   (0)| 00:00:01 |
    |  26 |         INDEX FAST FULL SCAN          | SECONDARYSTRUCTURE_REVIX9 | 37945 |   222K|       |    33   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       7 - access("GA"."ORGANISM"="TN"."NAME")
       9 - access("TN"."TAXON_ID"="T"."TAXON_ID")
      10 - access("T"."TAXON_ID"="TAXON_ID")
      11 - access("AA_SEQUENCE_ID"="SS"."AA_SEQUENCE_ID")
      14 - filter("T"."RANK"<>'species')
      16 - access("AA_SEQUENCE_ID"="SS"."AA_SEQUENCE_ID")
      18 - access("GA"."ORGANISM"="TN"."NAME")
      22 - access("TN"."TAXON_ID"="TS"."TAXON_ID")
      25 - access("TS"."TAXON_ID"="TAXON_ID")
    46 rows selected.With the CREATE TABLE, the plan for the SELECT alone looks like this:
    | Id  | Operation                           | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                    |                           |     2 |   234 |  1786   (1)| 00:00:22 |
    |   1 |  SORT GROUP BY                      |                           |     2 |   234 |  1786   (1)| 00:00:22 |
    |   2 |   VIEW                              |                           |     2 |   234 |  1785   (1)| 00:00:22 |
    |   3 |    SORT UNIQUE                      |                           |     2 |   198 |  1785  (48)| 00:00:22 |
    |   4 |     UNION-ALL                       |                           |       |       |            |          |
    |*  5 |      HASH JOIN                      |                           |     1 |   103 |   949   (1)| 00:00:12 |
    |   6 |       NESTED LOOPS                  |                           |   199 | 19303 |   915   (1)| 00:00:11 |
    |   7 |        NESTED LOOPS                 |                           |    13 |  1118 |   850   (1)| 00:00:11 |
    |   8 |         NESTED LOOPS                |                           |    13 |   949 |   824   (1)| 00:00:10 |
    |   9 |          VIEW                       | VW_DTP_E387155E           |    13 |   546 |   797   (1)| 00:00:10 |
    |  10 |           HASH UNIQUE               |                           |    13 |   546 |   797   (1)| 00:00:10 |
    |  11 |            TABLE ACCESS FULL        | GENEATTRIBUTES10650       | 40957 |  1679K|   795   (1)| 00:00:10 |
    |  12 |          TABLE ACCESS BY INDEX ROWID| TAXONNAME                 |     1 |    31 |     3   (0)| 00:00:01 |
    |* 13 |           INDEX RANGE SCAN          | TAXONNAME_IND02           |     1 |       |     2   (0)| 00:00:01 |
    |* 14 |         TABLE ACCESS BY INDEX ROWID | TAXON                     |     1 |    13 |     2   (0)| 00:00:01 |
    |* 15 |          INDEX UNIQUE SCAN          | PK_TAXON                  |     1 |       |     1   (0)| 00:00:01 |
    |* 16 |        INDEX RANGE SCAN             | AASEQUENCEIMP_REVIX6      |    15 |   165 |     5   (0)| 00:00:01 |
    |  17 |       INDEX FAST FULL SCAN          | SECONDARYSTRUCTURE_REVIX9 | 37945 |   222K|    33   (0)| 00:00:01 |
    |  18 |      NESTED LOOPS                   |                           |     1 |    95 |   834   (1)| 00:00:11 |
    |  19 |       NESTED LOOPS                  |                           |     1 |    89 |   833   (1)| 00:00:10 |
    |* 20 |        HASH JOIN                    |                           |     1 |    78 |   828   (1)| 00:00:10 |
    |  21 |         NESTED LOOPS                |                           |       |       |            |          |
    |  22 |          NESTED LOOPS               |                           |    13 |   949 |   824   (1)| 00:00:10 |
    |  23 |           VIEW                      | VW_DTP_2AAE9FCE           |    13 |   546 |   797   (1)| 00:00:10 |
    |  24 |            HASH UNIQUE              |                           |    13 |   546 |   797   (1)| 00:00:10 |
    |  25 |             TABLE ACCESS FULL       | GENEATTRIBUTES10650       | 40957 |  1679K|   795   (1)| 00:00:10 |
    |* 26 |           INDEX RANGE SCAN          | TAXONNAME_IND02           |     1 |       |     2   (0)| 00:00:01 |
    |  27 |          TABLE ACCESS BY INDEX ROWID| TAXONNAME                 |     1 |    31 |     3   (0)| 00:00:01 |
    |  28 |         TABLE ACCESS FULL           | TAXONSPECIES10646         |    12 |    60 |     3   (0)| 00:00:01 |
    |* 29 |        INDEX RANGE SCAN             | AASEQUENCEIMP_REVIX6      |   768 |  8448 |     5   (0)| 00:00:01 |
    |* 30 |       INDEX RANGE SCAN              | SECONDARYSTRUCTURE_REVIX9 |     1 |     6 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       5 - access("AA_SEQUENCE_ID"="SS"."AA_SEQUENCE_ID")
      13 - access("ITEM_1"="TN"."NAME")
      14 - filter("T"."RANK"<>'species')
      15 - access("TN"."TAXON_ID"="T"."TAXON_ID")
      16 - access("T"."TAXON_ID"="TAXON_ID")
      20 - access("TN"."TAXON_ID"="TS"."TAXON_ID")
      26 - access("ITEM_1"="TN"."NAME")
      29 - access("TS"."TAXON_ID"="TAXON_ID")
      30 - access("AA_SEQUENCE_ID"="SS"."AA_SEQUENCE_ID")
    50 rows selected.Edited by: JohnI on Jul 18, 2011 2:19 PM
    Edited by: JohnI on Jul 18, 2011 2:28 PM

    Charles Hooper wrote a series of blog entries on a similar topic some time ago: http://hoopercharles.wordpress.com/2010/12/15/select-statement-is-fast-insert-into-using-the-select-statement-is-brutally-slow-1/ (including a lot of useful comments) and two following articles. I have to confess that I did not read the posts again - but I think you will find some good ideas how to analyze the problem.
    Regards
    Martin Preiss

  • SQL Errors Generated in AppServer DB - "CREATE TABLE [dbo].[tblLogHist]"

    Hi All,
    I've been running a SQL Profiler trace on all completing stored procedures and T-SQL batches on the database server of our SBOP 7.5 Sp3 environment in an attempt to try and get clues to some performance issues we're experiencing.
    In the trace data, if I look at the error column and bring back only rows which indicate that an error occured whilst running the stored proc or T-SQL command, I see that the following command resulted in an error on numerous occasions:
    CREATE TABLE [dbo].[tblLogHist]
    [LogID] [int] IDENTITY (1, 1) NOT NULL
    ,[SystemName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    ,[JobName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    ,[UserID] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    ,[Status] [int] NOT NULL
    ,[DateWritten] [datetime] NOT NULL
    ,[Message] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    ) ON [PRIMARY]
    If I look for the table tblLogHist in AppServer, it exists, but is empty. Hence presumably the error being obtained when SBOP tries to run the above command is "An object of that name already exists."
    Does anyone know what this table is used for, why SBOP is repeatedly trying to create it and whether it should have any records in it?
    Any help appreciated.
    Many thanks,
    Simon
    Environment Details:
    SBOP Version = 7.5 Sp3
    2 x load balanced Windows 2003 app / web / reporting Services servers.
    1 x SQL Server 2008 64bit SQL/Analysis Services Server

    Into Appserver database you have a table tbllogs where the syste record all the error from the system.
    This table can become quite big during the time and insert into this table can be very slow.
    So tbllogHist willbe used to move records perodically from tbllogs.
    In this way the size of tbllogs table will not be too big.
    I hope this will help.
    Regards
    Sorin Radulescu

  • Error while giving default while creating table

    create table abr
    (a VARCHAR2(50) DEFAULT acb,
    b VARCHAR2(2000 BYTE)
    its giving error as ORA-00984: column not allowed here

    Hi,
    user10447332 wrote:
    create table abr
    (a VARCHAR2(50) DEFAULT acb,
    b VARCHAR2(2000 BYTE)
    its giving error as ORA-00984: column not allowed hereUnquoted strings, such as acb in your example, are assumed to be function or column names.
    Did you mean:
    create table abr
    (   a        VARCHAR2 (50)              DEFAULT 'acb',       -- With single-quotes
        b        VARCHAR2 (2000 BYTE)
    )?

  • Getting error 3001 when using Excel Easy Table.vi

    When making a call to Excel Easy Table.vi (Report Generation Toolkit) I get a 3001 error.
    I have attached an example VI to demonstrate the problem.  Please run "Add Table Example.vi" in the attached zip.  This sample program is made up of VIs from a larger program, so it made more sense to create a sample program and only include the required VIs than include the entire large program.  So that is why the Report class wire comes from a functional global VI.
    What is a bit strange is that Excel Easy Table is used to write a summary table at the top of the spreadsheet successfully in "Initialize Report.vi."  It is only when I then make the additional call to Excel Easy Table in Add Table Example that I get the 3001 error.  If you have any ideas why I'm getting the 3001 error, please let me know.
    I'm using LabVIEW 8.6 and RGTK 1.1.4.
    Thanks,
    Joel
    Solved!
    Go to Solution.
    Attachments:
    Add Table Example.zip ‏113 KB

    Hey Joel,
    I figured out why this error was occuring. After comparing how you were adding the columns in the Report Write Info Table.vi in the Initialize Report.vi to just using the Excel Easy table VI, you hadn't provided a reference to which worksheet it needed to write the data to. I changed your code to include this reference and it worked perfectly without any errors. I have attached a .zip file with those changes so you can look at it.
    FYI: Don't try to use this code as a direct replacement with yours. In order for me to reproduce the error, I had to modify several VIs in order to get it to run.
    I hope this information helps you with it.
    Jim St
    National Instruments
    RF Product Support Engineer
    Attachments:
    Add Table Example.zip ‏146 KB

  • Cannot populate Example Database using ant create-tables

    I encounter the problem like this [t-5362238]. But I've tried to do any thing, but I still cannot populate database. Somebody has another way to populate the database (not use ant) ?
    And more. I can't use ant to deploy the *.WAR file. The terminal shows the message like the message when I perform ant create-tables

    I encounter the problem like this [t-5362238]. But I've tried to do any thing, but I still cannot populate database. Somebody has another way to populate the database (not use ant) ?
    And more. I can't use ant to deploy the *.WAR file. The terminal shows the message like the message when I perform ant create-tables

  • Error while creating tables in schema since trigger already enabled

    Hi All,
    I am trying to insert newly created objects in userA,but am not able to insert "ora_dict_obj_type" type value in target table,
    Please see my error and script below:
    Error:
    Error report:
    SQL Error: ORA-00604: error occurred at recursive SQL level 1
    ORA-01858: a non-numeric character was found where a numeric was expected
    ORA-06512: at line 2
    00604. 00000 - "error occurred at recursive SQL level %s"
    *Cause:    An error occurred while processing a recursive SQL statement
    (a statement applying to internal dictionary tables).
    *Action:   If the situation described in the next error on the stack
    can be corrected, do so; otherwise contact Oracle Support.
    Script:I need to insert newly created objects into this table,here Object type is important because based object type i am going to create one more trigger to grant access automatically to other users using trigger.
    create table access_table
    (owner_name varchar2(30),
    object_name varchar2(30),
    object_type varchar2(30),
    created_time timestamp default current_timestamp);
    create or replace
    trigger access_trigger
    after create on schema
    begin
    insert into access_table values
    (ora_dict_obj_owner,
    ora_dict_obj_name,
    ora_dict_obj_type,
    current_timestamp);
    end access_trigger;
    Thanks
    Edited by: 983419 on Feb 9, 2013 7:20 AM

    insert into access_table values
    (ora_dict_obj_owner, --VARCHAR(30)
    ora_dict_obj_name, --VARCHAR(30)
    ora_dict_obj_type, --VARCHAR(20)
    current_timestamp --"TIMESTAMP WITH TIME ZONE"
    );The Oracle CURRENT_TIMESTAMP function will give you the current time with all details. It returns the current timestamp with time zone for the current session's time zone.
    --example
    SQL> select CURRENT_TIMESTAMP from dual;
    CURRENT_TIMESTAMP
    09-FEB-13 02.53.33.753000 PM 03:00You are inserting 'CURRENT_TIMESTAMP' ( TIMESTAMP WITH TIME ZONE datatype ) into the column with TIMESTAMP datatype.So what?? Can you please do some workout on what you said and post it here?
    Try this:
    create table access_table
    (owner_name varchar2(30),
    object_name varchar2(30),
    object_type varchar2(30),
    created_time TIMESTAMP WITH TIME ZONE default CURRENT_TIMESTAMP);
    NO NEED.
    Check this -
    ranit@XE11GR2>> create table access_table
      2  (owner_name varchar2(30),
      3  object_name varchar2(30),
      4  object_type varchar2(30),
      5  created_time timestamp default current_timestamp);
    Table created.
    Elapsed: 00:00:00.07
    ranit@XE11GR2>> insert into access_table(owner_name,object_name,object_type,created_time)
      2  values('rr','bb','xx',current_timestamp); -- "CURRENT_TIMESTAMP with TIME ZONE inserted"
    1 row created.
    Elapsed: 00:00:00.00
    ranit@XE11GR2>> insert into access_table(owner_name,object_name,object_type)
      2  values('rr2','bb2','xx2');
    1 row created.
    Elapsed: 00:00:00.01
    ranit@XE11GR2>> select *
      2  from access_table;
    OWNER_NAME                     OBJECT_NAME                    OBJECT_TYPE                    CREATED_TIME
    rr                             bb                             xx                             09-FEB-13 01.47.56.490000 PM
    rr2                            bb2                            xx2                            09-FEB-13 01.48.20.187000 PM
    Elapsed: 00:00:00.01Edited by: ranit B on Feb 10, 2013 3:20 AM
    -- code added

  • [COMPLEX DATATYPE] - Cannot create table

    Hello
    I tried to create a table with a column based on an complex data type from an Xml Schema.
    1 -- XML Schema
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2007 sp2 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <xs:element name="eventlog">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="event" maxOccurs="unbounded"/>
                   </xs:sequence>
                   <xs:attribute name="lastupdate" use="required">
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:enumeration value="12/05/2007 10:24:00"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:attribute>
              </xs:complexType>
         </xs:element>
         <xs:element name="event">
              <xs:complexType>
                   <xs:simpleContent>
                        <xs:extension base="xs:string">
                             <xs:attribute name="level" use="required">
                                  <xs:simpleType>
                                       <xs:restriction base="xs:string">
                                            <xs:enumeration value="ERROR"/>
                                            <xs:enumeration value="WARNING"/>
                                       </xs:restriction>
                                  </xs:simpleType>
                             </xs:attribute>
                             <xs:attribute name="date" use="required">
                                  <xs:simpleType>
                                       <xs:restriction base="xs:string">
                                            <xs:enumeration value="12/05/2007 10:24:01"/>
                                       </xs:restriction>
                                  </xs:simpleType>
                             </xs:attribute>
                        </xs:extension>
                   </xs:simpleContent>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    I've registred schema and create associated type with EM (Enterprise Manager)... OK.
    when i create a table with Oracle SQL Developper ; i get an error 000902 - Invalide DATATYPE
    DDL generated
    CREATE TABLE TABLE1
    COLUMN1 JACQUES.event1461_T
    what's wrong ??
    SQL> select * from v$version ;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL>
    thanks for ur help.
    Message was edited by:
    user574414

    Is this what you are looking to achieve...
    SQL> set echo on
    SQL> spool testcase.log
    SQL> --
    SQL> connect sys/ as sysdba
    Enter password:
    Connected.
    SQL> set define on
    SQL> set timing on
    SQL> --
    SQL> define USERNAME = XDBTEST
    SQL> --
    SQL> def PASSWORD = XDBTEST
    SQL> --
    SQL> def USER_TABLESPACE = USERS
    SQL> --
    SQL> def TEMP_TABLESPACE = TEMP
    SQL> --
    SQL> drop user &USERNAME cascade
      2  /
    old   1: drop user &USERNAME cascade
    new   1: drop user XDBTEST cascade
    User dropped.
    Elapsed: 00:00:01.65
    SQL> grant connect, resource to &USERNAME identified by &PASSWORD
      2  /
    old   1: grant connect, resource to &USERNAME identified by &PASSWORD
    new   1: grant connect, resource to XDBTEST identified by XDBTEST
    Grant succeeded.
    Elapsed: 00:00:00.03
    SQL> grant create any directory, drop any directory to &USERNAME
      2  /
    old   1: grant create any directory, drop any directory to &USERNAME
    new   1: grant create any directory, drop any directory to XDBTEST
    Grant succeeded.
    Elapsed: 00:00:00.00
    SQL> grant alter session, create view to &USERNAME
      2  /
    old   1: grant alter session, create view to &USERNAME
    new   1: grant alter session, create view to XDBTEST
    Grant succeeded.
    Elapsed: 00:00:00.01
    SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
      2  /
    old   1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
    new   1: alter user XDBTEST default tablespace USERS temporary tablespace TEMP
    User altered.
    Elapsed: 00:00:00.00
    SQL> connect &USERNAME/&PASSWORD
    Connected.
    SQL> --
    SQL> alter session set events ='19027 trace name context forever, level 0x800'
      2  /
    Session altered.
    Elapsed: 00:00:00.00
    SQL> var schemaURL varchar2(700)
    SQL> var xmlschema clob
    SQL> --
    SQL> begin
      2    :schemaURL := 'http://xmlns.example.com/xsd/testcase.xsd';
      3    :xmlSchema :=
      4  '<?xml version="1.0" encoding="UTF-8"?>
      5  <!--W3C Schema generated by XMLSpy v2007 sp2 (http://www.altova.com)-->
      6  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
      7     <xs:element name="eventlog" xdb:defaultTable="EVENT_LOG_TABLE" xdb:SQLType="EVENT_LOG_T">
      8             <xs:complexType>
      9                     <xs:sequence>
    10                             <xs:element ref="event" maxOccurs="unbounded" xdb:SQLCollType="EVENT_V"/>
    11                     </xs:sequence>
    12                     <xs:attribute name="lastupdate" use="required">
    13                             <xs:simpleType>
    14                                     <xs:restriction base="xs:string">
    15                                             <xs:enumeration value="12/05/2007 10:24:00"/>
    16                                     </xs:restriction>
    17                             </xs:simpleType>
    18                     </xs:attribute>
    19             </xs:complexType>
    20     </xs:element>
    21     <xs:element name="event" xdb:SQLType="EVENT_T">
    22             <xs:complexType>
    23                     <xs:simpleContent>
    24                             <xs:extension base="xs:string">
    25                                     <xs:attribute name="level" use="required">
    26                                             <xs:simpleType>
    27                                                     <xs:restriction base="xs:string">
    28                                                             <xs:enumeration value="ERROR"/>
    29                                                             <xs:enumeration value="WARNING"/>
    30                                                     </xs:restriction>
    31                                             </xs:simpleType>
    32                                     </xs:attribute>
    33                                     <xs:attribute name="date" use="required">
    34                                             <xs:simpleType>
    35                                                     <xs:restriction base="xs:string">
    36                                                             <xs:enumeration value="12/05/2007 10:24:01"/>
    37                                                     </xs:restriction>
    38                                             </xs:simpleType>
    39                                     </xs:attribute>
    40                             </xs:extension>
    41                     </xs:simpleContent>
    42             </xs:complexType>
    43     </xs:element>
    44  </xs:schema>
    45  ';
    46  end;
    47  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4        schemaURL => :schemaURL
      5       ,schemaDoc => :xmlschema
      6       ,local     => TRUE
      7       ,genBean   => false
      8       ,genTypes  => TRUE
      9       ,genTables => TRUE
    10       ,enableHierarchy => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    11    );
    12  end;
    13  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.62
    SQL> desc EVENT_LOG_TABLE
    Name                                      Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://xmlns.example.com/xsd/testcase.xsd" Element "eventlog") STORAGE Object-relational TYPE "EVENT_LOG_T"
    SQL> --
    SQL> create table RELATIONAL_TABLE
      2  (
      3    EVENT_XML XMLTYPE
      4  )
      5  XMLTYPE EVENT_XML
      6  STORE AS OBJECT RELATIONAL
      7  XMLSCHEMA "http://xmlns.example.com/xsd/testcase.xsd" ELEMENT "eventlog"
      8  VARRAY EVENT_XML."XMLDATA"."event" STORE AS TABLE EVENT_NT
      9  (
    10     (PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$))
    11     ORGANIZATION INDEX OVERFLOW
    12  )
    13  /
    Table created.
    Elapsed: 00:00:00.14
    SQL> desc RELATIONAL_TABLE
    Name                                      Null?    Type
    EVENT_XML                                          SYS.XMLTYPE(XMLSchema "http:
                                                        //xmlns.example.com/xsd/test
                                                        case.xsd" Element "eventlog"
                                                        ) STORAGE Object-relational
                                                        TYPE "EVENT_LOG_T"
    SQL>

  • Table structure changes when using 'create table X as ( select * from X@remote_server )'

    I need to create and copy data from a remote Oracle server to a local server. The command I use is
    create table X as ( select * from X@remote_server )
    with remote_server is the tns name of the remote Oracle server.
    The local table is created and populated with data as expected but when I check the structure using 'desc X' it shows me all the CHAR fields of the local table are triple as large as of the remote table.
    I guess the problem is the difference  between the NLS_CHARACTERSET settings . The local charset is AL32UTF8 and the remote is  WE8MSWIN1252.
    How do I change the command to make the two tables have the same field sizes ?
    Thanks,
    Vu

    Do you want to be able to store all the data from the remote table in the local table?  Assuming you do, increasing the size of the column would be the correct behavior.
    By default, a VARCHAR2(10) allocates up to 10 bytes of storage.  In the Windows-1252 character set on the source, 1 character requires 1 byte of storage.  So a VARCHAR2(10) has space for up to 10 characters.  In the UTF-8 character set on the destination, however, 1 character can require up to 3 bytes of storage.  So a VARCHAR2(10) may allow you to store as few as 3 characters.  Since Oracle has no way of knowing what data you have (and will have) in the source system, it triples the size to ensure that all the data from the remote system will fit in the new table.  If you want the columns to be the same size on the destination that they are on the source, it is highly probable that you'll get errors inserting the data because at least one value will be too large for the destination column.
    Justin    

  • Create table from view giving error

    i am trying to creating a table from view it is giving following error. can you please help
    create table jd as
    select * from A.ab_v where 1=2;
    error
    ORA-01723
    zero columns not allowed

    As others already pointed out you have NULL as view column(s). You need to either modify view and use CAST(NULL AS desired-type). For example:
    SQL> create or replace
      2    view v1
      3      as
      4        select  null new_date
      5          from dual
      6  /
    View created.
    SQL> create table tbl
      2    as
      3      select  *
      4        from  v1
      5  /
        select  *
    ERROR at line 3:
    ORA-01723: zero-length columns are not allowed
    SQL> create or replace
      2    view v1
      3      as
      4        select  cast(null as date) new_date
      5          from dual
      6  /
    View created.
    SQL> create table tbl
      2    as
      3      select  *
      4        from  v1
      5  /
    Table created.
    SQL> drop table tbl
      2  /
    Table dropped.
    SQL> create or replace
      2    view v1
      3      as
      4        select  cast(null as number) new_number
      5          from  dual
      6  /
    View created.
    SQL> create table tbl
      2    as
      3      select  *
      4        from  v1
      5  /
    Table created.
    SQL>  Or list individual view columns with NULL CASTing in CTAS:
    SQL> create or replace
      2    view v1
      3      as
      4        select  null new_date
      5          from dual
      6  /
    View created.
    SQL> create table tbl
      2     as
      3       select  cast(new_date as date) new_date
      4         from  v1
      5  /
    Table created.
    SQL> desc tbl
    Name                                      Null?    Type
    NEW_DATE                                           DATE
    SQL> set null NULL
    SQL> select  *
      2    from  tbl
      3  /
    NEW_DATE
    NULL
    SQL> SY.

  • ....how to create table maintanence generator for a z table and how to use

    Hi...
    3....how to create table maintanence generator for a z table and how to use that for transfering a selected records to one server to another server.
    thanks and regards,
    k.swaminath reddy

    Hi,
    Table maintanance Generator is used to manually
    input values using transaction sm30.The Table Maintenance Generator is used to create table maintenance program to add, modify or delete records in the database table. This can be accessed using transaction SE54 or in SE11 using the menu Utilities->Table Maintenance Generator
    <b>
    Follow below steps</b>
    go to se11 check table maintanance check box under
    attributes tab
    utilities-table maintanance Generator->
    create function group and assign it under
    function group input box.
    also assign authorization group default &NC& .
    select standard recording routine radio in table
    table mainitainence generator to move table
    contents to quality and production by assigning
    it to request.
    select maintaience type as single step.
    maintainence screen as system generated numbers
    this dialog box appears when you click on create
    button
    save and activate table
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
    One step, two step in Table Maintenance Generator
    Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
    Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
    please check the link for getting information about table maintenance generator !
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=use%20of%20table%20maintenance%20generator&cat=sdn_all
    http://www.sapdevelopment.co.uk/tips/tips_tabmaint_tcode.htm
    http://www.sap-img.com/abap/create-a-table-maintance-program-for-a-z-table.htm
    Regards,
    Priyanka.

  • Creating table /  field definition

    HEllo,
    I am trying to create a table using Microsoft Access Driver with the following field definitions:
    createStatement =
    "CREATE TABLE Employee(SSN VARCHAR(9)PRIMARY KEY, "
    + "FirstName VARCHAR(15), LastName VARCHAR(15), "
    + "MiddleInitial CHAR, BirthDATE DATE, SALARY DECIMAL(10,2), "
    + "DNO int)";
    Unfortuately I am getting error when I compile. (CREATE TABLE Employee(SSN VARCHAR(9)PRIMARY KEY, FirstName VARCHAR(15), LastName VARCHAR(15), MiddleInitial CHAR, BirthDATE DATE, SALARY DECIMAL(10,2), DNO int)
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition.
    Cannot figure out what could be wrong in my code....
    If somebody could glance at it and have any suggestions, please

    thanks for the advise, but my ORACLE book is oriented
    to create tables with SQL....
    Anyway still looking for the solution of "mistery"
    of my "syntax error field definition"If you're suggesting that the SQL that Oracle recognizes and the SQL Access recognizes are the same, I think you're mistaken. I would follow DrClap's advice (this is just generally a good thing to do) and look for Access-specific documentation.

  • Can't Create Table on HBase

    Hi,
    When trying to create table on existing HBase cluster I get an error.
    I try to create table using the following command: 
    create 'sampletable', 'cf1'
    The error I get is:
    hbase(main):005:0> create 'sampletable', 'cf1'
    ERROR: java.io.IOException: Table Namespace Manager not ready yet, try again lat
    er
    at org.apache.hadoop.hbase.master.HMaster.getNamespaceDescriptor(HMaster
    .java:3205)
    at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:1730)
    at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:1860)
    at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService
    $2.callBlockingMethod(MasterProtos.java:38221)
    at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2008)
    at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:92)
    at org.apache.hadoop.hbase.ipc.FifoRpcScheduler$1.run(FifoRpcScheduler.j
    ava:73)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
    1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
    java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
    .java:615)
    at java.lang.Thread.run(Thread.java:745)
    Thanks

    The amazing guys at MS helped us with that one.
    For the future,
    HBase clusters shouldn't share the same storage account, to be specific, they shouldn't share the same storage container.
    The solution was to delete the clusters and recreate them with proper settings.

  • ORA-00911 w/create table

    I'm trying to execute an SQL file with the following code:
    create table "t_ap_xml"
    "XML_ID" NUMBER,
    "XML_NAME" VARCHAR2(128),
    "XML_TYPE" VARCHAR(32),
    "XML_CONTENT" "SYS"."XML_TYPE",
    "XML_DESCRIPTION" VARCHAR2(4000)
    ..And i'm receiving the following error:
    ERROR at line 8:
    ORA-00911: invalid character
    It is pointing to the semicolon as the problem. If i remove the semicolon, it seems to work. But if I place that code in a DDL with other create table commands, it gives me a ORA-00922 error at the line with the next create statement. Any ideas? Thanks.

    I guess I should have been a bit more clear..
    I am using SQL*Plus, and GET-ing a text .sql file made in a text editor.
    It seems to work without the semicolon and only creating that single table. However, a problem occurs when trying to use multiple CREATE TABLE statements in the same sql file.
    So for example.. here is an excerpt:
    create table t_ap_xml
    create table another_table
    Generates the following error:
    ORA-00922: missing or invalid option
    ..That error occurs on the line in which the second CREATE TABLE statement was issued.
    Thanks for any help!

Maybe you are looking for

  • How to put a password on a document in Pages application

    I have created a document on pages on my iphone. I want to put a password to open this document just like you do to a word file. So that each time i open the document it ask me for a passoword to open the document. Is there any facility in Pages appl

  • Image in tooltip

    OK, I can beautify my tooltips with HTML, easy: lblMyLabel.setToolTipText("<html><b>Hello!</b>"); I can even make them multiline or place the tooltip contents into a table and modify everything with CSS, but there is still one thing I don't know how

  • How to go about Online auditing of PM endusers with their daily transaction

    Dear friends, How to go about Online auditing of PM endusers with their daily transactions like Maintenence orders,Maint plans measuring documents.can you give provide me navigation for this your response is highly appriciated. Regards, Sunil

  • Survey Permissions - Not allowing submission

    I have created a survey that the Sharepoint Admin group can submit without any issues. Our "normal user" groups are all specifically set to "Contribute" for the survey (have "Read" on the remainder of the site). Using one of the "normal user" logins,

  • Question marks in outgoing emails for multibyte characters

    I have an application that stores and displays Japanesse characters correctly on the screen. But when I try to email them, the characters come out as ?????. I am on version 4.02. I am setting the following items at the top: MIME-Version: 1.0 Content-