Lists all the fields in the specified database, SQLResult record set, or SQL table
numero = 203[listdatabases]Fields in database [name]:To display a list of all fields in an SQL table (after a [SQLConnect] context), specify the SQL connection and database table.Example :The "inventory" table has the following fields:
[listfields db=[name]]Fieldname: [fieldname]
[/listfields]<hr>[/listdatabases]
[listfields conn_ref=conn1&table=inventory][fieldname]<br><li>ordinal: [ordinal]</li><li>datatype: [datatype]</li><li>allownull: [allownull]</li><li>width: [width]</li><br>[/listfields]To display a list of all fields in a [SQLresult] record set, just include the [listfields] inside of a [SQLresult] context.Example:
[SQLresult result_ref=rs1]The result set from query "select * from employees;" has [numfields] fields:The following tags are available inside a [listfields] context:
[listfields][fieldname]<br><li>ordinal: [ordinal]</li><li>datatype: [datatype]</li><li>allownull: [allownull]</li><li>width: [width]</li><br>[/listfields]
[/SQLresult]
| Tag | Description |
|---|---|
[FieldName] | the name of the field. |
| [index] | A number from 1 to the total number of fields, indicating this field's index placement in the list. |
| The following tags are available when using [listfields] to list SQL fields | |
| [ordinal] | Will retrieve the literal position of the current iterated field. |
| [datatype] | Will retrieve the named SQL datatype of the current iterated field. |
| [allownull] | Returns whether or not (T or F) the current iterated field will accept a null value as a possible entry/value. |
| [width] | Will retrieve the maximum length of data the current iterated field will allow. |
[listdatabases]
Fields in database [name]:
[listfields db=[name]]
Fieldname: [fieldname]
[/listfields]
<hr>
[/listdatabases]
[listfields conn_ref=conn1&table=inventory]
[fieldname]<br>
<li>ordinal: [ordinal]</li>
<li>datatype: [datatype]</li>
<li>allownull: [allownull]</li>
<li>width: [width]</li>
<br>
[/listfields]
[SQLresult result_ref=rs1]
The result set from query "select * from employees;" has [numfields] fields:
[listfields]
[fieldname]<br>
<li>ordinal: [ordinal]</li>
<li>datatype: [datatype]</li>
<li>allownull: [allownull]</li>
<li>width: [width]</li>
<br>
[/listfields]
[/SQLresult]
| Tag | Description |
|---|---|
[FieldName] | the name of the field. |
| [index] | A number from 1 to the total number of fields, indicating this field's index placement in the list. |
| The following tags are available when using [listfields] to list SQL fields | |
| [ordinal] | Will retrieve the literal position of the current iterated field. |
| [datatype] | Will retrieve the named SQL datatype of the current iterated field. |
| [allownull] | Returns whether or not (T or F) the current iterated field will accept a null value as a possible entry/value. |
| [width] | Will retrieve the maximum length of data the current iterated field will allow. |
DOWNLOAD WEBDNA NOW!
A list of available libraries for WebDNA...
AWS Raw WebDNA LAMP-Plus WebServerAmazon Web Services (AWS) README for Machine Image ID...
[biotype]BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...
WebDNA ModulesA list of the currently available modules...
F.A.QA compilation of some user's questions...
Tips and TricksA list of user-submitted tips ...
A powerful feature to connect to a TCP port of another computer on the Internet...
[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...
[array]Array Operation...
[listdatabases]Lists all the currently-open databases...
[removehtml]Removes HTML or WebDNA tags from a string of text...
[commitdatabase][COMMITDATABASE db=name...