Technical References - [listfields]

Lists all the fields in the specified database, SQLResult record set, or SQL table

numero = 203
interpreted = N
texte = [listfields Params]Database Tags[/listfields] To display a list of all the fields in a particular database, put a [listfields] context into a template. You may put a [listfields] context inside the [listdatabases] context to automatically list all the fields in all the databases. Example :
[listdatabases]Fields in database [name]:
[listfields db=[name]] Fieldname: [fieldname]
[/listfields] <hr> [/listdatabases]
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 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:
[listfields] [fieldname]<br> <li>ordinal: [ordinal]</li> <li>datatype: [datatype]</li> <li>allownull: [allownull]</li> <li>width: [width]</li> <br> [/listfields]
[/SQLresult]
 The following tags are available inside a [listfields] context:
TagDescription
[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.
[listfields Params]Database Tags[/listfields]

To display a list of all the fields in a particular database, put a [listfields] context into a template. You may put a [listfields] context inside the [listdatabases] context to automatically list all the fields in all the databases.

Example :

[listdatabases]
Fields in database [name]:

[listfields db=[name]]
Fieldname: [fieldname]

[/listfields]
<hr>
[/listdatabases]


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 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:

[listfields]
[fieldname]<br>
<li>ordinal: [ordinal]</li>
<li>datatype: [datatype]</li>
<li>allownull: [allownull]</li>
<li>width: [width]</li>
<br>
[/listfields]


[/SQLresult]


The following tags are available inside a [listfields] context:

TagDescription
[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!

Top Articles:

WebDNA Modules

A list of the currently available modules...

AWS Raw WebDNA LAMP-Plus WebServer

Amazon Web Services (AWS) README for Machine Image ID...

Download WebDNA Applications

WebDNA applications...

Technical Change History

This Technical Change History provides a reverse chronological list of WebDNA changes...

WebDNA Libraries

A list of available libraries for WebDNA...

F.A.Q

A compilation of some user's questions...

Related Readings:

[boldwords]

Highlights matching words with boldface HTML tags...

[fileinfo]

Displays information about a particular file or folder...

[thisurl]

[thisurl] displays the URL of the current page...

[purchase]

...

Implement BioType

Here is the JavaScript code that captures the keystroke dynamics of a demo user and how to make WebDNA analyze it...

[replacefounditems]

Replaces each found record in a database with the new field values...