Tutorials > Program model > Extend the object model and modifying an existing task command

< Previous | Next >


Create and populating the XORDGIFT table

In this step, you create the XORDGIFT table that will hold the gift message information. This table contains the following six columns: ORDERSID, RECEIPTNAME, SENDERNAME, MSGFIELD1, MSGFIELD2, and OPTCOUNTER. ORDERSID is the primary key and the foreign key that references the ORDERS_ID field of the ORDERS table. This foreign key associates the gift message to its corresponding order.

Create the table:


Procedure

  1. Start the test environment.

  2. Create the XORDGIFT table:

    1. Open a browser and type the following URL: http://localhost/webapp/wcs/admin/servlet/db.jsp.

    2. In the input box, enter the following SQL statements:

      • create table XORDGIFT (ORDERSID bigint not null, RECEIPTNAME varchar(50), SENDERNAME varchar (50), MSGFIELD1 varchar(50), MSGFIELD2 varchar(50), OPTCOUNTER smallint not null default 0, constraint p_xordgift primary key (ORDERSID), constraint f_xordgift foreign key (ORDERSID) references ORDERS(ORDERS_ID) on delete cascade); 
        
        insert into XORDGIFT (ORDERSID) (select ORDERS_ID from ORDERS);
        

      • create table XORDGIFT (ORDERSID number not null, RECEIPTNAME varchar(50), SENDERNAME varchar (50), MSGFIELD1 varchar(50), MSGFIELD2 varchar(50), OPTCOUNTER smallint default 0 not null, constraint p_xordgift primary key (ORDERSID), constraint f_xordgift foreign key (ORDERSID) references ORDERS(ORDERS_ID) on delete cascade); 
        
        insert into XORDGIFT (ORDERSID) (select ORDERS_ID from ORDERS);
        

    3. Click Submit Query to run the SQL statements.

< Previous | Next >


+

Search Tips   |   Advanced Search