Replaces each found record in a database with the new field values.
numero = 210To replace records in an ODBC-compliant table controlled by a SQL server, use the [SQL] context.
You can specifiy a WebDNA table, in place of a db file, in the Replace context. For example: [replace table=TableName&...]values[/replace]
To replace records in a database, put a [replace] context into a template. Whenever WebDNA encounters a Replace, it immediately searches for the specified records in the database, and replaces those records' fields with the named field values inside the Replace.Example:[replace db=somebase.db&eqNAMEdata=Grant]name=John&address=1492 Street&zip=9000&date=[date][/replace]The database "somebase.db" opens and all records whose name field is "Grant" are found. The field names "name" is set to "John," "address" is set to "1492 Street" "zip" is set to "9000," and "date" is set to the current date. Notice that any WebDNA [xxx] tags inside the context are first substituted for their real values before being written to the database. The name of the database itself may also be an [xxx] tag, as in "[Replace db=[formvariable]]".Any field names not existing in the database are ignored, and if you leave some existing field names out of the replace context, they will remain unchanged in the database. Certain letters are illegal, such as TAB or CARRIAGE RETURN, so they are converted to SOFT TAB and SOFT RETURN before being added to the database. Some computers use the two-character sequence CARRIAGE RETURN - LINE FEED to indicate a single end of line, which is automatically converted to a single SOFT RETURN character before being added to the database. These 'soft' characters are automatically converted back to 'hard' versions (the originals) whenever you retrieve fields from a search of the database.You may specify an absolute or relative path to the database file, as in "/WebCatalog/GeneralStore/somebase.db" or "../somebase.db".
Normally all database filepaths are relative to the local template, or if they begin with "/" they are relative to the web server's virtual host root (MacOS and Unix versions only; PC versions treat the DBServer.exe folder as root regardless of the virtual host). You may optionally put "^" in front of the file path to indicate the file can be found in a global root folder called "Globals" inside the WebCatalogEngine folder. This global root folder is the same regardless of the virtual host.
Parameter | Description |
---|---|
db | path to database file, relative to this template. |
table | In place of a db file, you can specify a named reference to a WebDNA table object. |
SearchParameters | Search information describing which records should be found and replaced. Can be any complex search criteria, works exactly like [search] context. |
Append | (Optional) "T" if you want a new record to be added to the end of the database in the case where no records were found to be replaced. Any fields you do not specify are left blank in the new record. |
autonumber | (Optional) Instructs WebDNA to automatically generate the 'next highest number' value for the given fieldname. |
[table name=table_1&fields=ID,NAME,EMAIL][/table][append table=table_1&AUTONUMBER=ID]NAME=Scott&EMAIL=scott@here.com[/append][append table=table_1&AUTONUMBER=ID]NAME=Lee&EMAIL=lee@there.com[/append][append table=table_1&AUTONUMBER=ID]NAME=OMNI&EMAIL=omni@everywhere.com[/append][delete table=table_1&eqIDdata=2][append table=table_1&AUTONUMBER=ID]NAME=Lee&EMAIL=lee@there.com[/append][search table=table_1&neIDdata=[blank]][founditems][ID] - [NAME] - [EMAIL][/founditems][/search]Results:1 - Scott - scott@here.com3 - OMNI - omni@everywhere.com4 - Lee - lee@there.comYou can see that WebDNA automatically generated the ID value by calculating the 'next largest value', given the existing ID values in the table.
You can use [thisautonumber] tag from within an [append] or [replace] context, to retrieve the current auto-generated number (if the AUTONUMBER parameter was used).
[replace Parameters]new values[/replace]To replace records in an ODBC-compliant table controlled by a SQL server, use the [SQL] context.
You can specifiy a WebDNA table, in place of a db file, in the Replace context. For example: [replace table=TableName&...]values[/replace]
[replace db=somebase.db&eqNAMEdata=Grant]name=John&address=1492 Street&zip=9000&date=[date][/replace]
Normally all database filepaths are relative to the local template, or if they begin with "/" they are relative to the web server's virtual host root (MacOS and Unix versions only; PC versions treat the DBServer.exe folder as root regardless of the virtual host). You may optionally put "^" in front of the file path to indicate the file can be found in a global root folder called "Globals" inside the WebCatalogEngine folder. This global root folder is the same regardless of the virtual host.
Parameter | Description |
---|---|
db | path to database file, relative to this template. |
table | In place of a db file, you can specify a named reference to a WebDNA table object. |
SearchParameters | Search information describing which records should be found and replaced. Can be any complex search criteria, works exactly like [search] context. |
Append | (Optional) "T" if you want a new record to be added to the end of the database in the case where no records were found to be replaced. Any fields you do not specify are left blank in the new record. |
autonumber | (Optional) Instructs WebDNA to automatically generate the 'next highest number' value for the given fieldname. |
[table name=table_1&fields=ID,NAME,EMAIL][/table]
[append table=table_1&AUTONUMBER=ID]NAME=Scott&EMAIL=scott@here.com[/append]
[append table=table_1&AUTONUMBER=ID]NAME=Lee&EMAIL=lee@there.com[/append]
[append table=table_1&AUTONUMBER=ID]NAME=OMNI&EMAIL=omni@everywhere.com[/append]
[delete table=table_1&eqIDdata=2]
[append table=table_1&AUTONUMBER=ID]NAME=Lee&EMAIL=lee@there.com[/append]
[search table=table_1&neIDdata=[blank]]
[founditems]
[ID] - [NAME] - [EMAIL]
[/founditems]
[/search]
You can use [thisautonumber] tag from within an [append] or [replace] context, to retrieve the current auto-generated number (if the AUTONUMBER parameter was used).
DOWNLOAD WEBDNA NOW!
BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...
AWS Raw WebDNA LAMP-Plus WebServerAmazon Web Services (AWS) README for Machine Image ID...
Download WebDNA ApplicationsWebDNA applications...
WebDNA LibrariesA list of available libraries for WebDNA...
Tips and TricksA list of user-submitted tips ...
Technical Change HistoryThis Technical Change History provides a reverse chronological list of WebDNA changes...
...
[!]Hides text...
[table][table] allows you to quickly create a temporary 'in line' database that is local to the template and not part of the global database cache...
[findstring][FindString Source=...
ODBCUNIX: Setting up WebDNA - ODBC - Database Server...
[listmimeheaders]Lists all the MIME header names and values sent from the remote browser...