Performs a SQL statement on an ODBC data source.
numero = 212[SQL dsn=Pubs&statement=SELECT * from Authors]Found [numfound] items[founditems][au_lname], [au_fname], [title][/founditems][/SQL]Whenever WebDNA encounters a [SQL] context, it uses ODBC to attempt to make a connection to the DSN you specify. It then executes the SQL statement and retrieves the results, if any. For SQL SELECT statements, you almost always put a [founditems]...[/founditems] context inside the [SQL] context so you can display the information from the matching records.
you can substitute any [xxx] tags in the SQL parameters, as in [SQL dsn=Pubs&statement=SELECT * from Authors where au_lname > '[form.name]'].
UNIX users can get infomation on how to setup WebDNA with ODBC
Parameter | Description |
---|---|
dsn | Name of the database you wish to search. |
username | Username required to access this ODBC database (Optional for Window platform, if none specified, "sa" is used). |
password | Password required to access this ODBC database (Optional for Window platform, if none is specified, a blank password is used). |
statement | Any legal SQL statement. |
max | A number indicating how many records should be displayed at once before showing a list of "Show Items xx-yy" hyperlinks. |
Tag | Description |
---|---|
[NumFound] | A number indicating how many records matched the search request. Some ODBC drivers do not support this feature, so WebDNA compensates by visiting every record in the database in order to count them. For large datasets, this can be very slow, and you should consider writing a SQL statement that performs a count instead. Do not put [NumFound] inside a SQL context that INSERTS new records, because the statement will be executed twice in order to perform the count. This will cause invalid a second record to be added to your database. |
[founditems]...[/founditems] | Normally you put a [founditems] loop inside a [SQL] context that has performed a SELECT statement, so you can display all the matching records. You can put any database field names inside the [founditems] loop to display them in HTML. |
[SQL dsn=Pubs&statement=SELECT * from Authors]
Found [numfound] items
[founditems]
[au_lname], [au_fname], [title]
[/founditems]
[/SQL]
you can substitute any [xxx] tags in the SQL parameters, as in [SQL dsn=Pubs&statement=SELECT * from Authors where au_lname > '[form.name]'].
UNIX users can get infomation on how to setup WebDNA with ODBC
Parameter | Description |
---|---|
dsn | Name of the database you wish to search. |
username | Username required to access this ODBC database (Optional for Window platform, if none specified, "sa" is used). |
password | Password required to access this ODBC database (Optional for Window platform, if none is specified, a blank password is used). |
statement | Any legal SQL statement. |
max | A number indicating how many records should be displayed at once before showing a list of "Show Items xx-yy" hyperlinks. |
Tag | Description |
---|---|
[NumFound] | A number indicating how many records matched the search request. Some ODBC drivers do not support this feature, so WebDNA compensates by visiting every record in the database in order to count them. For large datasets, this can be very slow, and you should consider writing a SQL statement that performs a count instead. Do not put [NumFound] inside a SQL context that INSERTS new records, because the statement will be executed twice in order to perform the count. This will cause invalid a second record to be added to your database. |
[founditems]...[/founditems] | Normally you put a [founditems] loop inside a [SQL] context that has performed a SELECT statement, so you can display all the matching records. You can put any database field names inside the [founditems] loop to display them in HTML. |
DOWNLOAD WEBDNA NOW!
WebDNA applications...
WebDNA ModulesA list of the currently available modules...
Technical Change HistoryThis Technical Change History provides a reverse chronological list of WebDNA changes...
F.A.QA compilation of some user's questions...
[biotype]BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...
WebDNA LibrariesA list of available libraries for WebDNA...
[CLOSEDATABASE db=FileName]...
[showif][showif Comparison]Show This HTML[/showif]...
[getchars]Extracts a portion of the text (also known as substring or Mid$)...
[switch]Executes the WebDNA inside the only [case] context which matches the given value...
[include]Include the contents of the specified file...
[listvariables]Lists all the text and/or math variables which have been set earlier on a page...