User Tools

Site Tools


api:dk11:delphi:gissqlquery.tgis_sqlquery

TGIS_SqlQuery class

DK11 for Delphi | GisSqlQuery.TGIS_SqlQuery | Classes | Constructors | Methods | Properties

Calculates a logical value of WHERE-like statements for non SQL-based tables.

Available also on: .NET | Java.

Syntax

// Delphi
type
  TGIS_SqlQuery = class( TGIS_Object )
  end;
// C++ Builder
class PASCALIMPLEMENTATION TGIS_SqlQuery : public TGIS_Object
{
};

Inheritance

→ TObject → TGIS_Object

Constructors

Inherited Overrides Protected
Name Visibility Description
Create public Create parser.

Methods

Inherited Overrides Protected
Name Visibility Description
BindSqlQueryCallBack public A callback to be executed form TGIS_LayerVector upon binding layer to the SQL query object (connecting field access methods)
Parse(TGIS_SqlQueryFieldFun; TGIS_SqlQueryBindFun; TGIS_SqlQueryFieldBindFun; TObject; Integer) public Parse each record.
Parse(TObject; Integer) public Parse each record.
ParseAsBoolean(TGIS_SqlQueryFieldFun; TGIS_SqlQueryBindFun; TGIS_SqlQueryFieldBindFun; TObject; Boolean; Integer) public Parse each record and cast result as boolean.
ParseAsBoolean(TObject; Boolean; Integer) public Parse each record and cast result as boolean.
ParseAsFloat(TGIS_SqlQueryFieldFun; TGIS_SqlQueryBindFun; TGIS_SqlQueryFieldBindFun; TObject; Double; Integer) public Parse each record and cast result as float.
ParseAsFloat(TObject; Double; Integer) public Parse each record and cast result as float.
Prepare public Calling once per scope.
RePrepare public RePrepare precompiled a query.

Properties

Inherited Protected
Name Visibility Description
Query public Current query text.

Remarks

Supported operators are:

  • AND
  • OR
  • NOT
  • =
  • <>
  • <
  • >
  • >=
  • +
  • -
  • *
  • /
  • %
  • BETWEEN..AND
  • IN
  • IS NULL
  • IS NOT NULL

Supported math functions are:

  • ABS()
  • ASIN()
  • ACOS()
  • ATAN()
  • CEIL()
  • COS()
  • DEGREES()
  • EXP()
  • FLOOR()
  • LN()
  • LOG()
  • LOG10()
  • PI()
  • POWER()
  • RADIANS()
  • ROUND()
  • SIN()
  • SQRT()
  • TAN()
  • TRUNC()

Supported string functions are:

  • LENGTH()
  • UPPER()
  • LOWER()
  • STRPOS()
  • SUBSTR()
  • LEFT()
  • RIGHT()
  • TRIM()

To guarantee query compatibility across different SQL servers Date should be encoded using predefined functions:

  • $date(year[,month][,date])
  • $time(hour[,minutes][,seconds][,miliseconds])
  • $datetime(year[,month][,date][,hour][,minutes][,seconds][,miliseconds])
  • $today
  • $now

2019/04/26 15:18