Home > Contents > Index >
Template Tags TOC | Alpha TOC | Tag Family TOC | Purpose TOC | Annotated TOC | Index
ics:catalogmanager.addrow
Adds a row to a table using
ics:catalogmanager
.Syntax
<ics:catalogmanager>
<ics:argument name="ftcmd" value="addrow"/> <ics:argument name="tablename" value="table"/> [<ics:argument name="urlcolumnname_folder" value="folder name"/>] [<ics:argument name="columnname_file" value="file name"/>] [<ics:argument name="columnname" value="some column name/>]</ics:catalogmanager>Parameters
ftcmd (required)
- Value must be set to
addrow
.
tablename (required)
- Name of the table where you plan to add a row.
urlcolumnname_folder (optional)
- Subfolder name to store the uploaded file. The file is then stored under the upload folder and the subfolder. The upload folder is specified in the SystemInfo table's
defdir
column. You can have multiple upload columns.
- Upload columns are designated by the prefix
url
. The column name in the table must begin withurl
(for example,urltext
). The argument name must include the table's column name with_folder
appended to the column name (for example,urltext_folder
).
columnname_file (required for non-binary files)
- Name of the file you want to upload. The column name in the table must begin with
url
(for example,urltext
). The agrument name must have_file
appended to the table's column name (for example,urltext_file
).
columnname (optional)
- Value of each column in the row to be added. The
columnname
is a table column name.
Description
The
addrow
command adds a row to a table.
Note
When adding a row to a table of type
obj
(an object table), the system createsVariables.newid
, which contains the system-assigned unique ID for the new record.Error Numbers
The possible values of
errno
include:
Value Description -103 No such table. -104 No table definition. -105 Database error.Example
The following example adds a new row to the table named
Movies.
<ics:catalogmanager><ics:argument name="ftcmd" value="addrow"/> <ics:argument name="tablename" value="Movies"/> <ics:argument name="Reviewer" value="John Doe"/></ics:catalogmanager>The next example uses a table called CatalogExample. The default upload column is /export/home/temp. The table has the following columns:
The form uses the CatalogManager command. The row is added to the table when the user clicks the addrow button and the file, AddrowExample.txt is added to the /export/home/temp/CatalogForm/.
- id (table’s primary key)
- urlText
- description
- quantity
<FORM NAME="f1" ACTION="CatalogManager" METHOD="post"><INPUT TYPE="hidden" NAME="tablename" VALUE="CatalogExample"/> KEY: <INPUT TYPE="text" NAME="id" VALUE="2"/> <BR/> URL: <INPUT TYPE="text" NAME="urlText" VALUE="this text will be put in a file called AddrowExample.txt"/> <BR/> DESC: <INPUT TYPE="text" NAME="description" VALUE="example record"/> <BR/> QUANTITY: <INPUT TYPE="text" NAME="quantity" VALUE="1"/> <BR/> FILE: <INPUT TYPE="text" NAME="urlText_file" VALUE="AddrowExample.txt"/><BR/> FOLDER: <INPUT TYPE="text" NAME="urlText_folder" VALUE="CatalogForm"/> <BR/> FTCMD: <INPUT TYPE="submit" NAME="ftcmd" VALUE="addrow"/> <BR/></FORM>The next example uses the same table, CatalogExample. This example is similar to the previous example, except that the user browses and selects a file to upload. In addition, the columnname_file parameter is not included in this example because the file is uploaded in binary mode.
<FORM NAME="f1" ENCTYPE="multipart/form-data" ACTION="CatalogManager" METHOD="post"><INPUT TYPE="hidden" NAME="tablename" VALUE="CatalogExample"/> KEY: <INPUT TYPE="text" NAME="id" VALUE="3"/> <BR/> DESC: <INPUT TYPE="text" NAME="description" VALUE="second record"/> <BR/> QUANTITY: <INPUT TYPE="text" NAME="quantity" VALUE="1"/> <BR/> FILE: <INPUT TYPE="file" NAME="urlText" VALUE=""/> <BR/> FOLDER: <INPUT TYPE="text" NAME="urlText_folder" VALUE="CatalogForm"/> <BR/> <INPUT TYPE="hidden" NAME="ftcmd" VALUE="addrow"/> <INPUT TYPE="submit" VALUE="Add"/></FORM>See Also
The following ics:catalogmanager commands:
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.