Home > Contents > Index >
CATALOGMANAGER.createtable
Creates a table using the
CATALOGMANAGER
command.Syntax
<CATALOGMANAGER> <ARGUMENT NAME="ftcmd" VALUE="createtable" /> <ARGUMENT NAME="tablename" VALUE="table" /> <ARGUMENT NAME="systable" VALUE="no/obj"/> <ARGUMENT NAME="uploadDir" VALUE="directory" /> <ARGUMENT NAME="colnameN" VALUE="name" /> <ARGUMENT NAME="colvalueN" VALUE="value"/> </CATALOGMANAGER>Parameters
ftcmd (required)
- Value must be set to
createtable
.
tablename (required)
- Name of the table to create.
systable (required)
- Allows differentiation between ContentCatalog (
systable=no
) and ObjectCatalog (systable=obj
). This defaults to ContentCatalog (systable=no
).
uploadDir (required)
- Server-side folder path to contain uploaded files.
aclList (optional)
- Comma-separated list of ACLs. When security is enabled, only members of the ACLs can access content in the table.
colvalueN
(required)- Database-specific field type for column.The value of
N
is 0 (zero) for the first column, 1 for the second column, and so on.
colnameN
(required)- Column field name. Each colname parameter corresponds to a column in the table. The value of
N
is 0 (zero) for the first column, 1 for the second column, and so on.
Description
The
createtable
command creates a table. The table's primary key field name is defined in the Sites properties file (futuretense.ini
).
Note
The default primary key used by CatalogManager is defined in the property
cc.contentkey
. Unlike a custom property for primary keys, thecc.contentkey
property does not restrict the name of the tables that you create. The Object table column, version, is reserved for future use.Error Numbers
The possible values of
errno
include:
Value Description -22 Table already exists. -105 Database error.Example
The following example uses the
cc.contentkey
property when creating a new table calledExampleTable
:<SETVAR NAME="errno" VALUE="0" /> <CATALOGMANAGER> <ARGUMENT NAME="ftcmd" VALUE="createtable" /> <ARGUMENT NAME="tablename" VALUE="ExampleTable" /> <ARGUMENT NAME="systable" VALUE="no" /> <ARGUMENT NAME="uploadDir" VALUE="/export/home/public" /> <ARGUMENT NAME="colname0" VALUE="CS.Property.cc.contentkey"/> <ARGUMENT NAME="colvalue0" VALUE="varchar(10) PRIMARY KEY NOT NULL" /> <ARGUMENT NAME="colname1" VALUE="description" /> <ARGUMENT NAME="colvalue1" VALUE="varchar(24)" /> <ARGUMENT NAME="colname2" VALUE="quantity" /> <ARGUMENT NAME="colvalue2" VALUE="CS.Property.cc.integer"/> </CATALOGMANAGER>To specify the primary key in the properties file (
futuretense.ini
file), you must use the following syntax:tablenameKey
Note
The K in Key must be capitalized; for example:
cc.TestKey = testname
The tablename must also be named
Test
, otherwise the table name is not created.The following example shows a custom primary key using
cc.TestKey
:<SETVAR NAME="makekey" VALUE="CS.Property.CC.Primary"/> <SETVAR NAME="keytype" VALUE="CS.Property.CC.bigint"/> <SETVAR NAME="errno" VALUE="0" /> <CATALOGMANAGER> <ARGUMENT NAME="ftcmd" VALUE="createtable" /> <ARGUMENT NAME="tablename" VALUE="Test" /> <ARGUMENT NAME="uploadDir" VALUE="CS.Property.ft.home" /> <ARGUMENT NAME="colname0" VALUE="CS.Property.cc.TestKey" /> <ARGUMENT NAME="colvalue0" VALUE="Variables.keytype Variables.makekey" /> <ARGUMENT NAME="colname1" VALUE="fruit" /> <ARGUMENT NAME="colvalue1" VALUE="CS.Property.cc.varchar(55)" /> <ARGUMENT NAME="colname2" VALUE="quantity" /> <ARGUMENT NAME="colvalue2" VALUE="CS.Property.cc.smallinit" /> </CATALOGMANAGER> <SETVAR NAME="table1" VALUE="errno:Variables.errno" /> error creating table <CSVAR NAME="Variables.table1" /> <BR/> The following example creates the table named moviereviews. <SETVAR NAME="errno" VALUE="0" /> <CATALOGMANAGER> <ARGUMENT NAME="ftcmd" VALUE="createtable" /> <ARGUMENT NAME="tablename" VALUE="moviereviews" /> <ARGUMENT NAME="systable" VALUE="no" /> <ARGUMENT NAME="uploadDir" VALUE="c:moviereviews" /> <ARGUMENT NAME="aclList" VALUE="Browser" /> <ARGUMENT NAME="colname0" VALUE="Reviewer" /> <ARGUMENT NAME="colvalue0" VALUE="varchar(40)" /> <ARGUMENT NAME="colname1" VALUE="urlreview" /> <ARGUMENT NAME="colvalue1" VALUE="varchar(255) NULL"/> </CATALOGMANAGER> <IF COND="IsError.Variables.errno=true"> <THEN>The following example creates the table named
moviereviews
.<SETVAR NAME="errno" VALUE="0" /> <CATALOGMANAGER> <ARGUMENT NAME="ftcmd" VALUE="createtable" /> <ARGUMENT NAME="tablename" VALUE="moviereviews" /> <ARGUMENT NAME="systable" VALUE="no" /> <ARGUMENT NAME="uploadDir" VALUE="c:moviereviews" /> <ARGUMENT NAME="aclList" VALUE="Browser" /> <ARGUMENT NAME="colname0" VALUE="Reviewer" /> <ARGUMENT NAME="colvalue0" VALUE="varchar(40)" /> <ARGUMENT NAME="colname1" VALUE="urlreview" /> <ARGUMENT NAME="colvalue1" VALUE="varchar(255) NULL"/> </CATALOGMANAGER> <IF COND="IsError.Variables.errno=true"> <THEN> < ... > < ... >See Also
The following
CATALOGMANAGER
command:
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.