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

Script Library

  Table information
 
  chubbard posted this script:
  Here are three functions that do a quick and dirty report for you
The first function will tell you the date that each table in your web was last modified
The second function will simply display the names of all of the tables
The third function will display all of the fields in all of the tables

webcall function lastModified (){
response.write(web.name + "<br><br>");
var tableRS = "";

var arr = web.tables.getObjects();

response.write("<table border=1 bordercolor=silver>");
response.write("<tr><td bgcolor='silver'>Table Name</td><td bgcolor='silver'>Last Modified</td></tr>");

for (var i=0; i<arr.length; i++){
  response.write("<tr><td>" + arr[i].name + "</td><td>");
  tableRS = table.select(arr[i].name, "Modified", "*", "-Modified");
  if(tableRS.next()){
    response.write(tableRS.modified.format("view date/time") );
  }
  response.write("</td></tr>");
}
response.write("</table>");
}

webcall Function tableList(){
response.write(web.name + "<br><br>");
var arr = web.tables.getObjects();
for (var i=0; i<arr.length; i++){
  response.write(arr[i].name + "<br>");
}
}

webcall function tableschema(){
response.write("<br>" + web.name + "<br><br>");

var arr = web.tables.getObjects();
for (var i=0; i<arr.length; i++){
  response.write("<b>" + arr[i].name + "</b><br>");
  for(var field in arr[i].fields){
    response.write("&nbsp;&nbsp;&nbsp;" + field + "<br>");
  }

}
}
 
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
DataWeb, 720 North 10th Street, A #145, Renton, Washington 98057 *425-583-5970* Fax 484-770-4706* Email Us