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
cmdUpdate Object
Data Access Method Arguments
-Columns Argument
-DoScripts Argument
-Filter Argument
-Fields Argument
-RowId Argument
-Sort Argument
-Tablename Argument
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

Columns Argument
The columns argument indicates which columns in the specified table should be retrieved by the specified method. The columns argument may be a comma-delimited string, an array, or an array literal containing column names from the specified table. The strings "*" and "" indicate that all columns should be retrieved.

In the case of a table that contains lookup fields, fields from the linked table may be returned by including columns with the syntax LookupColumn:ForeignColumn, where LookupColumn is the name of the lookup column in the current table and ForeignColumn is the name of a column in table linked by the lookup column.

1.  Using an array object:
var cols = new Array("foo",
  "bar", "lookupColumn:foreignColumn");
var rs = new Resultset("MyTable", cols, "*");
return rs["lookupColumn:foreignColumn"];
2.  Using an array literal:
var rs = new Resultset("MyTable",["foo", "bar",
  "lookupColumn:foreignColumn"], "*");
return rs.foo;
3.  Using a comma-delimited string:
var rs = new Resultset("MyTable",
  "foo,bar,lookupColumn:foreignColumn","*");
return rs.bar;
SQL expressions may be included in the string. In the following example, a SQL expression is used to output links to those records where the RowID is less than 10.
var rs = table.select("AddressBook", "calcField = 
   CASE 
    WHEN RowID <= 10 
      THEN '<a href=/AddressBook/default.view?RowID=' 
      + String(RowID) + '>' + String(RowID) +  '</a>' 
     ELSE 
       '' 
   END", "*");
while (rs.next())
    {
    response.write(rs.calcField, "<br>");
    }
Also aggregation functions may be included in the columns argument. The following example retrieves the maximum value of the UnitPrice field.
var rs = new Resultset("Products", 
  "MaxPrice = Max(UnitPrice)", "*");
if(rs.next())
   response.write(rs.MaxPrice);
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
Email Us