wwBusinessObject::createtable

Create the primary table for this object. This method should always be subclassed and implemented by the developer.

Tip: You can use the CRT_DBF utility in the Tools directory to generate database and index structures for you.

o.createtable(lcFileName)

Parameters

lcFileName
Optional - Name of the file to create. By default the table the business object is bound to is created.

Example

* ** Sample Implementation
LPARAMETERS lcfilename

IF EMPTY(lcFileName)
   lcFileName = THIS.cDataPath + THIS.cFileName
ENDIF   

DIMENSION lxFields[ 28,4]
lxFields[  1,1]='PK'
lxFields[  1,2]='I'
lxFields[  1,3]=  4
lxFields[  1,4]=  0
lxFields[  2,1]='STOREPK'
lxFields[  2,2]='I'
lxFields[  2,3]=  4
lxFields[  2,4]=  0
lxFields[  3,1]='SKU'
lxFields[  3,2]='C'
lxFields[  3,3]= 15
lxFields[  3,4]=  0
lxFields[  4,1]='DESCRIPT'
lxFields[  4,2]='C'
lxFields[  4,3]= 50
lxFields[  4,4]=  0
lxFields[  5,1]='LDESCRIPT'
lxFields[  5,2]='M'
lxFields[  5,3]=  4
lxFields[  5,4]=  0
lxFields[  6,1]='PRICE'
lxFields[  6,2]='N'
lxFields[  6,3]= 10
lxFields[  6,4]=  2
lxFields[  7,1]='SPECIAL'
lxFields[  7,2]='N'
lxFields[  7,3]= 10
lxFields[  7,4]=  2
lxFields[  8,1]='STOCK'
lxFields[  8,2]='N'
lxFields[  8,3]= 10
lxFields[  8,4]=  2
lxFields[  9,1]='WEIGHT'
lxFields[  9,2]='N'
lxFields[  9,3]= 10
lxFields[  9,4]=  2
lxFields[ 10,1]='ONORDER'
lxFields[ 10,2]='N'
lxFields[ 10,3]= 10
lxFields[ 10,4]=  2
lxFields[ 11,1]='PHYSICAL'
lxFields[ 11,2]='L'
lxFields[ 11,3]=  1
lxFields[ 11,4]=  0
lxFields[ 12,1]='EXPECTED'
lxFields[ 12,2]='D'
lxFields[ 12,3]=  8
lxFields[ 12,4]=  0
lxFields[ 13,1]='COST'
lxFields[ 13,2]='N'
lxFields[ 13,3]= 10
lxFields[ 13,4]=  2
lxFields[ 14,1]='MFR'
lxFields[ 14,2]='C'
lxFields[ 14,3]= 30
lxFields[ 14,4]=  0
lxFields[ 15,1]='URL'
lxFields[ 15,2]='M'
lxFields[ 15,3]=  4
lxFields[ 15,4]=  0
lxFields[ 16,1]='REGTEXT'
lxFields[ 16,2]='M'
lxFields[ 16,3]=  4
lxFields[ 16,4]=  0
lxFields[ 17,1]='SAVEMAIL'
lxFields[ 17,2]='M'
lxFields[ 17,3]=  4
lxFields[ 17,4]=  0
lxFields[ 18,1]='EMAILTO'
lxFields[ 18,2]='M'
lxFields[ 18,3]=  4
lxFields[ 18,4]=  0
lxFields[ 19,1]='KEYWORDS'
lxFields[ 19,2]='M'
lxFields[ 19,3]=  4
lxFields[ 19,4]=  0
lxFields[ 20,1]='CATEGORIES'
lxFields[ 20,2]='M'
lxFields[ 20,3]=  4
lxFields[ 20,4]=  0
lxFields[ 21,1]='COLORS'
lxFields[ 21,2]='M'
lxFields[ 21,3]=  4
lxFields[ 21,4]=  0
lxFields[ 22,1]='SIZES'
lxFields[ 22,2]='M'
lxFields[ 22,3]=  4
lxFields[ 22,4]=  0
lxFields[ 23,1]='LIST1'
lxFields[ 23,2]='M'
lxFields[ 23,3]=  4
lxFields[ 23,4]=  0
lxFields[ 24,1]='LIST2'
lxFields[ 24,2]='M'
lxFields[ 24,3]=  4
lxFields[ 24,4]=  0
lxFields[ 25,1]='IMAGE'
lxFields[ 25,2]='M'
lxFields[ 25,3]=  4
lxFields[ 25,4]=  0
lxFields[ 26,1]='SORTORDER'
lxFields[ 26,2]='N'
lxFields[ 26,3]=  2
lxFields[ 26,4]=  0
lxFields[ 27,1]='NOWEB'
lxFields[ 27,2]='L'
lxFields[ 27,3]=  1
lxFields[ 27,4]=  0
lxFields[ 28,1]='XML'
lxFields[ 28,2]='M'
lxFields[ 28,3]=  4
lxFields[ 28,4]=  0

CREATE TABLE (lcFileName) FROM ARRAY lxFields

USE

See also:

Class wwBusinessObject

© West Wind Technologies, 1996-2019 • Updated: 02/17/19
Comment or report problem with topic