How set or create an autonumeric ID column in access.

I want to create or set the properties of the column for set an autonumeric id, I have a vi that send data to the DB but I need this column.
Solved!
Go to Solution.

Hi Abraham 
If you have already the column that you want to be autonumeric, this snippet will help you to do it. It's select the max number on your column and then will plus one. This is a way that you can use. Each time that you need to insert new rows use this code for having an autonumeric column.
Greetings
Julio Mena

Similar Messages

  • How set dynamically created query in GridControl?

    How set dynamically created query in GridControl?
    Thank you

    If your dynamic query is based on an Entity object, then you can probably use RowSetInfo setQueryInfo method.
    The argument to this method is a 'Query' object. There are three flavours provided in the oracle.dacf.dataset
    package.
    oracle.dacf.dataset.QueryViewInfo
    defines an updateable SQL query based on a predefined BC4J View Object.
    oracle.dacf.dataset.QueryStatementInfo
    Creates a view object based on an arbitrary SQL statement.
    oracle.dacf.dataset.QueryInfo
    Creates a View Object from an Entity Object and additional SQL clauses. The View Object will have
    that Entity Object as its sole Entity Object base.
    If in your application you are able to specify the name of the entity, then you can use the QueryInfo method to define your
    query. Please try the following.
    SessionInfo si = ....
    void runDynamicQuery()
    RowSetInfo rsi = new RowSetInfo();
    AttributeInfo ai = new AttibuteInfo(..);
    ai.setName(..);
    rsi..addChild(ai);
    si.addChild( rsi)
    rsi.setQueryInfo( new QueryInfo( ...../* include entity name */ .... ));
    rsi.setName(....);
    rsi.open(true);
    grid.setDataItemName(...);
    Hope this helps,
    Sathish.

  • How set maximum of characters for the columns

    Hello I use a JTable and I want to set maximum of characters for the columns.
    For example column 1 max 10 characters, column 2 max 20 characters, etc..
    How can I do this?

    The principle is as follows: a table uses certain input components for editing a cell value, e.g. a JCheckBox for Boolean-type values or a JTextField for textual/numerical values. By default, a JTextField doesn't have any size limit, so you can enter as many chars as you want. In order to change this behaviour, you'll have to
    1.) create a JTextField that does have a size limit and
    2.) set a CellEditor on the JTable which uses this manipulated JTextField.
    An easy way for 1.) is to create a custom Document (the internal data representation for text components, the M-part of the MVC -- see javax.swing.text.Document) that doesn't accept any text beyond a given limit, e.g.:
    public class LimitedDocument extends PlainDocument {
      private int max = 0;
      public LimitedDocument(int max) {
        this.max = max;
      public void insertString(int offset, String str, AttributeSet a) throws BadLocationException {
        // too long for the limit; get current contents, insert, and cut off trailing chars
        if ((getLength() + str.length()) > max) {
          StringBuffer buf = new StringBuffer(getText(0,getLength()));
          buf.insert(offset,str);
          remove(0,len); // remove current text contents
          super.insert(0,buf.toString().substring(0,max),a); // insert whole text
        // no problem, will fit
        else {
          super.insertString(offset,str,a);
    }Then, in order to set the cell editor -- for example for the first column --, you can do as follows:
    myTable.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(new JTextField(new LimitedDocument(5),"",5)));This will create a new DefaultCellEditor (see javax.swing.table) and initialize it with a given text field which will be responsible for any edition in this column. As the text field itself is created using a limit of 5, it should accept no text insertion beyond 5 chars.

  • How can i create an auto increment column

    Hello Everyone
    We are working on an EAM package which has an auto number facility but that is not meeting our requirement because some 10s and 100s of numbers keep on jumping based on the number of records the child table has.Means every record in my parent table will have some child records in another table which we call it a child table.The number of numbers that will be jumped each time will depend on the number of child records it has. Now we want to create a new column and generate a sequential unique number in my parent table with out linking it to its child table and use this number as a reference number. And we cant do that through our package customization. Can any one guide us if we can meet our requirement through oracle triggers or so.
    Thanks and Regards

    Hi,
    For "Auto-Increment" functionality - you can use a combination of a sequence and a trigger like so:
    create table roles ( role_id INT
                       , role_name VARCHAR2(30) NOT NULL
                       , creation_date DATE DEFAULT SYSDATE NOT NULL
                       , role_description VARCHAR2(255)
                       , CONSTRAINT roles_pk PRIMARY KEY (role_id)
                       , CONSTRAINT roles_uk1 UNIQUE (role_name)
    create sequence role_id_seq
    start with 1
    increment by 1
    nocache;
    CREATE OR REPLACE TRIGGER roles_pk_trig
    BEFORE
    insert on roles
    for each row
    begin
    IF :new.role_id IS NULL THEN
       SELECT role_id_seq.NEXTVAL
       INTO :new.role_id
       FROM dual;
    END IF;
    end;
    /Now any insert which leaves the "ROLE_ID" column NULL will have an auto-incremented value put in for that column. This is similar to an "Autonumber" column in Access.
    Hope this helps...
    Take care.

  • Object Modelling Question: How do I create multiple nested table columns in one table

    Hi there,
    I have a XML doc which is as follows:
    <PERSON>
    <ADDRESSLIST>
    <ADDRESS>111, Hamilton Ave </ADDRESS>
    <ADDRESS>222, Cambell Ave </ADDRESS>
    </ADDRESSLIST>
    <PHONELIST>
    <PHONENO>4085551212 </PHONENO>
    <PHONENO>6505551212</PHONENO>
    </PHONELIST>
    </PERSON>
    I need a table that looks as follows:
    Create table person
    (addresslist address_table,
    phonelist phone_table
    I would like to create a table called person with columns addresslist and phonelist. Each defined as object type table of address and table of phones.
    Can anybody please tell me how can I do this.
    I have seen that there can only be one nested table per table. If so, how do we do this.
    Thanks so much
    Pramod

    pelle.k wrote:
    peets wrote:Hehe because it's less typing!
    Good one!
    Also, it's by far the more dynamic method.
    If you want to get pedantic, it's also far less efficient in terms of execution time: each iteration of the loop forks a new process, whereas using a single mkdir command forks only once.  The "best" way is the curly-braces method demonstrated above by chimeric.

  • How can you create a weblogic ID and restrict access within weblogic?

    for e.g. I would like to create an account 'x' in weblogic and give this user access to only 'security realms' within weblogic and NO other functionality.
    Is this possible?
    Thanks.

    In OBIEE 11g the weblogic roles follow the same type of logic as we all have come to enjoy from role based security.
    There are some default roles in WLS such as Deployer, Administrator, etc. defined by default in web logic.
    You can create a WebLogic user using the DefaultProider, Security Realm > Realm > User >New ...
    and then add that user to a group or directly to a new Policy Role.
    Take a look at the "Administrators" Group for an example of how it relates to the global "Admin" role under the Role & Policies tab.
    Finally, I don't think that you can isolate just the Security Realm for a Web Logic user. Take a look at this document to see what aspects you can provide privileges on,
    http://download.oracle.com/docs/cd/E14571_01/web.1111/e13747/types.htm#i1241945
    Cheers,
    Christian
    http://www.artofbi.com

  • How do I create admin console users with full access to configuration and the directory in every instance?

    I want to be able to create directory user ID for the iPlanet administrators. They should be able to access the admin console and all the instances created. They should be able to configure each instance and directory. I was able tocreate Admin Server Administrators but they were only able to modify the directory(tab) and not the configurations(tab). Any help would be greatly appreciated!
    Thanks.
    Keith

    Hi Keith,
    In o=netscaperoot, edit the static group called cn=Configuration Administrators, ou=Groups, ou=TopologyManagement, o=NetscapeRoot - this group contains the admins peer to your config admin. Since the console is quirky and doesn't let you add in users not in netscaperoot, just click advanced and put in the full dn of whoever you want in by hand, e.g., uid=scarter, ou=people, dc=mydomain,dc=com as a static member. then rebind to the console with the full dn and passwd, and away you go :)
    james

  • How to create index on xmltype column

    I have a table having only one column xmlcontent (xmltype). This table stores xml data of about 10GB size. I'm using extract value to move the data to staging tables.
    How can I create index on xmltype column?
    Create index indexname on table (column) doesn't seem to work.
    Sample xmlstructure is given below
    <Root>
    <Type>Insert</Type>
    <Date>2006-12-29</Date>
    <Source>8</Source>
    <id>data</id>
    <key_flds>
    <fld><id>Key1</id><val>C</val></fld>
    <fld><id>Key2</id><val>429672</val></fld>
    <fld><id>Key3</id><val>8</val></fld>
    </key_flds>
    </Root>
    I need to do extract value on all tags and move them to corresponding relational tables.

    Hi, you need to create them using something like this (what I have used and work rather well - if I did not load the xml into an xml table, the processing took about 10 minutes, while the indexed xml table took just a few seconds). statute_xml is the table name and sxmldoc is the xml column/field.
    create index desc_idx on statute_xml
    (sxmldoc.existsNode('/SimpleTypeCompanion/EnumerationValue/@description'))
    create index sid_idx on statute_xml
    (sxmldoc.existsNode
    ('/SimpleTypeCompanion/EnumerationValue/Text')
    create index effdate_idx on statute_xml
    (sxmldoc.existsNode
    ('/SimpleTypeCompanion/EnumerationValue/@effectiveDate')
    Hope this helps.
    Ben

  • HOW DO I CREATE MULTIPLE SCHEDULES IN ICAL?

    Hi, just got my ipad 2 and i have my work calendar on ical through exchange but I want to add a home calendar but cant work out how to add a additional schedule? Help appreciated, the guy in my local apple store said I need to do it via ITunes but i still cant find where? thanks

    Shashi,
    You need to read about configuring the Catalog services:
    http://edocs.bea.com/wlp/docs40/catalog/index.htm
    These docs have not yet been moved into the 7.0 doc set but also apply to
    7.0.
    Sincerely,
    Daniel Selman
    "Shashi Goli" <[email protected]> wrote in message
    news:3d4184cc$[email protected]..
    >
    Hello,
    I have 2 stores in different locations and they each have their owncatalogs (similar
    products) and inventory, but I want the user to be able to select thestore in
    which he wants to buy. Ex - It could be New York store or New Jerseystore.
    >
    How can I create 2 or more catalogs and access them in the same Portal?What is
    the differentiator?
    Regards,
    Shashi
    Answer appreciated.

  • How do I create multiple catalogs in the same portal?

    Hello,
    I have 2 stores in different locations and they each have their own catalogs (similar
    products) and inventory, but I want the user to be able to select the store in
    which he wants to buy. Ex - It could be New York store or New Jersey store.
    How can I create 2 or more catalogs and access them in the same Portal? What is
    the differentiator?
    Regards,
    Shashi
    Answer appreciated.

    Shashi,
    You need to read about configuring the Catalog services:
    http://edocs.bea.com/wlp/docs40/catalog/index.htm
    These docs have not yet been moved into the 7.0 doc set but also apply to
    7.0.
    Sincerely,
    Daniel Selman
    "Shashi Goli" <[email protected]> wrote in message
    news:3d4184cc$[email protected]..
    >
    Hello,
    I have 2 stores in different locations and they each have their owncatalogs (similar
    products) and inventory, but I want the user to be able to select thestore in
    which he wants to buy. Ex - It could be New York store or New Jerseystore.
    >
    How can I create 2 or more catalogs and access them in the same Portal?What is
    the differentiator?
    Regards,
    Shashi
    Answer appreciated.

  • How do I create an Event Handler for an Execute SQL Task in SSIS if its result set is empty

    So the precedence on my entire package executing is based on my first SELECT of my Table and an updatable column. If that SELECT results in an empty result set, how do I create an Event Handler to handle an empty result set?
    A Newbie to SSIS.
    I appreciate your review and am hopeful for a reply.
    PSULionRP

    Depends upon what you want to do in the eventhandler. this is what you can do
    Store the result set from the Select to a user variable.
    Pass this user variable to a Script task.
    In the Script task do whatever you want to do including failing the package this can be done by failing the script task, which in turns fails the package. something like
    Dts.TaskResult = Dts.Results.Failure
    Abhinav http://bishtabhinav.wordpress.com/

  • How do I create Equal Height Columns with my Background Images?

    Hi there,
    here is my page http://www.allthingsprintuk.co.uk/ATPHome.html
    My problem is that the side bar HTML list is coming off the page in IE. & also the html  in the header can look awful due to browser settings.
    My question is how do I create Equal Height Columns with my Background Images so that they fit with the HTML text? Is there a good link you can point me to, or a tutorial?
    The only way I can see by doing it is slicing my images up into 3 (top middle & bottom) & then setting the middle to repeat y????
    Or does anyone know of a way to create rounded corners WITH drop shadows in CSS that will work on all browsers?
    Thanks in advance
    Louisa

    Try these http://www.pixelan.com/

  • How to create index on XMLType column extension?

    I have an XMLType column named "info" whose corresponding global element has a complexType "InfoType" in namespace "http://example.org/ord". The "InfoType" complexType is extended in two namespaces, "http://example.org/info/zipcode" and "http://example.org/info/street". How do I create a unique index using an "InfoType" element contributed from one of the extension namespaces?
    I have included below a SQL script that completely describes the problem.
    Thanks in advance for your assistance?
    - Ron
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    'chapter04prod.xsd',
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://example.org/prod"
    targetNamespace="http://example.org/prod"
    elementFormDefault="unqualified">
    <xsd:complexType name="ItemsType">
    <xsd:sequence>
    <xsd:element name="product" type="ProductType"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ProductType">
    <xsd:sequence>
    <xsd:element name="number" type="xsd:integer"/>
    <xsd:element name="name" type="xsd:string"/>
    <xsd:element name="size" type="SizeType"/>
    <xsd:element name="color" type="ColorType"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="SizeType">
    <xsd:simpleContent>
    <xsd:extension base="xsd:integer">
    <xsd:attribute name="system" type="xsd:string"/>
    </xsd:extension>
    </xsd:simpleContent>
    </xsd:complexType>
    <xsd:complexType name="ColorType">
    <xsd:attribute name="value" type="xsd:string"/>
    </xsd:complexType>
    </xsd:schema>',
    TRUE,
    TRUE,
    FALSE,
    FALSE);
    END;
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    'chapter04ord1.xsd',
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://example.org/ord"
    xmlns="http://example.org/ord"
    xmlns:prod="http://example.org/prod"
    elementFormDefault="qualified">
    <xsd:import namespace="http://example.org/prod"
    schemaLocation="chapter04prod.xsd"/>
    <xsd:simpleType name="OrderNumType">
    <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:complexType name="InfoType"/>
    <xsd:complexType name="CustomerType">
    <xsd:all>
    <xsd:element name="name" type="CustNameType"/>
    <xsd:element name="number" type="xsd:integer"/>
    <xsd:element name="info" type="InfoType" form="unqualified"/>
    </xsd:all>
    </xsd:complexType>
    <xsd:simpleType name="CustNameType">
    <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:element name="order" type="OrderType"/>
    <xsd:element name="customer" type="CustomerType"/>
    <xsd:complexType name="OrderType">
    <xsd:sequence>
    <xsd:element name="number" type="OrderNumType"/>
    <xsd:element name="customer" type="CustomerType"
    maxOccurs="unbounded"/>
    <xsd:element name="items" type="prod:ItemsType"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>',
    TRUE,
    TRUE,
    FALSE,
    FALSE);
    END;
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    'chapter04infozipcode.xsd',
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ord="http://example.org/ord"
    xmlns="http://example.org/info/zipcode"
    targetNamespace="http://example.org/info/zipcode"
    elementFormDefault="unqualified">
    <xsd:import namespace="http://example.org/ord"
    schemaLocation="chapter04ord1.xsd"/>
    <xsd:complexType name="InfoType">
    <xsd:complexContent>
    <xsd:extension base="ord:InfoType">
    <xsd:sequence>
    <xsd:element name="zipcode" type="xsd:string"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:schema>',
    TRUE,
    TRUE,
    FALSE,
    FALSE);
    END;
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    'chapter04infostreet.xsd',
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ord="http://example.org/ord"
    xmlns="http://example.org/info/street"
    targetNamespace="http://example.org/info/street"
    elementFormDefault="unqualified">
    <xsd:import namespace="http://example.org/ord"
    schemaLocation="chapter04ord1.xsd"/>
    <xsd:complexType name="InfoType">
    <xsd:complexContent>
    <xsd:extension base="ord:InfoType">
    <xsd:sequence>
    <xsd:element name="street" type="xsd:string"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:schema>',
    TRUE,
    TRUE,
    FALSE,
    FALSE);
    END;
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    'chapter04nonamespace.xsd',
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ord="http://example.org/ord">
    <xsd:import namespace="http://example.org/ord"
    schemaLocation="chapter04ord1.xsd"/>
    <xsd:element name="info" type="ord:InfoType">
    </xsd:schema>',
    TRUE,
    TRUE,
    FALSE,
    FALSE);
    END;
    CREATE TABLE customer (
    name VARCHAR(64),
    number INTEGER,
    info XMLTYPE)
    XMLType info STORE AS OBJECT RELATIONAL
    XMLSCHEMA "chapter04nonamespace.xsd"
    ELEMENT "info";
    INSERT INTO customer (name, number, info)
    VALUES ('George Jones', 1,
    XMLType(
    '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:street="http://example.org/info/zipcode"
    xsi:type="zipcode:InfoType">
    <zipcode>28877</zipcode>
    </info>');
    INSERT INTO customer (name, number, info)
    VALUES ('Jim Jones', 2,
    XMLType(
    '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:street="http://example.org/info/street"
    xsi:type="street:InfoType">
    <street>3456 Autumn Lane</street>
    </info>');
    SELECT name,
    extractValue(info, '/info/street')
    FROM customer
    WHERE extractValue(info, '/info/street/text()') LIKE '3456%';
    -- How does one create a unique index as follows?
    CREATE UNIQUE INDEX customer_infostreet ON customer (??????);
    -- The following insert should fail with unique index violation!
    INSERT INTO customer (name, number, info)
    VALUES ('Jerry Jones', 3,
    XMLType(
    '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:street="http://example.org/info/street"
    xsi:type="street:InfoType">
    <street>3456 Autumn Lane</street>
    </info>');

    Ron
    Glad you found a solution.. However a more efficient solution is show below
    SQL> connect sys/ as sysdba
    Enter password:
    Connected.
    SQL> set define on
    SQL> --
    SQL> define USERNAME = OTNTEST
    SQL> --
    SQL> def PASSWORD = OTNTEST
    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 OTNTEST cascade
    User dropped.
    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 OTNTEST identified by OTNTEST
    Grant succeeded.
    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 OTNTEST
    Grant succeeded.
    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 OTNTEST
    Grant succeeded.
    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 OTNTEST default tablespace USERS temporary tablespace TEMP
    User altered.
    SQL> connect &USERNAME/&PASSWORD
    Connected.
    SQL> --
    SQL> alter session set events ='19027 trace name context forever, level 0x800'
      2  /
    Session altered.
    SQL> BEGIN
      2  DBMS_XMLSCHEMA.registerSchema(
      3  'chapter04prod.xsd',
      4  '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://example.org/prod" targetNamespa
    fault="unqualified">
      5     <xsd:complexType name="ItemsType">
      6             <xsd:sequence>
      7                     <xsd:element name="product" type="ProductType"/>
      8             </xsd:sequence>
      9     </xsd:complexType>
    10     <xsd:complexType name="ProductType">
    11             <xsd:sequence>
    12                     <xsd:element name="num" type="xsd:integer"/>
    13                     <xsd:element name="name" type="xsd:string"/>
    14                     <xsd:element name="size" type="SizeType"/>
    15                     <xsd:element name="color" type="ColorType"/>
    16             </xsd:sequence>
    17     </xsd:complexType>
    18     <xsd:complexType name="SizeType">
    19             <xsd:simpleContent>
    20                     <xsd:extension base="xsd:integer">
    21                             <xsd:attribute name="system" type="xsd:string"/>
    22                     </xsd:extension>
    23             </xsd:simpleContent>
    24     </xsd:complexType>
    25     <xsd:complexType name="ColorType">
    26             <xsd:attribute name="value" type="xsd:string"/>
    27     </xsd:complexType>
    28  </xsd:schema>',
    29  TRUE, TRUE, FALSE, FALSE);
    30  END;
    31  /
    PL/SQL procedure successfully completed.
    SQL> BEGIN
      2  DBMS_XMLSCHEMA.registerSchema(
      3  'chapter04ord1.xsd',
      4  '<xsd:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns
    ://example.org/prod" targetNamespace="http://example.org/ord" elementFormDefault="qualified">
      5     <xsd:import namespace="http://example.org/prod" schemaLocation="chapter04prod.xsd"/>
      6     <xsd:simpleType name="OrderNumType">
      7             <xsd:restriction base="xsd:string"/>
      8     </xsd:simpleType>
      9     <xsd:complexType name="InfoType" xdb:SQLType="INFO_TYPE_T"/>
    10     <xsd:complexType name="CustomerType">
    11             <xsd:all>
    12                     <xsd:element name="name" type="CustNameType"/>
    13                     <xsd:element name="num" type="xsd:integer"/>
    14                     <xsd:element name="info" type="InfoType" minOccurs="1" form="unqualified"/>
    15             </xsd:all>
    16     </xsd:complexType>
    17     <xsd:simpleType name="CustNameType">
    18             <xsd:restriction base="xsd:string"/>
    19     </xsd:simpleType>
    20     <xsd:element name="customers" type="CustomersType"/>
    21     <xsd:complexType name="CustomersType">
    22             <xsd:sequence>
    23                     <xsd:element name="customer" type="CustomerType" minOccurs="0" maxOccurs="unbounded"
    24             </xsd:sequence>
    25     </xsd:complexType>
    26     <xsd:element name="order" type="OrderType"/>
    27     <xsd:element name="customer" type="CustomerType"/>
    28     <xsd:complexType name="OrderType">
    29             <xsd:sequence>
    30                     <xsd:element name="num" type="OrderNumType"/>
    31                     <xsd:element name="customer" type="CustomerType" maxOccurs="unbounded"/>
    32                     <xsd:element name="items" type="prod:ItemsType"/>
    33             </xsd:sequence>
    34     </xsd:complexType>
    35  </xsd:schema>',
    36  TRUE, TRUE, FALSE, FALSE);
    37  END;
    38  /
    PL/SQL procedure successfully completed.
    SQL> BEGIN
      2  DBMS_XMLSCHEMA.registerSchema(
      3  'chapter04infozipcode.xsd',
      4  '<xsd:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns
    //example.org/info/zipcode" targetNamespace="http://example.org/info/zipcode" elementFormDefault="unqualifie
      5     <xsd:import namespace="http://example.org/ord" schemaLocation="chapter04ord1.xsd"/>
      6     <xsd:complexType name="InfoType" xdb:SQLType="ZIPCODE_INFO_TYPE_T">
      7             <xsd:complexContent>
      8                     <xsd:extension base="ord:InfoType">
      9                             <xsd:sequence>
    10                                     <xsd:element name="zipcode" type="xsd:string"/>
    11                                     <xsd:element name="suffix" type="xsd:string"/>
    12                             </xsd:sequence>
    13                     </xsd:extension>
    14             </xsd:complexContent>
    15     </xsd:complexType>
    16  </xsd:schema>',
    17  TRUE, TRUE, FALSE, FALSE);
    18  END;
    19  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> BEGIN
      2  DBMS_XMLSCHEMA.registerSchema(
      3  'chapter04infostreet.xsd',
      4  '<xsd:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns
    //example.org/info/street" targetNamespace="http://example.org/info/street" elementFormDefault="unqualified"
      5     <xsd:import namespace="http://example.org/ord" schemaLocation="chapter04ord1.xsd"/>
      6     <xsd:complexType name="InfoType" xdb:SQLType="STREET_INFO_TYPE_T">
      7             <xsd:complexContent>
      8                     <xsd:extension base="ord:InfoType">
      9                             <xsd:sequence>
    10                                     <xsd:element name="street" type="xsd:string"/>
    11                                     <xsd:element name="suffix" type="xsd:string"/>
    12                             </xsd:sequence>
    13                     </xsd:extension>
    14             </xsd:complexContent>
    15     </xsd:complexType>
    16  </xsd:schema>',
    17  TRUE, TRUE, FALSE, FALSE);
    18  END;
    19  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> BEGIN
      2  DBMS_XMLSCHEMA.registerSchema(
      3  'chapter04nonamespace.xsd',
      4  '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ord="http://example.org/ord">
      5     <xsd:import namespace="http://example.org/ord" schemaLocation="chapter04ord1.xsd"/>
      6     <xsd:element name="info" type="ord:InfoType"/>
      7  </xsd:schema>',
      8  TRUE, TRUE, FALSE, FALSE);
      9  END;
    10  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> CREATE TABLE customer (
      2  name VARCHAR(64),
      3  num INTEGER,
      4  info XMLTYPE)
      5  XMLType info STORE AS OBJECT RELATIONAL
      6  XMLSCHEMA "chapter04nonamespace.xsd"
      7  ELEMENT "info";
    Table created.
    SQL>
    SQL> INSERT INTO customer (name, num, info)
      2  VALUES ('George Jones', 1,
      3  XMLType(
      4  '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zipcode="http://example.org/info/zip
      5     <zipcode>28877</zipcode>
      6     <suffix>s1</suffix>
      7  </info>'));
    1 row created.
    SQL>
    SQL> INSERT INTO customer (name, num, info)
      2  VALUES ('Jim Jones', 2,
      3  XMLType(
      4  '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:street="http://example.org/info/stre
      5     <street>3456 Autumn Lane</street>
      6     <suffix>s2</suffix>
      7  </info>'));
    1 row created.
    SQL> /
    1 row created.
    SQL> SELECT name,
      2         extractValue(info, '/info/zipcode'),
      3         extractValue(info, '/info/street')
      4    FROM customer
      5  WHERE extractValue(info, '/info/zipcode/text()') LIKE '2%'
      6     OR extractValue(info, '/info/street/text()') LIKE '3456%';
    NAME
    EXTRACTVALUE(INFO,'/INFO/ZIPCODE')
    EXTRACTVALUE(INFO,'/INFO/STREET')
    George Jones
    28877
    Jim Jones
    3456 Autumn Lane
    NAME
    EXTRACTVALUE(INFO,'/INFO/ZIPCODE')
    EXTRACTVALUE(INFO,'/INFO/STREET')
    Jim Jones
    3456 Autumn Lane
    SQL>
    SQL> CREATE UNIQUE INDEX customer_infozipcode ON customer(
      2  extractValue
      3  (
      4    info,
      5    '/info[@xsi:type="zipcode:InfoType"]/zipcode',
      6    'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      7    xmlns:zipcode="http://example.org/info/zipcode"'
      8  ))
      9  /
    Index created.
    SQL> select column_name
      2    from user_ind_columns
      3   where INDEX_NAME = 'CUSTOMER_INFOZIPCODE'
      4  /
    COLUMN_NAME
    SYS_NC00014$
    SQL> select INDEX_NAME,COLUMN_EXPRESSION
      2    from user_ind_expressions
      3  /
    INDEX_NAME
    COLUMN_EXPRESSION
    CUSTOMER_INFOZIPCODE
    EXTRACTVALUE(SYS_MAKEXML('0341F05603124922B4F6F94DC5E30C2F',4870,"SYS_NC00004$",
    SQL> DROP INDEX CUSTOMER_INFOZIPCODE
      2  /
    Index dropped.
    SQL> desc INFO_TYPE_T
    INFO_TYPE_T is NOT FINAL
    Name                                      Null?    Type
    SYS_XDBPD$                                         XDB.XDB$RAW_LIST_T
    SQL> --
    SQL> desc ZIPCODE_INFO_TYPE_T
    ZIPCODE_INFO_TYPE_T extends OTNTEST.INFO_TYPE_T
    ZIPCODE_INFO_TYPE_T is NOT FINAL
    Name                                      Null?    Type
    SYS_XDBPD$                                         XDB.XDB$RAW_LIST_T
    zipcode                                            VARCHAR2(4000 CHAR)
    suffix                                             VARCHAR2(4000 CHAR)
    SQL> --
    SQL> desc STREET_INFO_TYPE_T
    STREET_INFO_TYPE_T extends OTNTEST.INFO_TYPE_T
    STREET_INFO_TYPE_T is NOT FINAL
    Name                                      Null?    Type
    SYS_XDBPD$                                         XDB.XDB$RAW_LIST_T
    street                                             VARCHAR2(4000 CHAR)
    suffix                                             VARCHAR2(4000 CHAR)
    SQL> --
    SQL> CREATE UNIQUE INDEX customer_infozipcode ON customer(TREAT(INFO.XMLDATA AS ZIPCODE_INFO_TYPE_T)."zipcod
      2  /
    Index created.
    SQL> select column_name
      2    from user_ind_columns
      3   where INDEX_NAME = 'CUSTOMER_INFOZIPCODE'
      4  /
    COLUMN_NAME
    TREAT("SYS_NC00007$" AS "ZIPCODE_INFO_TYPE_T")."zipcode"
    SQL> select INDEX_NAME,COLUMN_EXPRESSION
      2    from user_ind_expressions
      3  /
    no rows selected
    SQL> INSERT INTO customer (name, num, info)
      2  VALUES ('Jerry Jones', 3,
      3  XMLType(
      4  '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zipcode="http://example.org/info/zip
      5     <zipcode>28877</zipcode>
      6     <suffix>s1</suffix>
      7  </info>'))
      8  /
    INSERT INTO customer (name, num, info)
    ERROR at line 1:
    ORA-00001: unique constraint (OTNTEST.CUSTOMER_INFOZIPCODE) violated
    SQL> INSERT INTO customer (name, num, info)
      2  VALUES ('Jerry Jones', 3,
      3  XMLType(
      4  '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:street="http://example.org/info/stre
      5     <street>3456 Autumn Lane</street>
      6     <suffix>s3</suffix>
      7  </info>'))
      8  /
    1 row created.
    SQL>In you solution a functional index was created. In my case, by breaking the XML abstraction, and using object-relational SQL to create the index (DDL statements are the one case where I feel this is acceptable) I was able to create a pure B-TREE index which has the same effect..

  • How to set value to dimension1,2,3 column in AP Invoice?

    Dear All,
    I have a problem when creating AP Invoice using SAP B1 2005 B DI/API. The problem is when i can not find dimension1, dimension2, and dimension3 properties in oDraft.Lines. (oDraft is my variable for object  oPurchaseInvoices).
    How to set value to dimension1,2,3 column in AP Invoice using DI/API ?
    Regards,
    Herfin J.

    Hi! Yatsea,
    I am working with 2007B, In the order reference of B1WS, I found only CostingCode and COGSCostingCode provided:
    OrdersService.DocumentDocumentLine.CostingCode() As String
    OrdersService.DocumentDocumentLine.COGSCostingCode() As String
    Where are the rest 4 dimensions for both of them?
    Plus, I also got the XML from DI server, with only one CostingCode exposed.
    Thanks
    Constantine

  • How can I create an effect to cycle through several sets of 12 thumbnail images rather than just one

    Hello
    I've searched everywhere i can think of and had no luck so thought it's about time i asked for help.
    How do I create an effect where a group of 12 thumbnail images (all with clickable links) can scroll across by clicking a button to reveal another set of 12 thumbnails and so on without having to refresh the page, im assuming jquery can help but every single slideshow or scroll effect I've come across is for single images and not a set of images.
    Its a gallery part of my website and the images are in sets of 4 in 3 rows.
    All and any help will be greatly apprieciated!
    Anthony

    I think what you want is a Carousel Scroller.  See Demo and Examples
    http://dimsemenov.com/plugins/touchcarousel/
    Nancy O.

Maybe you are looking for