Home > Contents > Index >
CATALOGMANAGER.updaterow2
Updates or clears values in columns for a row in a table using the
CATALOGMANAGER
command.
Note
errno
is not set. No error is generated if the value for a particular column is invalid (for example, enter a text character into an integer type field). Valid column edits succeed, invalid column edits do not. We recommend that you check your input carefully.Syntax
<CATALOGMANAGER>
<ARGUMENT NAME="ftcmd" VALUE="updaterow2" /> <ARGUMENT NAME="tablename" VALUE="table" /> [<ARGUMENT NAME="primarykey "VALUE="primary key value"/>] [<ARGUMENT NAME="columnname" VALUE="columnname"/>] [<ARGUMENT NAME="urlcolumnname_folder" VALUE="folder name"/>] [<ARGUMENT NAME="columnname_file" VALUE="file name"/>] [<ARGUMENT NAME="tablekey" VALUE="key value"/>] [<ARGUMENT NAME="tablekeyvalue" VALUE="some value"/>] [<ARGUMENT NAME="updaterowNullColumns" VALUE="column1, column2"/>]</CATALOGMANAGER>Parameters
ftcmd (required)
- Value must be set to
updaterow2
.
tablename (required)
- Name of the table containing the row to be updated.
primarykey (optional)
- Value of row's primary key. The
primarykey
parameter name is the primary key's column name.
columnname
(optional)- Each column in the row to be modified.
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.
updaterowNullColumns (optional)
- A comma-separated list of columns that are to be 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
updaterow
,updaterow2
updates values in columns for a row in a table; however, in contrast toupdaterow
, which does not allow you to clear columns,
updaterow2
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, or if the field on the form was left blank).Error Numbers
The possible values of
errno
include:
Value Description -103 No such table. -104 No table definition. -105 Database error.Example
This example uses a form to update the description and rating fields in the
movies
table for a given movie.<SETVAR NAME="errno" VALUE="0" /> <CATALOGMANAGER SCOPED="GLOBAL"> <ARGUMENT NAME="ftcmd" VALUE="updaterow2" /> <ARGUMENT NAME="tablename" VALUE="movies" /> <ARGUMENT NAME="id" VALUE="1234" /> <ARGUMENT NAME="title" VALUE="Godzilla" /> <ARGUMENT NAME="comments" VALUE="see it" /> </CATALOGMANAGER> <IF COND="Variables.errno=0"> <THEN> Update successful. </THEN> <ELSE> <CSVAR NAME="Update failed. See errno Variables.errno for more information."/> </ELSE> </IF>See Also
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.