Home > Contents > Index >
Template Tags TOC   |    Alpha TOC   |    Tag Family TOC   |    Purpose TOC   |    Annotated TOC   |    Index 

 


ics:catalogmanager.updaterows2

Modifies field values or clears columns for multiple rows in a table using ics:catalogmanager.

Syntax

Parameters

ftcmd (required)
Value must be set to updaterows2.

tablename (required)
Name of the table containing rows to be updated.

columnnameN (optional)
Each column in the row to be replaced. columnname is a table column name. The value of N corresponds to the row number in the resultset that you want to update.
Must contain at least one argument with primarykey column being the columnname.

urlcolumnname_folderN (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 with url (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_fileN (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).

tablekeyN (optional)
Use the tablekeyN parameter if you want to update rows based on a value other than the primary key. The value of tablekeyN is the column name of the column you use to perform the update. The value of N corresponds to the row number in the resultset that you want to update.
tablekeyvalueN (optional)
Value in the tablekey columm of the row you want to update. The value of N corresponds to the row number in the resultset that you want to update.
This parameter is required only if the tablekey parameter is used.

updaterowNullColumns (optional)
Comma-separated list of columns that are cleared if no data is supplied when the user submits a form. Note that if this list is supplied, other columns are ignored and are not cleared.

Description

Like updaterows, the updaterow2 command modifies field values for multiple rows in a table; however, in contrast to updaterows, which does not allow you to clear columns, updaterows2 allows you to clear columns if there is no value for the specified column (for example, if there is no related field in the form). For url fields, updaterows2 deletes the file associated with the url field and modifies the url field to point to the newly uploaded file.

errno

The possible values of errno include:

Value
Description
-103
No such table.
-104
No table definition.
-105
Database error.

Example

The following example empties quantity column and updates description column.

Original data

id description quantity
100 Apple 100
102 Orange 300

<ics:catalogmanager>
    <ics:argument name="ftcmd" value="updaterows2"/>
    <ics:argument name="tablename" value="ExampleTable"/>
    <ics:argument name="id0" value="100"/>
    <ics:argument name="description0" value="Apples"/>
    <ics:argument name="id1" value="101"/>
    <ics:argument name="description1" value="Oranges"/>
</ics:catalogmanager>

Changed data

id description quantity
100 Apples  
102 Oranges  

See Also

The following ics:catalogmanager commands:

ics:catalogmanager.addrows

ics:catalogmanager.replacerows

ics:catalogmanager.updaterows

ics.catalogmanager.updaterow2

  Home > Contents > Index >

FatWire JSP Tag Reference
Copyright 2005,2006,2007 by FatWire Software
All rights reserved.