Home > Contents > Index >
CATALOGMANAGER.replacerow
Replaces an existing row in a table on a remote server by first deleting it, and then inserting the specified information into the row using the
CATALOGMANAGER
command.Syntax
<CATALOGMANAGER>
<ARGUMENT NAME="ftcmd" VALUE="replacerow" /> <ARGUMENT NAME="tablename" VALUE="table" /> [<ARGUMENT NAME="columnname" VALUE="column name"/>] [<ARGUMENT NAME="urlcolumnname_folder" VALUE="folder name"/>] [<ARGUMENT NAME="columnname_file" VALUE="file name"/>] [<ARGUMENT NAME="tablekey" VALUE="column name"/>] [<ARGUMENT NAME="tablekeyvalue" VALUE="some value"/>]</CATALOGMANAGER>Parameters
ftcmd
(required)- Value must be set to
replacerow
.
tablename (required)
- Name of the table that contains the row to replace.
primarykey (optional)
- Value of row's primary key. The
primarykey
parameter is the primary key's column name.
columnname (optional)
- Each column in the row to be replaced.
columnname
is a table column name.
urlcolumnname_folder (optional)
- A 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. Note that 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)
- The name of the file you want to upload. The column name in the table must begin with
url
(for example,urltext
). The argument name must have_file
appended to the table's column name (for example,urltext_file
).
tablekey (optional)
- Use the
tablekey
parameter if you want to update rows based on a value other than the primary key. The value oftablekey
is the column name of the column you use to perform the update. For example, if you want to update a table based on the value in thetitle
column, thetablekey
parameter looks as follows:
inList.setValString("tablekey", "title")tablekeyvalue (optional)
- Value in the
tablekey
column of the row you want to update. For example, if you want to update a row with a value ofJaws
in thetitle
column, thetablekeyvalue
parameter looks as follows:
inList.setValString("tablekeyvalue", "Jaws")- This parameter is required only if the
tablekey
parameter is used.
Description
The
replacerow
command replaces an existing row in a table on a remote server by first deleting it, and then inserting the specified information into the row. This command should be used to clear the value of a column in a row.
Note
If the row specified by the
primarykey
value does not exist, then the row is added to the table.errno
The possible values of
errno
include:
Value Description -103 No such table. -104 No table definition. -105 Database error.Example
The following example replaces the existing row information for
titanic
with information forThe Great Escape.
133
modern times
g
see it137
the general
g
see it145
a perfect world
pg
see it148
the princess bride
pg
see it138
titanic
pg 13
miss it<SETVAR NAME="errno" VALUE="0" /> <CATALOGMANAGER SCOPED="GLOBAL"> <ARGUMENT NAME="ftcmd" VALUE="replacerow" /> <ARGUMENT NAME="tablename" VALUE="moviereviews" /> <ARGUMENT NAME="id" VALUE="138" /> <ARGUMENT NAME="title" VALUE="The Great Escape" /> <ARGUMENT NAME="rating" VALUE="PG" /> <ARGUMENT NAME="comments" VALUE="see it" /> </CATALOGMANAGER> <IF COND="IsError.Variables.errno=true"> <THEN> <!--Handle error--> </THEN> </IF>After the row has been replaced, the table looks as follows:
133
modern times
g
see it137
the general
g
see it145
a perfect world
pg
see it148
the princess bride
pg
see it138
The Great Escape
PG
see itSee Also
Home > Contents > Index > ![]()
FatWire XML Tag Reference
Copyright 2005 by FatWire Software
All rights reserved.