Search these areas:
Help
Support Forums
Product Info



Introduction
DataWeb: What's New
Creating an Application
The DataWeb Designer
Application Management
Data Tables
Data Tables
Views
Templates
Components
Data Analysis
Members
Security
Importing
Exporting
FTP
JavaScript
Object Model
JavaScript Objects
General Scripting Objects
Data Access Objects
-cmdDelete Object
-cmdInsert Object
-cmdSelect Object
execute
getColumns
getFilter
getSort
getTablename
setColumns
setFilter
setSort
-cmdUpdate Object
-Data Access Method Arguments
-Field Object
-Fields Collection
-Index Object
-Indexes Collection
-previous Object
-record Object
-Resultset Object
-Table Object
-Tables Collection
-TextImporter Object
-Settings Object
-View Object
-Web Object
File Access Objects
Http Client Objects
Security and Membership Objects
Document Object Model (DOM)
Error Descriptions
Object Model Extensions
Full-Text Search
Domain and Email Hosting
HotBlock Modules
Account Management
Glossary
New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

DataWeb User's Guide

cmdSelect Object
By using the cmdSelect object and its associated methods you can read records from a data table. You can also read selectively from a data table by specifying filter, column and sort parameters.

Constructor

[new] cmdSelect (tablename) Constructs and returns a new cmdSelect object instance. The tablename string argument designates the name of the table from which records are to be selected. The tablename argument must appear within quotes.

Instance Methods

execute Reads from the specified data table, according to the cmdSelect object's filter, columns, and sort settings. Returns a Resultset object.
getColumns Returns the cmdSelect object's columns list, as set by the setColumns() method.
getFilter Returns the cmdSelect object's filter, as set by the setFilter() method.
getSort Returns the cmdSelect object's sort list, as set by the setSort() method.
getTablename Returns the name of the table specified by the cmdSelect constructor.
setColumns Specifies the column list for the cmdSelect object.
setFilter Sets the filter for the cmdSelect object.
setSort Specifies the sort order for the cmdSelect object.

Example

The following example reads from the AddressBook data table and returns records where the LastName field has the value "Smith". For more information about this example, see the Resultset object and the next() method

    //Creates a new cmdSelect object and identifies the
    //data table to be selected from.
  var sel = new cmdSelect("AddressBook");

    //Restricts the cmdSelect to only those records
    //where the LastName field has the value "Smith".
  sel.setFilter({LastName:"Smith"});

    //Actually selects records from the AddressBook 
    //data table and assigns the returned ResultSet 
    //object to the variable "rs".
  var rs = sel.execute();

    //Prints the values for the FirstName and LastName 
    //fields for each record in the ResultSet "rs".
  while(rs.next())
      {
      response.write(rs.FirstName + " " + rs.LastName + "<br>");
      }

var sel = new cmdSelect("AddressBook");
sel.setFilter({LastName:"Smith"});
sel.setColumns("FirstName, LastName, Email");
var rs = sel.execute();
while(rs.next())
{
   response.write(rs.LastName + "<br />");
}
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
Email Us