Default table scripts in ORACLE 9i

Hi,
Is there an sql script which is available to create and populate the default tables in the SCOTT user. At the moment it has the EMP, DEPT, SALGRADE tables. But there is an another version of these tables and data:
EMPLOYEES
DEPARTMENTS
JOB_GRADES
LOCATIONS
Can it be found in the ORACLE_HOME directory?

Try connect with hr/hr it is in hr schema which comes builtin like scottt user.
sorry forgot to tell
You need to unlock the HR account before you can use the HR sample schema. To unlock the HR account, log in as the SYSTEM user and enter the following command.You can
chose yours own password.
ALTER USER HR IDENTIFIED BY your_password ACCOUNT UNLOCK;Khurram
Message was edited by:
Khurram Siddiqui

Similar Messages

  • Teradat multiload script to oracle external table

    Hi
    Does anybody out there have a script handy that can semi-automate conversion of a teradata multiload script to oracle external table or sql loader.

    create table SYSTEM.C$_0STG_IN_FCST_PRS
         C5_LOC     VARCHAR2(12),
         C4_PRODUCT     VARCHAR2(10),
         C3_TIME     VARCHAR2(8),
         C2_SLS_UNT_PSDF     NUMBER(10),
         C1_FCST_RLS_DT     VARCHAR2(8)
    ORGANIZATION EXTERNAL
         TYPE ORACLE_LOADER
         DEFAULT DIRECTORY dat_dir
         ACCESS PARAMETERS
              RECORDS DELIMITED BY NEWLINE
              CHARACTERSET 'WE8ISO8859P1'
              STRING SIZES ARE IN CHARACTERS
              BADFILE          'rdf_psfc.txt_%a.bad'
              LOGFILE          'rdf_psfc.txt_%a.log'
              DISCARDFILE     'rdf_psfc.txt_%a.dsc'
              SKIP           0
              FIELDS
              MISSING FIELD VALUES ARE NULL
                   C5_LOC     POSITION(1:12),
                   C4_PRODUCT     POSITION(13:22),
                   C3_TIME     POSITION(23:30),
                   C2_SLS_UNT_PSDF     POSITION(31:40),
                   C1_FCST_RLS_DT     POSITION(41:48)
         LOCATION ('rdf_psfc.txt')
    PARALLEL
    REJECT LIMIT UNLIMITED
    NOLOGGING

  • Getting table script using dbms_metadata.get_ddl, but with clob field

    So, Oracle 11g R2..
    I'm using dbms_metadata.get_ddl to get table scripts and it's working fine..
    now, I have a table with clob field, and it's not working... I got an 'missing right parenthesis (ora-0907)' error...
    I could paste a script that I got, but I don't think it makes any sense..
    does anybody have some experience on using this package on clob tables?
    tnx

    this is script that I got... it's long, and it looks like it's not good
    CREATE TABLE "COMMON"."TEST_AAA2"
       (    "ID" NUMBER(10,0),
        "TEKST" VARCHAR2(200 CHAR),
        "UPDATESTAMP" DATE,
        "OBJEKAT" CLOB,
         CONSTRAINT "TEST_PART_PK2" PRIMARY KEY ("ID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "USERS"
      ALTER INDEX "COMMON"."TEST_PART_PK2"  UNUSABLE ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS  LOGGING
      STORAGE(
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMMON_DATA"
    LOB ("OBJEKAT") STORE AS BASICFILE (
      ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
      NOCACHE LOGGING
      STORAGE(
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))
      PARTITION BY RANGE ("UPDATESTAMP")
    (PARTITION "P_201012"  VALUES LESS THAN (TO_DATE(' 2011-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMMON_DATA"
    LOB ("OBJEKAT") STORE AS BASICFILE (
      TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) NOCOMPRESS ,
    PARTITION "P_201101"  VALUES LESS THAN (TO_DATE(' 2011-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMMON_DATA"
    LOB ("OBJEKAT") STORE AS BASICFILE (
      TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) NOCOMPRESS ,
    PARTITION "P_201102"  VALUES LESS THAN (TO_DATE(' 2011-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMMON_ARCHIVE"
    LOB ("OBJEKAT") STORE AS BASICFILE (
      TABLESPACE "COMMON_ARCHIVE" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) NOCOMPRESS ,
    PARTITION "P_201103"  VALUES LESS THAN (TO_DATE(' 2011-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMMON_DATA"
    LOB ("OBJEKAT") STORE AS BASICFILE (
      TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) NOCOMPRESS ,
    PARTITION "P_201104"  VALUES LESS THAN (TO_DATE(' 2011-05-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMMON_ARCHIVE"
    LOB ("OBJEKAT") STORE AS BASICFILE (
      TABLESPACE "COMMON_ARCHIVE" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) NOCOMPRESS ,
    PARTITION "P_201105"  VALUES LESS THAN (TO_DATE(' 2011-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMMON_DATA"
    LOB ("OBJEKAT") STORE AS BASICFILE (
      TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) NOCOMPRESS ,
    PARTITION "P_201106"  VALUES LESS THAN (TO_DATE(' 2011-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMMON_ARCHIVE"
    LOB ("OBJEKAT") STORE AS BASICFILE (
      TABLESPACE "COMMON_ARCHIVE" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) NOCOMPRESS ,
    PARTITION "P_201107"  VALUES LESS THAN (TO_DATE(' 2011-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMMON_DATA"
    LOB ("OBJEKAT") STORE AS BASICFILE (
      TABLESPACE "COMMON_ARCHIVE" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) NOCOMPRESS ,
    PARTITION "P_MAXVALUE"  VALUES LESS THAN (MAXVALUE)
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMMON_DATA"
    LOB ("OBJEKAT") STORE AS BASICFILE (
      TABLESPACE "COMMON_ARCHIVE" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) NOCOMPRESS )

  • Oracle SQL template to create re-usable DDL/DML Scripts for Oracle database

    Hi,
    I have a requirement to put together a Oracle SQL template to create re-usable DDL/DML Scripts for Oracle databases.
    Only the Oracle DBA will be running the scripts so permissions is not an issue.
    The workflow for any DDL is as follows:-
    1) New Table
    a. Check if the table exists from the system/admin views.
    b. If table exists then give message "Table Exists"
    c. If table does not exist then execute DDL code
    2) Add Column
    a. Check if Column exists for a given table from system/admin views
    b. If column exists in the specified table,
    b1. backup table.
    b2. alter table to make changes to the column
    b3. verify data or execute dml script convert from backup to the new change.
    c. If Column does not exist
    c1. backup table
    c2. alter table to add column
    c3. execute dml to populate column with default value.
    The DML scripts are for populating base tables with data required for business operations.
    3) Add new row
    a. check if row exists by comparing old values of each column with new values to be added for the new record.
    b. If exists, give message row exists
    c. If not exists, add new record.
    4) Update existing record (We have createtime columns in these tables so changes can be tracked)
    a. check if row exists using primary key.
    b. If exists,
    b1. deactivate the record using the "active" column of the table
    b2. Add new record with the changes required.
    c. If does not exist, add new record with the changes required.
    Could you please help with some ideas which can get this done accurately?
    I have tried several ways, but I am not able to put together something that fulfills all requirements.
    Thank you,

    First let me address your question. (This is the easy part.)
    1. The existence of tables can be found in DBA_TABLES. Query it and and then use conditional logic and execute immediate to process the DDL.
    2. The existence of table columns is found in DBA_TAB_COLUMNS. Query it and then conditionally execute your DDL. You can copy the "before picture" of the table using that same dba view, or even better, use DBMS_METADATA.
    As for your DML scripts, they should be restartable, reversible, and re-run-able. They should "fail gracefully" on error, be written in such a way that they can run twice in a row without creating duplicate changes.
    3. Adding appropriate constraints can prevent invalid duplicate rows. Also, you can usually add to the where clause so that the DML does only what it needs to do without even relying on the constraint (but the constraint is there as a safeguard). Look up the MERGE statement to learn how to do an UPSERT (update/insert), which will let you conditionally "deactivate" (update) or insert a record. Anything that you cannot do in SQL can be done with simple procedural code.
    Now, to the heart of the matter...
    You think I did not understand your requirements?
    Please be respectful of people's comments. Many of us are professionals with decades of experience working with databases and Oracle technology. We volunteer our valuable time and knowledge here for free. It is extremely common for someone to post what they feel is an easy SQL or PL/SQL question without stating the real goal--the business objective. Experienced people will spot that the "wrong question" has been asked, and then cut to the chase.
    We have some good questions for you. Not questions we need answers from, but questions you need to ask yourself and your team. You need to reexamine this post and deduce what those questions are. But I'll give you some hints: Why do you need to do what you are asking? And will this construct you are asking for even solve the root cause of your problems?
    Then ponder the following quotations about asking the right question:
    Good questions outrank easy answers.
    — Paul Samuelson
    The only interesting answers are those which destroy the questions.
    — Susan Sontag
    The scientific mind does not so much provide the right answers as ask the right questions.
    — Claude Levi-Strauss
    You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions.
    — Mahfouz Naguib
    One hears only those questions for which one is able to find answers.
    — Friedrich Nietzsche
    Be patient towards all that is unresolved in your heart and try to love the questions themselves.
    — Rainer Maria Rilke
    What people think of as the moment of discovery is really the discovery of the question.
    — Jonas Salk
    Judge a man by his questions rather than his answers.
    — Voltaire
    The ability to ask the right question is more than half the battle of finding the answer.
    — Thomas J. Watson

  • Importing table dump from oracle into sybase

    I was wondering if anyone has ever imported a table dump from oracle into sybase. I just tried it and it didn't work. I used TOAD to create my table dump file but when i imprted it into sybase using bcp in i got the following error
    cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
    CSLIB Message: - L0/O0/S0/N36/1/0:

    If you are looking for a basic/standard way to exchange data between Oracle and Sybase, use the CSV format.
    It is trivial to write a generic SQL*Plus script for Oracle to extract data from a table (or a SELECT) and spool this into a properly formatted CSV file.
    It is also just as easy to use Sybase Bulk Copy utility to load that CSV file into Sybase.
    There are also alternative methods. One would be to use Oracle's Heterogeneous Services. You can define a database link in Oracle that connects, via ODBC, to Sybase. And using this database link you can push (insert) data into Sybase.

  • Help needed ... Default tables in XML Schema

    Hi all,
    I got a xsd definition here that does not do as I say ... g
    Though I specified default tables for Cisco_Card and Cisco_LogicalModule, not only the default tables with the names I specified are created but also additionally tables with the default name that is used if no name is specified.
    Actually I am trying to tell it defaultTable="" so no table at all is created. But there are always two tables: Cisco_Card1529_TAB and Cisco_LogicalModule1501_TAB.
    Can someone explain to me what I am doing wrong here?
    Thanks,
    Steff
    <xs:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xdb:storeVarrayAsTable="true">
         <xs:element name="InvDetails" xdb:defaultTable="XML_CISCOWORKS" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="SchemaInfo" minOccurs="0"/>
                        <xs:element ref="RMEPlatform" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="SchemaInfo" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="RMEServer" type="xs:string" minOccurs="0"/>
                        <xs:element name="CreatedAt" type="xs:string" minOccurs="0"/>
                        <xs:element name="SchemaVersion" type="xs:string" minOccurs="0"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="RMEPlatform" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="Cisco_Chassis" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_NetworkElement" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_ComputerSystemPackage" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_Chassis" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceID" type="xs:string"/>
                        <xs:element name="Model" type="xs:string" minOccurs="0"/>
                        <xs:element name="HardwareVersion" type="xs:string" minOccurs="0"/>
                        <xs:element name="SerialNumber" type="xs:string" minOccurs="0"/>
                        <xs:element name="ChassisSystemType" type="xs:string" minOccurs="0"/>
                        <xs:element name="NumberOfSlots" type="xs:integer" minOccurs="0"/>
                        <xs:element name="NoOfCommunicationConnectors" type="xs:integer" minOccurs="0"/>
                        <xs:element ref="Cisco_Backplane" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_Card" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_Backplane" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="BackplaneType" type="xs:string" minOccurs="0"/>
                        <xs:element name="Model" type="xs:string" minOccurs="0"/>
                        <xs:element name="SerialNumber" type="xs:string" minOccurs="0"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_Card" xdb:defaultTable="lala" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceID" type="xs:integer"/>
                        <xs:element name="RequiresDaughterBoard" type="xs:boolean" minOccurs="0"/>
                        <xs:element name="Model" type="xs:string" minOccurs="0"/>
                        <xs:element name="SerialNumber" type="xs:string" minOccurs="0"/>
                        <xs:element name="LocationWithinContainer" type="xs:string" minOccurs="0"/>
                        <xs:element name="PartNumber" type="xs:string" minOccurs="0"/>
                        <xs:element name="CardType" type="xs:string" minOccurs="0"/>
                        <xs:element name="HardwareVersion" type="xs:string" minOccurs="0"/>
                        <xs:element name="Description" type="xs:string" minOccurs="0"/>
                        <xs:element name="OperationalStatus" type="xs:string" minOccurs="0"/>
                        <xs:element name="FWManufacturer" type="xs:string" minOccurs="0"/>
                        <xs:element name="Manufacturer" type="xs:string" minOccurs="0"/>
                        <xs:element name="NumberOfSlots" type="xs:integer" minOccurs="0"/>
                        <xs:element name="NoOfCommunicationConnectors" type="xs:integer" minOccurs="0"/>
                        <xs:element ref="SoftwareIdentity" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_CommunicationConnector" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_FlashDevice" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_PhysicalMemory" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_Card" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_CommunicationConnector" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceID" type="xs:integer"/>
                        <xs:element name="ConnectorType" type="xs:string" minOccurs="0"/>
                        <xs:element name="Description" type="xs:string" minOccurs="0"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_FlashDevice" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceID" type="xs:integer"/>
                        <xs:element name="InstanceName" type="xs:string" minOccurs="0"/>
                        <xs:element name="FlashDeviceType" type="xs:string" minOccurs="0"/>
                        <xs:element name="Size" type="xs:string" minOccurs="0"/>
                        <xs:element name="NumberOfPartitions" type="xs:integer" minOccurs="0"/>
                        <xs:element name="ChipCount" type="xs:integer" minOccurs="0"/>
                        <xs:element name="Description" type="xs:string" minOccurs="0"/>
                        <xs:element name="Removable" type="xs:boolean" minOccurs="0"/>
                        <xs:element ref="Cisco_FlashPartition" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_FlashPartition" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceID" type="xs:integer"/>
                        <xs:element name="InstanceName" type="xs:string" minOccurs="0"/>
                        <xs:element name="Upgrade" type="xs:string" minOccurs="0"/>
                        <xs:element name="NeedsErasure" type="xs:boolean" minOccurs="0"/>
                        <xs:element name="PartitionStatus" minOccurs="0">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="unknown"/>
                                       <xs:enumeration value="readOnly"/>
                                       <xs:enumeration value="runFromFlash"/>
                                       <xs:enumeration value="readWrite"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                        <xs:element name="FileSystemSize" type="xs:string" minOccurs="0"/>
                        <xs:element name="AvailableSpace" type="xs:string" minOccurs="0"/>
                        <xs:element name="FileCount" type="xs:integer" minOccurs="0"/>
                        <xs:element ref="Cisco_FlashFile" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_FlashFile" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceID" type="xs:integer"/>
                        <xs:element name="FileSize" type="xs:string" minOccurs="0"/>
                        <xs:element name="FileStatus" minOccurs="0">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="unknown"/>
                                       <xs:enumeration value="deleted"/>
                                       <xs:enumeration value="invalidChecksum"/>
                                       <xs:enumeration value="valid"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                        <xs:element name="Checksum" type="xs:string" minOccurs="0"/>
                        <xs:element name="InstanceName" type="xs:string" minOccurs="0"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_PhysicalMemory" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="MemoryType" minOccurs="0">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="nvRam"/>
                                       <xs:enumeration value="NVRAM"/>
                                       <xs:enumeration value="processorRam"/>
                                       <xs:enumeration value="RAM"/>
                                       <xs:enumeration value="ROM"/>
                                       <xs:enumeration value="FEPROM"/>
                                       <xs:enumeration value="BRAM"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                        <xs:element name="Capacity" type="xs:string" minOccurs="0"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_NetworkElement" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceID" type="xs:integer"/>
                        <xs:element name="Description" type="xs:string" minOccurs="0"/>
                        <xs:element name="PrimaryOwnerName" type="xs:string" minOccurs="0"/>
                        <xs:element name="InstanceName" type="xs:string" minOccurs="0"/>
                        <xs:element name="PhysicalPosition" type="xs:string" minOccurs="0"/>
                        <xs:element name="SysObjectId" type="xs:string" minOccurs="0"/>
                        <xs:element name="SysUpTime" type="xs:string" minOccurs="0"/>
                        <xs:element name="OfficialHostName" type="xs:string" minOccurs="0"/>
                        <xs:element name="NumberOfPorts" type="xs:integer" minOccurs="0"/>
                        <xs:element ref="Cisco_LogicalModule" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_Port" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_MemoryPool" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_IfEntry" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_IPProtocolEndpoint" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_PEHasIfEntry" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_LogicalModule" xdb:defaultTable="lolo" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceID" type="xs:integer"/>
                        <xs:element name="ModuleNumber" type="xs:integer" minOccurs="0"/>
                        <xs:element name="ModuleType" type="xs:string" minOccurs="0"/>
                        <xs:element name="InstanceName" type="xs:string" minOccurs="0"/>
                        <xs:element name="EnabledStatus" type="xs:string" minOccurs="0"/>
                        <xs:element name="NumberOfPorts" type="xs:integer" minOccurs="0"/>
                        <xs:element ref="Cisco_Port" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_LogicalModule" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_OSElement" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_Port" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="PortNumber" type="xs:integer" minOccurs="0"/>
                        <xs:element name="PortType" type="xs:string" minOccurs="0"/>
                        <xs:element name="InstanceName" type="xs:string" minOccurs="0"/>
                        <xs:element name="IfInstanceID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_MemoryPool" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceName" type="xs:string" minOccurs="0"/>
                        <xs:element name="PoolType" type="xs:integer" minOccurs="0"/>
                        <xs:element name="DynamicPoolType" type="xs:string" minOccurs="0"/>
                        <xs:element name="AlternatePoolType" type="xs:string" minOccurs="0"/>
                        <xs:element name="IsValid" type="xs:boolean" minOccurs="0"/>
                        <xs:element name="Allocated" type="xs:string" minOccurs="0"/>
                        <xs:element name="Free" type="xs:string" minOccurs="0"/>
                        <xs:element name="LargestFree" type="xs:string" minOccurs="0"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                        <!--PoolType ValueMap {"0", "1", "2", "3", "4", "5", "65536"},
    Values {"Unknown", "Processor", "I/O", "PCI", "Fast", "Multibus", "Dynamic"},
    -->
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_OSElement" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceName" type="xs:string" minOccurs="0"/>
                        <xs:element name="OSFamily" type="xs:string" minOccurs="0"/>
                        <xs:element name="Version" type="xs:string" minOccurs="0"/>
                        <xs:element name="Description" type="xs:string" minOccurs="0"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_IfEntry" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceID" type="xs:string"/>
                        <xs:element name="InstanceName" type="xs:string" minOccurs="0"/>
                        <xs:element name="ProtocolType" type="xs:string" minOccurs="0"/>
                        <xs:element name="Speed" type="xs:string" minOccurs="0"/>
                        <xs:element name="RequestedStatus" minOccurs="0">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="up"/>
                                       <xs:enumeration value="down"/>
                                       <xs:enumeration value="testing"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                        <xs:element name="OperationalStatus" minOccurs="0">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="Up"/>
                                       <xs:enumeration value="Down"/>
                                       <xs:enumeration value="Testing"/>
                                       <xs:enumeration value="Unknown"/>
                                       <xs:enumeration value="Dormant"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                        <xs:element name="Description" type="xs:string" minOccurs="0"/>
                        <xs:element name="PhysicalAddress" type="xs:string" minOccurs="0"/>
                        <xs:element name="NetworkAddress" type="xs:string" minOccurs="0"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_IPProtocolEndpoint" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="Address" type="xs:string" minOccurs="0"/>
                        <xs:element name="SubnetMask" type="xs:string" minOccurs="0"/>
                        <xs:element name="DefaultGateway" type="xs:string" minOccurs="0"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_PEHasIfEntry" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="Cisco_IPProtocolEndpoint" type="xs:string" minOccurs="0"/>
                        <xs:element name="Cisco_IfEntry" type="xs:string" minOccurs="0"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Cisco_ComputerSystemPackage" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="Antecedent" type="xs:string" minOccurs="0"/>
                        <xs:element name="Dependent" type="xs:string" minOccurs="0"/>
                        <!--
    Antecedent is the InstanceID from Cisco_Chassis Element
    Dependent is the InstanceID from Cisco_NetworkElement
    -->
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="SoftwareIdentity" xdb:defaultTable="" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="Classification" minOccurs="0">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="Firmware"/>
                                       <xs:enumeration value="Software"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                        <xs:element name="VersionString" type="xs:string" minOccurs="0"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="AdditionalInformation" xdb:defaultTable="" xdb:maintainDOM="true">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="AD" minOccurs="0" maxOccurs="unbounded" xdb:maintainDOM="false">
                             <xs:complexType>
                                  <xs:attribute name="name" type="xs:string"/>
                                  <xs:attribute name="value" type="xs:string"/>
                             </xs:complexType>
                        </xs:element>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>

    Here's the Culprit
    <xs:element name="Cisco_Card" xdb:defaultTable="lala" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="InstanceID" type="xs:integer"/>
                        <xs:element name="RequiresDaughterBoard" type="xs:boolean" minOccurs="0"/>
                        <xs:element name="Model" type="xs:string" minOccurs="0"/>
                        <xs:element name="SerialNumber" type="xs:string" minOccurs="0"/>
                        <xs:element name="LocationWithinContainer" type="xs:string" minOccurs="0"/>
                        <xs:element name="PartNumber" type="xs:string" minOccurs="0"/>
                        <xs:element name="CardType" type="xs:string" minOccurs="0"/>
                        <xs:element name="HardwareVersion" type="xs:string" minOccurs="0"/>
                        <xs:element name="Description" type="xs:string" minOccurs="0"/>
                        <xs:element name="OperationalStatus" type="xs:string" minOccurs="0"/>
                        <xs:element name="FWManufacturer" type="xs:string" minOccurs="0"/>
                        <xs:element name="Manufacturer" type="xs:string" minOccurs="0"/>
                        <xs:element name="NumberOfSlots" type="xs:integer" minOccurs="0"/>
                        <xs:element name="NoOfCommunicationConnectors" type="xs:integer" minOccurs="0"/>
                        <xs:element ref="SoftwareIdentity" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_CommunicationConnector" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_FlashDevice" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_PhysicalMemory" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Cisco_Card" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="AdditionalInformation" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>Note that the element Cisco_Card contains a ref to itself. The same is true of the element Cisco_LogicalModule.
    When we encounter recursive structures we break the recursion by storing the recursive elements out-out-line is a seperate table and using a pointer (REF XMLType) column to track the relationionship..
    You can name these elements by putting an xdb:SQLInline="false" and xdb:defaultTable="YOUR_TABLE_NAME" on the recursive element.
    If you need to query accross these elements I would strongly advise upgrading to 10.2.x. In 10.2.x we implemented a number of optimizations for dealing with storing and querying this kind of structure.

  • Xml file to table script

    Hi all,
    I would be thanks you and greatful if someone can help me to create a table script.
    I have an XML file with PK and FK relationship.
    I also have a DTD file.
    I want to create tables in Oracle Database from XML or DTD file.
    Thanks in Advance
    Saaz

    You might want to take a look at registerSchema (http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_xmlsch.htm#sthref9696) with genTables set to TRUE. This would let you use the DTD to create a table structure within Oracle. This may or may not be what you are looking for but you didn't provide many details.
    That's 10.2 documentation so use the edition for your version of Oracle

  • Error in import table data using oracle datapump

    i am trying to import table data using oracle datapump
    CREATE TABLE emp_xt (
    ID NUMBER,
    NAME VARCHAR2(30)
    ORGANIZATION EXTERNAL (
    TYPE ORACLE_DATAPUMP
    DEFAULT DIRECTORY backup
    LOCATION ('a.dmp')
    it return the following error
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04084: The ORACLE_DATAPUMP access driver does not support the ROWID column.
    ORA-06512: at "SYS.ORACLE_DATAPUMP", line 19
    please help me

    .dmp file generated from exp command file not from oracle_datapump

  • How to transfer data between different tables in an Oracle 10g databse?

    I have to do the following: there are 5 database tables in our Oracle 10g database that store certain data. Then there are 2 new tables where we want the data to go to. My task is to somehow transfer all the data that is in the first 5 tables and insert it in the 2 new ones. All tables are in the same database. The challenge lies in the fact that the structures of the tables are very dissimilar so it won't be a matter of a simple INSERT SQL query.
    The data access tier of our application is developed in JAVA. We use EJB. So one way I am thinking of doing the above mentioned data transfer is to simply code it in the JAVA backed. But that might be to slow, there are millions of records in those first 5 tables. What is the best way to do something like that? Perhaps a custom (Perl?) script or some such?
    Thanks.

    The problem is that the way the data is stored in the old tables you cannot write a query that would return it in such a format that you could immediately insert it in the new table without some formatting. Let me illustrate with an example. To pull the data from the old tables I use this query:
    SELECT
         SXML_DOCUMENT_DATA.VALUE As DocumentValue,
    SXML_ELEMENT.NAME As ElementName
    FROM
         SXML_DOCUMENT,
         SXML_DOCUMENT_DATA,
         SXML_DOCUMENT_DETAIL,
         SXML_ELEMENT,
         SXML_TYPE
    WHERE
         SXML_TYPE.XML_TYPE_KEY = SXML_DOCUMENT.XML_TYPE_KEY
    AND     SXML_DOCUMENT.XML_DOCUMENT_KEY = SXML_DOCUMENT_DETAIL.XML_DOCUMENT_KEY
    AND     SXML_DOCUMENT_DETAIL.XML_DOCUMENT_DETAIL_KEY = SXML_DOCUMENT_DATA.XML_DOCUMENT_DETAIL_KEY
    AND     SXML_ELEMENT.XML_ELEMENT_KEY = SXML_DOCUMENT_DATA.XML_ELEMENT_KEY
    AND     SXML_TYPE.NAME = 'DA_UNIT_COMMITMENT'
    AND     (SXML_ELEMENT.NAME = 'resource'
         OR SXML_ELEMENT.NAME = 'resourceType'
         OR SXML_ELEMENT.NAME = 'commitmentType'
         OR SXML_ELEMENT.NAME = 'startTime'
         OR SXML_ELEMENT.NAME = 'endTime'
         OR SXML_ELEMENT.NAME = 'schedulingCoordinator')
    ORDER BY
         SXML_DOCUMENT.NAME,
         SXML_DOCUMENT_DETAIL.XML_DOCUMENT_DETAIL_KEY,
         SXML_DOCUMENT_DATA.XML_DOCUMENT_DATA_KEY,
         SXML_ELEMENT.NAME;
    The results from the SQL query above look like this:
    DOCUMENTVALUE | ELEMENTNAME
    1 | ALAMIT_7_UNIT_1 | resource
    2 | GEN | resourceType
    3 | BRS8 | schedulingCoordinator
    4 | IFM | commitmentType
    5 | 2008-07-29T18:00:00:00 | startTime
    6 | 2008-07-30T00:00:00 | endTime
    7 | ALAMIT_7_UNIT_1 | resource
    8 | GEN | resourceType
    9 | BRS8 | schedulingCoordinator
    10 | IFM | commitmentType
    11 | 2008-07-29T00:00:00 | startTime
    12 | 2008-07-29T04:00:00 | endTime
    and so on. The type of data repeats every 6 records. And the values of each 6 records corresponds to 1 row in the new table, which looks like this:
    schedulingCoordinator | resource | resourceType | commitmentType | startDate | endDate
    1| 1 | 27 | GEN | IFM | 2008-07-29T18:00:00:00 | 2008-07-30T00:00:00
    2| 1 | 27 | GEN | | 2008-07-29T00:00:00 | 2008-07-29T04:00:00
    So hopefully now you see the challenge. It is not as simple as writing a SQL query that returns result rows corresponding 1 to 1 to a row in the new table. Somehow I need to take the first 6 result rows from that big SQL query and put them in the first row of the new table. Then the next 6 and put them in the second row and so on. And also, we are talking about millions of records. What happens if I process the first 2 million and then some error occurs? Do I start from the beginning again? One idea I have is to process the data in chunks, say process 500 results, commit, process another 500, commit, and so on.
    Edited by: 799984 on Oct 11, 2010 9:08 AM

  • Default Date Format in Oracle 9i

    What is the default date given by oracle 9i when the column is specified as NULL for the date column ?
    Just like in SQL Server 2000 when date is given as NULL, it will give date as
    '1900-01-01 00:00:00' in that column. What is it in Oracle 9i
    Thanx in advance!

    It will be a NULL, unless you specify a DEFAULT for the column:-
    <code>
    SQL> create table t ( x int, y date );
    Table created.
    SQL> insert into t ( x ) values ( 1 );
    1 row created.
    SQL> select * from t;
    X Y
    1
    SQL> alter table t modify ( y date default sysdate );
    Table altered.
    SQL> insert into t ( x ) values ( 1 );
    1 row created.
    SQL> select * from t;
    X Y
    1
    1 21-JUL-05
    </code>
    Regards
    Adrian

  • Export table access to oracle with Database ODBC()

    Hi,
    I export a table, access 2003, ent_tab whit  'DataBase ODBC()' to oracle.
    I open Oracle SQL Developer and i can show table ent_tab, but i go worksheet and execute:
    select * from ent_tab
    and display error: ORA-00942...
    Why??!!
    Regards
    Jomar

    Because ODBC created the table with "" which allowed lower case table name, but Oracle uses upper case table name by default. Suggest you recreate the table with upper-case name to avoid having to use "" in select statements.
    Edited by: rgeier on Oct 27, 2009 5:34 PM

  • Not Able to Create database objects(Tables, etc) in Oracle 12c

    Hello Sir,
    Recently, I have installed oracle 12c in my PC. And I am able to connect with the ANONYMOUS user and connection name ORCL.
    But I am not able to create any objects in database like tables creation, it's just showing the error message like- you don't have sufficient privileges.
    Could you please help on this? How to start the work on oracle 12c database as I have worked on Oracle 11g with the SCOTT user and connection name ORCL.It was working fine. But SCOTT user is not present in 12c. Is there any other USER in 12c with the default tables like EMP table in 11g in the SCOTT USER schema?
    Please suggest, what to do?
    Thanks In Advance!!

    Hi Nishant ,
    Thanks for the reply.
        I have done all the steps as you mentioned above. I am not able to create HR user. Please check the below errors and
    please guide me on this.
    SQL*Plus: Release 12.1.0.1.0 Production on Sat Oct 5 23:46:38 2013
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    Enter user-name: anonymous
    Enter password:
    Last Successful login time: Sat Oct 05 2013 23:46:58 +05:30
    Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    SQL> connect sys as sysdba;
    Enter password:
    Connected.
    SQL> CREATE USER  hr IDENTIFIED BY Password#123
      2  DEFAULT TABLESPACE  hr_users
      3  TEMPORARY TABLESPACE  hr_temp
      4  QUOTA  5000k ON  hr_users
      5  QUOTA unlimited ON hr_temp
      6  PROFILE  enduser  ;
    CREATE USER  hr IDENTIFIED BY Password#123
    ERROR at line 1:
    ORA-65096: invalid common user or role name
    SQL> SELECT NAME, CDB FROM V$DATABASE;
    NAME      CDB
    ORCL      YES
    SQL> SHO CON_ID CON_NAME
    CON_ID
    1
    CON_NAME
    CDB$ROOT
    SQL> SET LINE 150
    SQL> SELECT NAME, OPEN_MODE, OPEN_TIME FROM V$PDBS;
    NAME                           OPEN_MODE  OPEN_TIME
    PDB$SEED                   READ ONLY  04-OCT-13 08.57.50.461 PM
    PDBORCL                        MOUNTED
    SQL> CONN HR/HR@PDBORCL
    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified
    SQL> SHO CON_ID CON_NAME
    SP2-0640: Not connected
    SP2-0641: "SHOW CONTAINER" requires connection to server
    Thanks in advance!!
    Regards,
    Dharmendra Verma

  • Fdm 11.1.2.1 mapping table scripts does not accept vba functions like 'lef

    ok, in fdm 11.1.2.1, in the UD2 column of IMPORTS, i have something like "award::purpose::type" , and in the mapping table script , i'm trying to use the 'left' and 'mid' functions to break down the UD2 columns (delimited by "::"), and then mapping it to a result in VALIDATE.
    why don't the simple VBA functions work in the mapping scripts (where you have "#Script" in the "Target Custom2 column")
    to keep things simple, i would like the following to work (and it errors on the first line at the 'left' function)
    One_Award = Left(varvalues(21), 5)
    Result = One_Award
    thanks.
    Edited by: 866191 on Jun 26, 2012 8:15 AM

    first, i changed my original message at the top; please take another look. thank you.
    the error message is:
    ** Begin FDM Runtime Error Log Entry [2012-06-26 08:26:57] **
    ERROR:
    Code............................................. 5
    Description...................................... Conditional Map Script Error: Invalid procedure call or argument: 'Left' at line(7)
    Procedure........................................ clsCalcEngine.fFlagWildcard
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 4492
    IDENTIFICATION:
    User............................................. bachoi
    Computer Name.................................... OFEPMAPPUAT05
    App Name......................................... fdmawds
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... HYPUAT
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... GLBS
    Location ID...................................... 749
    Location Seg..................................... 3
    Category......................................... ACTUAL
    Category ID...................................... 13
    Period........................................... Jun - 2012
    Period ID........................................ 6/30/2012
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False

  • Is there a system table that stores the "create table" scripts

    Does a Oracle system table exist that contains the "create table" scripts for tables defined under a schema?
    I know I can build this with SQL by querying the user_tab_columns, but I was wondering whether the entire DML
    statement is already stored in some other system table. In the Quest Toad software you can simply go to the "Schema Brower", "Tables",
    then select the "Script" tab and it shows you the "create table" statement for the particular table that you are
    looking at. I'm wondering whether Toad behind the scenes is building this "create table" script via the user_tab_columns
    table or using another system table.
    Thank you in advance,
    Wes

    you can use the DBMS_METADATA.GET_DDL procedure to obtain the details regarding the ddl statement used to create the table.

  • Error when generating create table script

    Hi,
    I am trying to generate create table script from an existing table. But I get the following error when doing so,
    ORA-20001: Rem Unable to generate DDL for ORA-06502: PL/SQL: numeric or value error ORA-31605: the following was returned from LpxXSLResetAllVars in routine kuxslResetParams: LPX-1: NULL pointer ORA-22921: length of input buffer is smaller than amount requested .
    Any suggestions on what could be wrong?
    Thanks.
    -B

    this is my bad, i should have updated this thread when we originally troubleshot this issue...
    that error you're getting on htmldb.oracle.com when you try to generate ddl for tables and such is a manifestation of a database bug (#3372908) that's recently been filed. checking the worklog for that bug suggests that those guys are still working out the issue. unfortunately, there's no current work-around on htmldb.oracle.com at the moment. if you want to generate ddl for your objects, you'd have to query the appropriate data dictionary views to get the info you need.
    ...i'll update the htmldb.oracle.com interface in a bit to prevent other users from hitting this issue. so you know, this is only an issue on db versions 9.2.0.3 and 9.2.0.4 running on some platforms and only (as far as i know) those using the AL32UTF8 characterset ...which does include our hosted site for now.
    hope this helps,
    raj

Maybe you are looking for

  • How to prevent email when using find my iphone

    Hi there, Am I the only that finds the email confirmations annoying when using find my iPhone? Is there any way to prevent these emails, or a preference somewhere to turn them off?

  • New to iweb & the web

    i have my own website hosted by names.co.uk & my own domain, www.mikehorneweddingvideo.co.uk currently i use front page & upload from there. being new all things mac i have just discoverd iweb and the templates are very impressive, now i have dabbled

  • Trouble using Javascript getElementById

    hello, unfortunately the great comfort of studio creator2 ends, wenn using javascript. I alway debugged it using firefox, but that doesn't seem to work here: Document.getElementsById("form1:totalCostTextField").value =         document.getElementsByI

  • I tried to jailbreak my ipod but when it swithed off it did not want came back on so what must i do

    I tried to jailbreak my Ipod but when i swithed it off it did not want to came buck on

  • Need advice on which version to update with!

    Hello! Hoping for some good advice here! I've been running 10.5.3 for last 20 months, and it's been very stable etc... anyway, I now have to update to 10.5.5 or later in order to run some new software (RED plugin for FCP to be exact). Please could so