Sitemap Sitemap  |  Contact Us Contact Us  |  Clients Clients
   HareScript's SQL Concepts
  Home |  Downloads |  HareScript |  Websites/CMS |  Applications
Search for:  in: 
HareScript
Databases
 
Introduction

Introduction

next Next page

The HareScript language is the core language of the WebHare Application Portal, and is used to implement the graphical web interface and to build many other components in this system. It is a fourth-generation scripting language that integrates support for SQL statements directly into an imperative language.

This article contains some HareScript code snippets to illustrate the approaches taken by the language. Although the code will look very familiar if you've already seen SQL before, there is one important difference with respect to column renaming and selecting expressions into columns. The usual syntax in SQL for this is to use '<expression> AS <columnname>' inside a SELECT. Although HareScript does support this syntax, most HareScript code uses a different syntax: '<columnname> := <expression>'. We feel that this syntax improves readability, especially when a lot of columns are renamed.

As an example, the following HareScript SQL code:

SELECT files.id
, files.description AS filedescription
, (files.title = "" ? files.name : files.title) AS filetitle
FROM files;

Is functionally equivalent to:

SELECT id
, filedescription := files.description
, filetitle := files.title = "" ? files.name : files.title
FROM files;

As mentioned, HareScript accepts both syntaxes, and neither of the possible syntaxes is faster or more efficient than the other. Our preferred syntax only serves to improve readability - the AS syntax is provided for compatibility with SQL.


Sections in this chapter

    HareScript and SQL
    Database abstraction
    Reselections and multiple data sources
    Null values
    Non-SQL databases
    Summary
next Next page
 
In section 'Introduction'
HareScript and SQL
Using HareScript expressions inside a select
Using HareScript functions to build select results
Database abstraction
Reselections and multiple data sources
Null values
Non-SQL databases
Summary
 
Top To top of page