AxleBase

Database Manager Engine


home page

description

documentation

requirements

inquiries

policy letter


Relational Database Manager

Very Large Databases

Program Interface

SQL Driven

Embedded



Documentation

( Please scroll down. )

free system

change log

demonstrator

license

support



                




AxleBase Documentation








__________________________________________________

Table Of Contents
__________________________________________________

Copyright

System License Agreement

Chapter 1 . . . . . . . . Introduction

. . . . . . . . 1 . General
. . . . . . . . . . . . . . . . . . Description
. . . . . . . . . . . . . . . . . . Design Objectives
. . . . . . . . . . . . . . . . . . System Numbers
. . . . . . . . . . . . . . . . . . AxleBase Limits
. . . . . . . . . . . . . . . . . . Very Large
. . . . . . . . . . . . . . . . . . In Tribute
. . . . . . . . 2 . Unfinished Parts
. . . . . . . . . . . . . . . . . . Bug Policy
. . . . . . . . . . . . . . . . . . Working or Awaiting Start
. . . . . . . . . . . . . . . . . . Undecided
. . . . . . . . . . . . . . . . . . Intentional Abridgements
. . . . . . . . 3 . Installation
. . . . . . . . . . . . . . . . . . Development Environment
. . . . . . . . . . . . . . . . . . Production Environment
. . . . . . . . . . . . . . . . . . Upgrading
. . . . . . . . 4 . GUI Front End
. . . . . . . . 5 . Getting Started
. . . . . . . . 6 . Tests
. . . . . . . . . . . . . . . . . . Lab Test Environment
. . . . . . . . . . . . . . . . . . Public Discussion
. . . . . . . . . . . . . . . . . . Table Size
. . . . . . . . . . . . . . . . . . Concatenated Virtual Table
. . . . . . . . . . . . . . . . . . Embedding Test
. . . . . . . . . . . . . . . . . . Concurrency
. . . . . . . . . . . . . . . . . . Index Build Speed
. . . . . . . . . . . . . . . . . . Index Validity
. . . . . . . . . . . . . . . . . . SQL Insert Speed
. . . . . . . . . . . . . . . . . . Indexed Retrieval Speed
. . . . . . . . . . . . . . . . . . Table Joins


Chapter 2 . . . . . . . . Free Test And Demo Software

. . . . . . . . 1 . GUI Test Host
. . . . . . . . . . . . . . . . . . General
. . . . . . . . . . . . . . . . . . AxleBase Objects
. . . . . . . . . . . . . . . . . . Passing Commands
. . . . . . . . . . . . . . . . . . Returns
. . . . . . . . . . . . . . . . . . Help
. . . . . . . . . . . . . . . . . . Stored Connection Strings
. . . . . . . . . . . . . . . . . . Demonstration Databases
. . . . . . . . . . . . . . . . . . VLDB Expansion
. . . . . . . . . . . . . . . . . . System Tests
. . . . . . . . . . . . . . . . . . Continuous Cycling
. . . . . . . . . . . . . . . . . . Step By Step Operation
. . . . . . . . 2 . Database Server
. . . . . . . . . . . . . . . . . . Description
. . . . . . . . . . . . . . . . . . What It Is Not
. . . . . . . . . . . . . . . . . . Step By Step Start
. . . . . . . . . . . . . . . . . . SysLink Protocol


Chapter 3 . . . . . . . . Embedding And Running AxleBase

. . . . . . . . 1 . Designing and Coding
. . . . . . . . . . . . . . . . . . RAM Requirements
. . . . . . . . . . . . . . . . . . Data Connectivity
. . . . . . . . . . . . . . . . . . Indexing
. . . . . . . . . . . . . . . . . . Remote Access And Paths
. . . . . . . . . . . . . . . . . . Database & System Design
. . . . . . . . . . . . . . . . . . The Database Domain
. . . . . . . . . . . . . . . . . . Concurrent Operations
. . . . . . . . . . . . . . . . . . Coding Tips & Techniques
. . . . . . . . . . . . . . . . . . Important Coding Note
. . . . . . . . . . . . . . . . . . The AxleBase API
. . . . . . . . . . . . . . . . . . Manager Object
. . . . . . . . . . . . . . . . . . Data Vector Object
. . . . . . . . . . . . . . . . . . System Identifiers
. . . . . . . . . . . . . . . . . . Examples Visual Basic
. . . . . . . . . . . . . . . . . . Examples Microsoft Access
. . . . . . . . . . . . . . . . . . Examples WinBatch
. . . . . . . . 2 . Lock Design
. . . . . . . . . . . . . . . . . . General
. . . . . . . . . . . . . . . . . . AxleBase Lock Space Domains
. . . . . . . . . . . . . . . . . . Concurrency Locking
. . . . . . . . . . . . . . . . . . AxleBase Lock Granularity
. . . . . . . . . . . . . . . . . . Lock Types
. . . . . . . . 3 . Column-Data Types
. . . . . . . . . . . . . . . . . . General
. . . . . . . . . . . . . . . . . . Blob
. . . . . . . . . . . . . . . . . . Boolean
. . . . . . . . . . . . . . . . . . Date
. . . . . . . . . . . . . . . . . . Datetime
. . . . . . . . . . . . . . . . . . Datetimex
. . . . . . . . . . . . . . . . . . Integer
. . . . . . . . . . . . . . . . . . Numeric
. . . . . . . . . . . . . . . . . . Serial
. . . . . . . . . . . . . . . . . . String
. . . . . . . . . . . . . . . . . . Time
. . . . . . . . . . . . . . . . . . Timex
. . . . . . . . . . . . . . . . . . Mapping From Other Brands
. . . . . . . . 4 . AxleBase Error Protocol
. . . . . . . . . . . . . . . . . . General
. . . . . . . . . . . . . . . . . . Format Of The Return
. . . . . . . . . . . . . . . . . . Show Exceptions
. . . . . . . . 5 . Security
. . . . . . . . . . . . . . . . . . General
. . . . . . . . . . . . . . . . . . Security Toggle
. . . . . . . . . . . . . . . . . . Visibility Of Stops
. . . . . . . . . . . . . . . . . . Canonical Permeability
. . . . . . . . . . . . . . . . . . The Architecture's Impact
. . . . . . . . . . . . . . . . . . Passwords
. . . . . . . . . . . . . . . . . . Granting Access
. . . . . . . . . . . . . . . . . . Step-By-Step Turn On
. . . . . . . . 6 . Database Server Suggestions
. . . . . . . . . . . . . . . . . . General
. . . . . . . . . . . . . . . . . . The VLDB Server
. . . . . . . . . . . . . . . . . . Axsys Node Host
. . . . . . . . . . . . . . . . . . Error Handling
. . . . . . . . . . . . . . . . . . Security
. . . . . . . . . . . . . . . . . . ODBC And Native Connections
. . . . . . . . . . . . . . . . . . Concurrency Issues


Chapter 4 . . . . . . . A.P.I. Lexicon And Syntax Reference

. . . . . . . . 1 . Functions and Operators
. . . . . . . . . . . . . . . . . . Limitations
. . . . . . . . . . . . . . . . . . Commenting SQL Code
. . . . . . . . . . . . . . . . . . Conditional Select Operator
. . . . . . . . . . . . . . . . . . DateAdd
. . . . . . . . . . . . . . . . . . DateConvert
. . . . . . . . . . . . . . . . . . DateDiff
. . . . . . . . . . . . . . . . . . DateFromSerial
. . . . . . . . . . . . . . . . . . DateNow
. . . . . . . . . . . . . . . . . . DateToSerial
. . . . . . . . . . . . . . . . . . DeferReturn
. . . . . . . . . . . . . . . . . . In
. . . . . . . . . . . . . . . . . . IsDate
. . . . . . . . . . . . . . . . . . IsTime
. . . . . . . . . . . . . . . . . . Locate
. . . . . . . . . . . . . . . . . . Math Operators
. . . . . . . . . . . . . . . . . . Row Clause In SQL
. . . . . . . . . . . . . . . . . . Segment Clause In SQL
. . . . . . . . . . . . . . . . . . Select Summary Functions
. . . . . . . . . . . . . . . . . . String
. . . . . . . . . . . . . . . . . . Wildcard Characters

. . . . . . . . 2 . Manager Object Interface
. . . . . . . . . . . . . . . . . . General Comments
. . . . . . . . . . . . . . . . . . AbortJob
. . . . . . . . . . . . . . . . . . AlterAxsys
. . . . . . . . . . . . . . . . . . AlterAxsysRunningNode
. . . . . . . . . . . . . . . . . . AlterDatabaseAttribute
. . . . . . . . . . . . . . . . . . AlterDomainAttribute
. . . . . . . . . . . . . . . . . . AlterTable
. . . . . . . . . . . . . . . . . . AlterTableAttribute
. . . . . . . . . . . . . . . . . . Authenticate
. . . . . . . . . . . . . . . . . . Backup
. . . . . . . . . . . . . . . . . . ClearFailedQuery
. . . . . . . . . . . . . . . . . . ClearLastError
. . . . . . . . . . . . . . . . . . CloseDatabaseConnection
. . . . . . . . . . . . . . . . . . Connect
. . . . . . . . . . . . . . . . . . CreateDatabase
. . . . . . . . . . . . . . . . . . CreateIndex
. . . . . . . . . . . . . . . . . . CreateTable
. . . . . . . . . . . . . . . . . . CreateVirtualTable
. . . . . . . . . . . . . . . . . . Crypt
. . . . . . . . . . . . . . . . . . DataObjectCount
. . . . . . . . . . . . . . . . . . DataObjectCreate
. . . . . . . . . . . . . . . . . . DataObjectDestroy
. . . . . . . . . . . . . . . . . . DropDatabase
. . . . . . . . . . . . . . . . . . DropDomain
. . . . . . . . . . . . . . . . . . DropIndex
. . . . . . . . . . . . . . . . . . DropTable
. . . . . . . . . . . . . . . . . . ExecuteSQL
. . . . . . . . . . . . . . . . . . Grant
. . . . . . . . . . . . . . . . . . Locate
. . . . . . . . . . . . . . . . . . LockObject
. . . . . . . . . . . . . . . . . . NetworkScan
. . . . . . . . . . . . . . . . . . OpenDatabase
. . . . . . . . . . . . . . . . . . OpenDomain
. . . . . . . . . . . . . . . . . . Purge
. . . . . . . . . . . . . . . . . . ReloadNode
. . . . . . . . . . . . . . . . . . RestoreBackup
. . . . . . . . . . . . . . . . . . Revoke
. . . . . . . . . . . . . . . . . . ShareDatabase
. . . . . . . . . . . . . . . . . . ShareDomain
. . . . . . . . . . . . . . . . . . ShowAxsys
. . . . . . . . . . . . . . . . . . ShowAxsysNode
. . . . . . . . . . . . . . . . . . ShowCopyright
. . . . . . . . . . . . . . . . . . ShowDatabase
. . . . . . . . . . . . . . . . . . ShowDatabaseAttributes
. . . . . . . . . . . . . . . . . . ShowDatabaseCatalogue
. . . . . . . . . . . . . . . . . . ShowDbColumns
. . . . . . . . . . . . . . . . . . ShowDomainAttributes
. . . . . . . . . . . . . . . . . . ShowErrorList
. . . . . . . . . . . . . . . . . . ShowIndices
. . . . . . . . . . . . . . . . . . ShowInstanceAttributes
. . . . . . . . . . . . . . . . . . ShowInstanceID
. . . . . . . . . . . . . . . . . . ShowJobState
. . . . . . . . . . . . . . . . . . ShowLastError
. . . . . . . . . . . . . . . . . . ShowLicense
. . . . . . . . . . . . . . . . . . ShowLocks
. . . . . . . . . . . . . . . . . . ShowLog
. . . . . . . . . . . . . . . . . . ShowPermissions
. . . . . . . . . . . . . . . . . . ShowRelease
. . . . . . . . . . . . . . . . . . ShowReservedWordList
. . . . . . . . . . . . . . . . . . ShowReturnProtocol
. . . . . . . . . . . . . . . . . . ShowTable
. . . . . . . . . . . . . . . . . . ShowTableAttributes
. . . . . . . . . . . . . . . . . . ShowTableColumns
. . . . . . . . . . . . . . . . . . ShowTables
. . . . . . . . . . . . . . . . . . ShowTableSegments
. . . . . . . . . . . . . . . . . . ShowVersion
. . . . . . . . . . . . . . . . . . ShutDown
. . . . . . . . . . . . . . . . . . TableCheck
. . . . . . . . . . . . . . . . . . TruncateDatabaseLog
. . . . . . . . . . . . . . . . . . TruncateDomainLog
. . . . . . . . . . . . . . . . . . WriteMap

. . . . . . . . 3 . Data Vector Object Interface
. . . . . . . . . . . . . . . . . . General Comments
. . . . . . . . . . . . . . . . . . Table Name Precedence
. . . . . . . . . . . . . . . . . . ColumnContents
. . . . . . . . . . . . . . . . . . ColumnCount
. . . . . . . . . . . . . . . . . . ColumnName
. . . . . . . . . . . . . . . . . . ColumnStart
. . . . . . . . . . . . . . . . . . ColumnType
. . . . . . . . . . . . . . . . . . ColumnWidth
. . . . . . . . . . . . . . . . . . Connect
. . . . . . . . . . . . . . . . . . Connection
. . . . . . . . . . . . . . . . . . CurrentTupleIndex
. . . . . . . . . . . . . . . . . . ExecuteSQL
. . . . . . . . . . . . . . . . . . . . . . . . . Delete
. . . . . . . . . . . . . . . . . . . . . . . . . Insert
. . . . . . . . . . . . . . . . . . . . . . . . . Insert Array
. . . . . . . . . . . . . . . . . . . . . . . . . Select
. . . . . . . . . . . . . . . . . . . . . . . . . Select Into
. . . . . . . . . . . . . . . . . . . . . . . . . Test
. . . . . . . . . . . . . . . . . . . . . . . . . Truncate
. . . . . . . . . . . . . . . . . . . . . . . . . Update
. . . . . . . . . . . . . . . . . . Export
. . . . . . . . . . . . . . . . . . Import
. . . . . . . . . . . . . . . . . . InternalNameGet
. . . . . . . . . . . . . . . . . . InternalNameSet
. . . . . . . . . . . . . . . . . . Move
. . . . . . . . . . . . . . . . . . MoveFirst
. . . . . . . . . . . . . . . . . . MoveLast
. . . . . . . . . . . . . . . . . . MoveNext
. . . . . . . . . . . . . . . . . . MovePrior
. . . . . . . . . . . . . . . . . . ReturnDataSet
. . . . . . . . . . . . . . . . . . ReturnDataStream
. . . . . . . . . . . . . . . . . . ReturnDeferred
. . . . . . . . . . . . . . . . . . SetVectorColumnSeparator
. . . . . . . . . . . . . . . . . . SetVectorEncryption
. . . . . . . . . . . . . . . . . . SetVectorReturnProtocol
. . . . . . . . . . . . . . . . . . ShowAttributes
. . . . . . . . . . . . . . . . . . Tuple
. . . . . . . . . . . . . . . . . . TupleCount


Chapter 5 . . . . . . . . Configuration

. . . . . . . . 1 . Overview
. . . . . . . . 2 . Manual Edits Of Attributes

. . . . . . . . 3 . Configurable Attributes
. . . . . . . . . . . . . . . . . . Apostrophe Escape
. . . . . . . . . . . . . . . . . . Axsys Enabled
. . . . . . . . . . . . . . . . . . Buffer Size
. . . . . . . . . . . . . . . . . . Column Type
. . . . . . . . . . . . . . . . . . Connection Limit
. . . . . . . . . . . . . . . . . . Connection String
. . . . . . . . . . . . . . . . . . Default Database
. . . . . . . . . . . . . . . . . . Defer Returns
. . . . . . . . . . . . . . . . . . Description
. . . . . . . . . . . . . . . . . . Encrypt Return
. . . . . . . . . . . . . . . . . . Encryption Depth
. . . . . . . . . . . . . . . . . . Export Column Separator
. . . . . . . . . . . . . . . . . . Export Row Terminator
. . . . . . . . . . . . . . . . . . Fail Open Toggle
. . . . . . . . . . . . . . . . . . Force Index Evaluation
. . . . . . . . . . . . . . . . . . Hide Security Stops
. . . . . . . . . . . . . . . . . . Lock
. . . . . . . . . . . . . . . . . . Lock Timeout
. . . . . . . . . . . . . . . . . . Log
. . . . . . . . . . . . . . . . . . Log Auto-Truncate
. . . . . . . . . . . . . . . . . . Log Size Max
. . . . . . . . . . . . . . . . . . Make String
. . . . . . . . . . . . . . . . . . Name
. . . . . . . . . . . . . . . . . . Name Alias
. . . . . . . . . . . . . . . . . . Node Sleep
. . . . . . . . . . . . . . . . . . Null Token
. . . . . . . . . . . . . . . . . . Password
. . . . . . . . . . . . . . . . . . Pointer Load Limit
. . . . . . . . . . . . . . . . . . Return Protocol
. . . . . . . . . . . . . . . . . . Return Quantity Changed
. . . . . . . . . . . . . . . . . . Segment Size
. . . . . . . . . . . . . . . . . . Shared
. . . . . . . . . . . . . . . . . . Source Location
. . . . . . . . . . . . . . . . . . Source Name
. . . . . . . . . . . . . . . . . . Source Type
. . . . . . . . . . . . . . . . . . Spinlock
. . . . . . . . . . . . . . . . . . Timeout Cat Refresh
. . . . . . . . . . . . . . . . . . Timeout Connect
. . . . . . . . . . . . . . . . . . Timeout Query
. . . . . . . . . . . . . . . . . . Timeout Temp
. . . . . . . . . . . . . . . . . . Variable Delimiter
. . . . . . . . . . . . . . . . . . Wildcard Multiple
. . . . . . . . . . . . . . . . . . Wildcard Single
. . . . . . . . . . . . . . . . . . Yield Processor


Chapter 6 . . . . . . . . VLDB Operations

. . . . . . . . 1 . General
. . . . . . . . . . . . . . . . . . General Topics
. . . . . . . . . . . . . . . . . . Data Sampling
. . . . . . . . . . . . . . . . . . Techniques And Hints
. . . . . . . . . . . . . . . . . . Manual Changes
. . . . . . . . 2 . Entity Segmentation
. . . . . . . . . . . . . . . . . . Description
. . . . . . . . . . . . . . . . . . Studies In Segmentation
. . . . . . . . . . . . . . . . . . Segment Boundaries
. . . . . . . . 3 . Table Dispersal
. . . . . . . . . . . . . . . . . . General
. . . . . . . . . . . . . . . . . . Dispersed Table Operations
. . . . . . . . . . . . . . . . . . VLT Write Control Map
. . . . . . . . . . . . . . . . . . After The Fact
. . . . . . . . 4 . External Data
. . . . . . . . . . . . . . . . . . Virtual Tables
. . . . . . . . . . . . . . . . . . Massive Imports
. . . . . . . . 5 . Processing Errors
. . . . . . . . 6 . Query Returns
. . . . . . . . 7 . Design
. . . . . . . . 8 . Indices Of Very Large Objects
. . . . . . . . . . . . . . . . . . Disk Location
. . . . . . . . . . . . . . . . . . Resources
. . . . . . . . 9 . The Distributed Database Manager
. . . . . . . . . . . . . . . . . . Description
. . . . . . . . . . . . . . . . . . What It Is Not
. . . . . . . . . . . . . . . . . . An Axsys Architecture
. . . . . . . . . . . . . . . . . . Domain Space Generation
. . . . . . . . . . . . . . . . . . Definitions
. . . . . . . . . . . . . . . . . . Plasticity
. . . . . . . . . . . . . . . . . . Axsys Query Nodes
. . . . . . . . . . . . . . . . . . Axsys Data Nodes
. . . . . . . . . . . . . . . . . . Axsys Satellite Nodes
. . . . . . . . . . . . . . . . . . Axsys Index Nodes
. . . . . . . . . . . . . . . . . . Axsys Links
. . . . . . . . . . . . . . . . . . Axsys Hosts
. . . . . . . . . . . . . . . . . . Axsys Control Console
. . . . . . . . . . . . . . . . . . Error Controller
. . . . . . . . . . . . . . . . . . Axsys State Assessment
. . . . . . . . . . . . . . . . . . Booting An Axsys
. . . . . . . . . . . . . . . . . . Auto-Configuration
. . . . . . . . . . . . . . . . . . Node Work Areas
. . . . . . . . . . . . . . . . . . Process Control
. . . . . . . . . . . . . . . . . . Fault Tolerance
. . . . . . . . . . . . . . . . . . Synchronization Warning
. . . . . . . . . . . . . . . . . . Communication Protocol
. . . . . . . . . . . . . . . . . . Security And Log
. . . . . . . . . . . . . . . . . . Cascading Axsys
. . . . . . . . . . . . . . . . . . Massive Returns
. . . . . . . . . . . . . . . . . . VLT Query And Join Mechanics
. . . . . . . . . . . . . . . . . . Very Large Table Builds
. . . . . . . . 10 . Performance Tuning Tips
. . . . . . . . . . . . . . . . . . DbTemp Relocation
. . . . . . . . . . . . . . . . . . Base Table Segment Size
. . . . . . . . . . . . . . . . . . Log Relocation
. . . . . . . . . . . . . . . . . . Segment Pointer Management
. . . . . . . . . . . . . . . . . . Yield Processor
. . . . . . . . . . . . . . . . . . Other Configurations
. . . . . . . . 11 . Catastrophic Loss


Chapter 8 . . . . . . . Appendices

B. Naming Standards

. . . . . . . . 1 . Implementation
. . . . . . . . 2 . Invalid Characters
. . . . . . . . 3 . Reserved Words

C. Code Tables

. . . . . . . . 1 . Backup Retention Type
. . . . . . . . 3 . Boolean Toggle States
. . . . . . . . 4 . Column Types
. . . . . . . . 5 . Table Sources
. . . . . . . . 6 . Return Protocols

R. Coredate Protocol

. . . . . . . . 1 . Request For Comments
. . . . . . . . 2 . Usage And Distribution
. . . . . . . . 3 . Objective
. . . . . . . . 3 . Current Release
. . . . . . . . 4 . Standard
. . . . . . . . 5 . Time Zone Option
. . . . . . . . 6 . Temporal Environments
. . . . . . . . 7 . Unit Basis
. . . . . . . . 8 . Redefines
. . . . . . . . 9 . Range
. . . . . . . . 10 . Concerning The Nature Of Time

Z. Quantum Computing

. . . . . . . . 1 . Description
. . . . . . . . 2 . String Theory Ramifications



__________________________________________________

Copyright

__________________________________________________

AxleBase
Copyright 2003 - 2010 John E. Ragan
All rights are reserved.

AxleBase Documentation
Copyright 2003 - 2010 John E. Ragan
All rights are reserved.

AxleBase Web Site
Copyright 2003 - 2010 John E. Ragan
All rights are reserved.



_________________________

System License

License to use AxleBase will be granted only upon the individual user's agreement to the license terms which are published on the web site http://www.axlebase.com/license.htm . The license in effect at the time of agreement is carried within the AxleBase system and is always available on demand.







__________________________________________________

Chapter 1

Introduction

__________________________________________________





_________________________
Introduction
Section
General





Introduction
General
Sub-Section
Description



AxleBase is a complete database manager and is one of the most powerful in existence. But he is described as an engine because he was created to be compiled into software projects.

His primary objective is the very large. He is not designed for the usual mid-size databases.

AxleBase does not just claim to be embeddable. He was built for that purpose so that he lives and functions entirely within a host system. He is a DLL component which is invisible and which a programmer can compile into a product.

The host will use industry standard ANSI SQL-92 to control him. He has SQL enhancements to handle very large objects, but they do not interfere with standard SQL, and when a deviation is made from the standard, the deviation is openly and explicitly stated in this documentation.

He provides a universal interface that can be tied into any production system. That and his light weight make him easily deployable.

AxleBase's design target is Mankind's largest databases. He contains special mechanisms that give him the ability to handle unbelievably large tables.

A secondary objective is cost reduction. Instead of using a super-computer or mainframes to handle very large databases, he is designed to do it on low cost P.C.'s under Ms. Windows.

AxleBase is designed and internally coded for very large tables. Mid-range OLTP operation with heavy concurrency is not an objective and a big-name server may be a better choice for that kind of database.





Introduction
General
Sub-Section
Design Objectives



A database manager that
     can quickly and efficiently control
     very large data objects
     on the cheapest equipment available
     as an embedable object.



Accessibility Highest possible. *
Use Anything that can embed it **
Interface Detailed and programmable.
Language Standard ANSI SQL-92.
Scalability The biggest imagined.
Platform Cheap desktop PC's.

( * Data tables and control files are totally visible to their owners.)

( ** If you know how to use a DLL in a program, then you can embed AxleBase.)





Introduction
General
Sub-Section
System Numbers



Version numbers:

Version numbers became nearly eufunctional after the billionaires started playing marketing games with them. Therefore, AxleBase version numbers serve mainly to uphold tradition.

The version is always stored in the product. A command is available for displaying the system's internal version number.

Release numbers:

Release numbers have been the best guide to the current level of my work for the past twenty years. They are seldom consecutive, but they are always sequential. They have been a five digit integer for years.

A new release number is simply and truly the identification of the system that was released to the public. It may be for a major change or for minor cleanups.

The release number is stored in the product and a command is available for displaying the system's internal release number.

The web site download page shows the release number that will be downloaded. The web site change log page carries a history of changes showing the release number in which each change was made.

SAM versions:

The storage architecture model (SAM) version should usually be of little or no interest. It is mainly for internal use, but is made public because it can be seen in system files.

The SAM has its own versioning identifier. Each time that the SAM is changed, it is assigned a new identifier which may or may not be the same as the AxleBase version or release number.





Introduction
General
Sub-Section
AxleBase Limits



AxleBase is designed to these limits.
__________________________ ___________ ___
column bytes 2 billion
row
bytes 2 billion
columns 2 billion
table
rows 20 quintillion[1]
bytes 20 quintillion[2]
computers 10 billion [3]
DASD 10 billion [3]
segments 10 billion
segment
bytes 2 billion [5]
database
tables 2 billion
files no limit
bytes no limit
domain databases 2 billion
installation
domains no limit
databases no limit
query return
rows no limit [6]
bytes no limit [6]
name length characters 80
instances no limit
index
columns 2 billion
bytes no limit [7]
rows no limit [5]
SQL statement columns no limit
concurrency
clients 2 billion [8]
operations limited [8]
O.S. AxleBase Windows
95
NT Server
98
2000 Pro
2000 Server
XP Pro
Vista [9]
O.S. database any [10]
network standard TCP/IP
concatenation tables 7 million

[1] 2x(10^19) or 20,000,000,000,000,000,000 rows.
[1] The limit may be greater. Approximately 1x(10^22),
but controls are not yet in place for that limit.
[1] The internal architecture will allow an increase up
to four hundred times larger if necessary.
[1] Tests have exceeded 4.2(10^10) rows.
[2] 2x(10^19) or 20,000,000,000,000,000,000 bytes.
[2] 20 exabytes.
[3] Hardware, operating systems, and networks that house
tables and other objects in a database are
transparently managed by AxleBase for SQL queries and
all other operations.
[5] Segments are normally limited to 2 gig because access
beyond 2 gig is very slow.
[6] AxleBase normally uses RAM for queries as do
conventional systems, but a switch can tell him to
use the computer's DASD to its limits for queries.
[7] Index size can impact performance. The fastest is
usually under a hundred characters.
[8] High concurrency is not an AxleBase objective.
He is primarily a workhorse for carrying massive
loads up to any conceivable size.
See the design objectives and concurrency tests.
[9] Not tested on 2003 and 2005 Server.
[10] The databases may be placed on any computers with
which Windows can communicate including mainframes,
Linux, Unix, etc.
[***] Unless otherwise noted, 'no limit' indicates that he
may be expected to surpass any practical requirement
of the current state of Mankind and computer science.





Introduction
General
Sub-Section
Very Large



The concept of "very large" has historical precedence in database work. It was first applied to databases as "VLDB" and later applied to individual tables as "VLT". The concept has remained the same through the years to mean a larger than ordinary object, but its application has changed as hardware and software changed. That which was a very large table before the PC revolution is now routinely managed in a desktop database manager.

It is, therefore, a relative and changing concept. This documentation, however requires a means of distinguishing between normal-sized objects and very large objects. Almost all tables around the world and in all hardware are normal-sized objects. AxleBase is designed to handle larger than normal objects. Therefore, this documentation requires the use of the concept in a slightly more precise manner.

Generally speaking, the size of each row in a table is irrelevant because accessing a two-hundred byte row takes about the same time as accessing a two-thousand byte row. The number of rows in a table might be considered as indicative, but a table of twenty million customers that might seem large to a utility company would be inconsequential to AxleBase.

The total number of bytes in a table is certainly not useful in defining the concept because that could be misleading. For example, a table used in an astronomy application might have petabytes of data with almost all of it residing in BLOBS. The BLOBS might present a storage problem, but their management would be inconsequential for AxleBase.

AxleBase uses a management mechanism that may be of some help with the concept. He divides a table into segments. Table segmentation is normally transparent to the user and is known only by the DBA and AxleBase. Segment size, in bytes, is usually fixed for a database, and is therefore usually fixed, in rows, for each table. The maximum segment size is usually set at two billion bytes. When each table segment reaches the stipulated size, AxleBase automatically creates a new segment into which new data will be inserted. The segment, then, gives us a means of defining the "very large" concept, which then allows us to use it as a more precise technical descriptor.

As it is used throughout this documentation, the term "very large" means that a table has multiple segments. It is frequently referred to as a "VLT". A very large database, a VLDB, is one that contains one or more VLT's.

The actual number of segments is undefined other than the "multiple" stipulation. That is intentional and is left to the discretion of the professional DBA who manages the local VLDB.





Introduction
General
Sub-Section
In Tribute



The observant will notice an interesting and extremely useful naming convention in the AxleBase documentation and demonstrators. It is the work of the very capable data managers and profesionals who work for the Entergy corporation. For those who are interested, it is detailed here.

1. Each major type of object in a database has a standard prefix letter.

Standard Prefix Letters
Letter Object Type
T table
V view
SP (upgraded here to J)
J job

2. The prefix letter is followed by an underscore.

3. Names are upper case.

For example, the citizen table in the AxleBase demonstration database is T_CITIZEN.

Simple, but very effective. Note that the standard is designed for use with all of the major brands of database managers and it works well on enterprise servers and desktops. It has facilitated communication between many large and small databases and systems, and those fine people deserve the recognition.





_________________________
Introduction
Section
Unfinished Parts



If something should be in the following lists and is not, it is an oversight.

Recent fixes and upgrades are listed on the web site change log page.

Current work and next work is not predictable. Since this is such a huge project, I tend to work on whatever interests me at the moment.





Introduction
Unfinished Features
Sub-Section
Bug Policy



Bugs and breaks are not usually listed here because, when a bug or a break is discovered, all other work ceases until it is fixed.

Changes, upgrades and fixes are posted in the web site change log as each is finished and uploaded.





Introduction
Unfinished Features
Sub-Section
Under Construction or Awaiting Start



SQL

SQL optimizer needs more work.

Joins : Compound parenthetical joins are not yet supported.

Joins : Group by and having.

Math operations in SQL statements.

Unique selects.

Miscellaneous

Table constraints : Only the primary key constraint is currently operational.





Introduction
Unfinished Features
Sub-Section
Undecided



A decision has not been reached on whether or not to do the following items.

Century leap-seconds are not handled in date functions.

Column locks.

Jobs. Commonly known as "stored procedures". The use of SQL as a programming language is a dangerous practice, but it is common, so this is undecided.





Introduction
Unfinished Features
Sub-Section
Intentional Abridgement



There is currently no intent to build these items into AxleBase.

Miscellaneous and SQL

_____________ _____________
any lower
arrays merge
cross joins plan
case singular
cast some
collate sub-selects
containing starting
current of transactions
declare triggers
escape union
exist upper
for update using

Modification of Returned Data

Since a host app can modify data that has been returned, there is little need for that in AxleBase queries and it has a very low priority. For example, applying a date conversion to a column after it is selected should be done by the host.

Trans-Segment Uniqueness.

A unique index is maintained within table segments, but not across segment boundaries. (Tables of ordinary size do not need it and it would be disruptive in a trillion-row table.)

ODBC Driver

AxleBase does support the ODBC protocol. But a driver is the responsibility of the hosts.

Mirror Databases

The ability of AxleBase to support an unimaginable data load could allow an inexperienced DBA to crush an infrastructure by turning on mirroring. However, this may be re-evaluated.

Slave databases: See above.

Failover databases: See above.

Backup databases: See above.

Journaling

This has been known by various names through the years such as transaction logging and journaling with checkpointing. Its purpose is database restoration from the checkpoint.

The objectives of AxleBase do not require journaling and they might actually be impaired by it. It could, for example, seriously degrade the speed of a very large database. It would be simple and a fun bit of programming, but is not seriously considered because of its negative impact on operations.

Views

AxleBase is designed for databases containing very large and geographically distributed tables, and creating views with such objects would be disruptive at the very least. Since the mechanism for views would not be complex, it might be reconsidered later, but it currently appears that the benefits would not be worth the dangers.





_________________________
Introduction
Section
Installing AxleBase





Introduction
Installing AxleBase
Sub-Section
Development Environment Installation



After AxleBase is installed on a computer, it will automatically appear among the tools or components in any development environment that is aware of components on the computer. For example, Visual Basic will show it in the list of components that can be referenced. When a reference is set to it in that kind of environment, its commands automatically become available within the development environment as part of the development language.

Method 1

At a glance:
1.     Download to a temporary directory.
2.     Run the downloaded exe to unpack it.
3.     Run setup.exe to install.
That's all.

On the web site, click on the download link to download the current download package into a temporary directory on your local disk. That package is an executable packed file with an exe extension. It does not need WinZip or any other program. When it is run, it unpacks itself into several files in your temporary directory.

When the download is told to unpack itself, it creates several files, one of which is setup.exe. When setup.exe is run, it installs AxleBase on the computer in the system directory.

Save copies of your downloads. The AxleBase system is frequently updated, and you are responsible for maintaining the com object which you use in your host system. You may need to roll back to a previous release if an upgrade does not work for you.

After installation, the database manager is available for embedding into your host system. Reference it and code to its interface in your project. When you compile and distribute your system, the referenced database manager will go with it.

This will not uninstall a previously installed release. Use the command in Method 2 to do that.

Method 2

A method which some developers use is to place the DLL where they want it and then manually install it. To do this:
    Relocate the DLL.
    Run the command regsvr32 [path]\AxleBase.DLL.
    Watch the return to insure installation

That method can be especially useful when upgrading to a new release. Using the /u option in the command will uninstall.

A ficticious example:
    regSvr32 /u c:\windows\AxleBase.DLL
    regSvr32 c:\dev\AxleBase.DLL

Method 3

A more complex, method is to use a system call from inside the host system to install it every time that the host system runs. That is the method that is used by AxHandle, but not by CoreReader. Every time that AxHandle is used, he re-registers his internal database manager. That method works well, but is not recommended because it can lead to confusing problems during system development.

Method 4

If AxleBase was installed and shared by another system on the computer, then it will be available for use by your own system.

If it is uninstalled and upgraded, then systems that use it may need to be upgraded to insure that they can run with the new AxleBase release.





Introduction
Installing AxleBase
Sub-Section
Production Environment Installation



Like any component, AxleBase should usually be installed on a production system as part of the installation process of the host system.

What happens after installation is up to the host system. For example, when CoreReader starts up, he checks the environment to see if his database exists. If it does not, he gives AxleBase instructions for creating it. The tools for doing all of this are covered later in the documentation.

Copies of the original download may be used to install on additional systems. If this method is used, the manufacturer of the host system is responsible for documentation and support. Do not direct the end consumer to download from the AxleBase site because the currently posted release may not be compatible with the older host software.





Introduction
Installing AxleBase
Sub-Section
Upgrading An Installation



The change log page on the web site shows the current release number and a record of recent changes.

The operating system utility can be used to uninstall the current installation.

To upgrade a development environment:
    1. Download and decompress the current package,
    2. Stop all systems.
    3. Uninstall the old one.
    4. Run the setup.exe to install the new one.
    5. Reboot the computer in case you left the old one in RAM.

Please check the change log on the web site to see if the database needs to be upgraded. AxleBase will not upgrade a database.





_________________________
Introduction
Section
GUI Front End



AxleBase is designed only to be embedded in an application, so he has no GUI and no front end.

The host apps should handle the control and administration of their databases. If a GUI is needed in an emergency, AxHandle may be pressed into service as an ad-hoc database administration tool, but that is not his purpose and he is not a production-quality app.

If you need a GUI control for AxleBase, just create one. That is, after all, why AxleBase is embeddable.





_________________________
Introduction
Section
Getting Started



Download, unpack, and install the system as described in the installation section.

Reference AxleBase in the host system.

Decide how the database(s) should be constructed, used, and maintained.

Write the commands in the host system to tell AxleBase what to do.





_________________________
Introduction
Section
Tests





Introduction
Tests
Sub-Section
Lab Test Equipment And Setup



The AxleBase test and development lab uses the cheapest equipment that can be found in retail stores. Computers are used until they break, so one machine has been in use since the mid nineties.

Where fast computers are used in the following tests, it is because they were the cheapest computers being sold when they were bought.

Disk drives are the cheapest standard off-the-shelf drives that can be found locally. They are the largest, and not the fastest, affordable.

The network is gigabit switched.

Tests are run without tuning and without special configuration except for disk defragmentation.

The yieldProcessor setting is turned on unless otherwise indicated.





Introduction
Tests
Sub-Section
Public Discussion



The tests described herein may be repeated and the results may be publicly and privately discussed.

The free AxHandle test and demo app may be used to repeat the described tests and it can easily run many other tests. AxHandle is described in the chapter entitled Free Test And Demo Software. It may be downloaded without cost. It is shipped with AxleBase embedded in it for testing.





Introduction
Tests
Sub-Section
Table Size



Objective:
    Test the ability to build and control very large tables transparently to the user.

Validation:
    The TableCheck comand.
    Queries checked with the row clause for known rows.

test date 20071001 - 20080331
rows in table 42 billion
  42,126,656,000
bytes in table 3 terrabytes
  3,330,005,827,500 *
host master app AxHandle
computers 5 **
operating system Windows 2000
disk drives 23
table t_citizen_status
bytes per row 79
rows per segment 25,316,500
bytes per segment 2,000,003,500
table segments 1,665
SQL statements 50 row arrayed insert
_______________________ _______________________

* Data only. Excluding indices and no BLOBs.
** Participated in the build.





Introduction
Tests
Sub-Section
Concatenated Virtual Table



Objective:
    Test the concatenation limits. The design limit is seven million concatenated tables.

Validation :
    The TableCheck comand.
    Standard SQL queries of the indexed table.
    Retrieval of known rows by number in larger table.
    Unique rows were placed at controlled locations in tables.

test date 20090427
_______________________ _______________________
un-indexed table  
rows 177 trillion
  176,990,596,860,000
bytes 14 petabytes
  13,986,024,475,500,000
segments 6,993,000
source tables 4,200
_______________________ _______________________
indexed table  
rows 2 trillion
  2,025,320,000,000
bytes 160 terabytes
  160,000,280,000,000 *
segments 100,000
source tables 20,000
single value query time avg. 6 minutes * *
_______________________ _______________________
host master app AxHandle
operating system Windows 2000
table t_citizen_status
bytes per row 79
rows per segment 25,316,500
bytes per segment 2,000,003,500
_______________________ _______________________

* Data only. Excluding indices and no BLOBs.
** select * where name = 'lauren' Returned 20,000 tuples.





Introduction
Tests
Sub-Section
Embedding Test



Objective:
    To demonstrate that AxleBase can be easily and reliably embedded.

The ability to operate as an embedded object is continually demonstrated in a publicly used application.

AxleBase is embedded in CoreReader which can be found on the web site at http://www.CoreReader.com. He handles all of CoreReader's data. He runs day and night around the world in thousands of CoreReader installations. AxleBase has done a fine job in that app for years.

AxleBase is embedded in the AxHandle demonstration app which can be downloaded from this web site. AxHandle is used constantly to test the embedded AxleBase.

( AxleBase is embedded in CoreModel, but CoreModel has not been updated in some years.)





Introduction
Tests
Sub-Section
Concurrency



Purpose:
    To test light concurrent operations against a single database.

Queries:
    The queries are those in the AxHandle test suite.

Note::
    AxleBase is designed for VLDB operations which are expected to have light concurrency needs. The purpose of these tests is to insure that he can meet those needs and not for heavy concurrency operations. Do not be misled by the success of these tests. The inability to achieve a system failure does not necessarily indicate operational safety at or above that load. Only after a failure has been achieved can a safe operational load be estimated.

AxleBase attempts to retard the host system to avoid losing information when a production system exceeds the design limits of a database. But since the failure point has not yet been found, that situation should be avoided.

The tests were run over a mixed network of 10 megabit, 100 megabit, and 1 gigabit connections.

Test Design
test date 20061113
achieved load 29.4 queries per second
duration 24 hours
host master app AxHandle
system release 61113
computers 7
instances * 11
computer speeds 120 megahertz
  150 megahertz
  350 megahertz
  400 megahertz
  733 megahertz
  800 megahertz
  1.8 gigahertz
operating systems Windows 95
  Windows 98
  NT
  Win 2000 pro
  Win 2000 server
database AxHandle demo
instance schedules continuous
query timeout 15 seconds
spinlock timeout 15 seconds
test type mixed SQL queries
yield processor yes
remote temp db yes
remote segment table no
system errors none
contention lockouts none
lock failures none
data loss none
_______________________ _______________________



Concurrent Insert Test

Objective:
    To place a heavy insert load on a single table. The previous test was mainly reads.

The CoreReader log table was chosen. Multiple CoreReader instances were directed against a single remote database, and a departmental job server was started on all instances.

All activity, including job file writes, was on one disk. There was no system tuning or object dispersion. The default CoreReader installation was used.

Concurrent Insert Test Design
test date 20070202
achieved insert rate 24 per second *
insert and read 75 per second *
duration 48 hours
host master app CoreReader
system release 70202
computers 3 **
CoreReader instances 3
computer speeds 400 megahertz
  733 megahertz
  2.16 gigahertz
operating systems Windows 98
  Win 2000 Pro
  Win 2000 server
database CoreReader
table t_log
instance schedules continuous
query timeout 15 seconds
spinlock timeout 15 seconds
test type job server
yield processor yes
remote temp db no
errors none
contention lockouts none
lock failures none
data loss none
_______________________ _______________________

* There was also an hourly database purge and backup from every instance.
** Does not include the file server and the database servers such as MySql and MsSql against which CoreReader jobs were run.





Introduction
Tests
Sub-Section
Index Build Speed



Objective:
      Determine the time required to index an existing table.

The optional AxleBase LOCATE clause was used in the SQL statement to separate the build writes from the source reads which reduces contention for disk heads.

(The LOCATE command can also be used to reduce operating system fragmentation.)

test date Oct 2009
host master app AxHandle
system release 91101
table t_citizen_status
segments 5
disk drives 2
cpu speed 3.4 ghz 32 bit
buss speed 333 mhz
r.a.m. 1 gig
buffer size 20 meg
yield processor yes
rows 101,266,000
bytes 8,000,014,000
column update_by
  alpha data
  random
  not unique
  56 min. 8 sec
  25,689 rows/second
  2.2 billion per day
column citizen_id
  numeric data
  sorted
  not unique
  52 min. 11 sec
  32,343 rows/second
  2.8 billion per day
column location
  alpha data
  random
  not unique
  157 min. 5 sec
  10,744 rows/second
  .9 billion per day
_______________________ _______________________





Introduction
Tests
Sub-Section
Index Validity



Objective:
    Run a 100% test of the validity of indexing.

This test is possible because of the AxleBase ability to quickly return a specific row by number.

Test Logic:
    Table was built with random data in a field.
    The SQL row clause selects a row by number.
    The value in the random-data field is saved.
    A standard select query looks for that value.
    The query return is checked against the original row.
    Test is repeated for each row sequentially.

example:
    select location from t_log row( 1 , 1 )
    select * from t_log where location = 's65798315678'
    The value "s65798315678" was extracted from the first return.
    The validity of the second return is checked.
    The left digit in the row clause is incremented.
    The next row is checked.

Test Design
test date June 2008
host master app AxHandle
database AxHandle demo
table T_CITIZEN_STATUS
column location
rows one million
  ( 1,001,658 )
_______________________ _______________________





Introduction
Tests
Sub-Section
SQL Insert Speed



Test Design
test date Aug - Oct 07
average time per row 0.0003 second *
rows inserted 5 billion
host master app AxHandle
computers one
CPU's one, 32 bit
  1.8 ghz
buss speed 333 mhz
disk drives  
    qty 5
    type cheapest available
    mfg Seagate
  Maxtor
  Western Digital
    rpm 7200
    buss SATA
  EIDE
operating system Windows 2000 Pro
database AxHandle demo
table T_CITIZEN
indexed no
yield processor yes
_______________________ _______________________

* Time elapsed from handing each insert to AxleBase until he was ready for the next insert.





Introduction
Tests
Sub-Section
Indexed Retrieval Speed



Purpose:
    Test the speed of large indices.

Query Design:
    Each query searched entire table for a single value.
    select * from t_citizen_status where citizen_id = 32796156843

Results Validation:
    See the index validation test section.

Important:
    Indices were built after the table was created.
    Indices built on-the-fly are not suitable for large entities.
    The second table shows a normal index test.

Equipment:
    The AxleBase laboratory uses the cheapest that can be found.



test date Mar 2008
seek without index  
. . . . . . . . test runs 5
. . . . . . . . average 49 minutes
seek with index  
. . . . . column update_by
. . . . . . . . test runs 300
. . . . . . . . average 0.031 second
. . . . . . . . fastest 0.031 second
. . . . . . . . slowest 0.093 second
. . . . . column location
. . . . . . . . test runs 3000
. . . . . . . . average 0.864 second
. . . . . . . . fastest 0.171 second
. . . . . . . . slowest 1.546 second
. . . . . column citizen_id
. . . . . . . . test runs 20,000
. . . . . . . . average 0.016 second
. . . . . . . . fastest 0.015 second
. . . . . . . . slowest 0.062 second
seek a row number *  
. . . . . . . . test runs 50
. . . . . . . . average 0.063 second
host master app AxHandle
table name t_citizen_status
rows in table 101,266,000
bytes in table ** 8,000,014,000
segments in table 4
computers 2
disk drives 2
main computer speed 3.8 ghz, 32 bit
r.a.m. 1 gig
main computer ram 2 gig
operating system windows 2000 Pro
unique index no
yield processor yes
buffer size 20 meg
_______________________ _______________________

* select * from t_citizen_status row ( 16000500000 , 200)
** Data only without indexing.



Standard Index:
    The indexes in the above tests are what Axlebase builds on an existing table. A DBA who has large tables will normally index them "en masse" after they are built.

When AxleBase is told to index a table that has not been built, he uses a method which is more suitable for OLTP. The slower build is seldom noticed because it is spread over single row inserts.

The following test is of that kind of index.

Test Design
test date June 2008
host master app AxHandle
database AxHandle demo
table T_CITIZEN_STATUS
rows one million
  ( 1,001,658 )
column location
test runs 1,001,658
average time per row 0.032 second
fastest time 0.015 second
slowest time 0.078 second
_______________________ _______________________





Introduction
Tests
Sub-Section
Table Joins



Note:
    Much has changed since this test. Until it is re-run, approximate results can be estimated from the SQL Retrieval Speed section.

Purpose:
    1. To determine the join speed of very large objects.
    2. To test the ability to join very large objects.
    3. To insure transparency of the operation.

Equipment:
    The AxleBase laboratory uses the cheapest that can be found.

Query Design:
    Entire table was searched for a single row.
select * from T_APP_CRUD
left join T_LOG
where T_LOG.owner = 'sarah'

1 Billion Rows to 1 Billion Rows
Test Setup
test date 20070511
tests  
. . . . . . . . runs 100
. . . . . . . . avg. time 0.561 second
. . . . . . . . slowest 0.6562 second
. . . . . . . . fastest 0.5312 second
host master app AxHandle
computers 3
. . . . . . . . speed 350 mhz, 32 bit
. . . . . . . . speed 733 mhz, 32 bit
. . . . . . . . speed 1.8 ghz, 32 bit
operating system windows 2000
disk drives 4
table T_LOG
. . . . . . . . indexed yes
. . . . . . . . rows 1,000,000,559
. . . . . . . . segments 74
. . . . . . . . bytes 134.05 gig
. . . . . . . . index size 56.75 gig
table T_APP_CRUD
. . . . . . . . indexed yes
. . . . . . . . rows 1,025,843,598
. . . . . . . . segments 39
. . . . . . . . bytes 69.7 gig
. . . . . . . . index size 37.8
remote seg pointers no
remote index defs no
yield processor yes
_______________________ _______________________







__________________________________________________

Chapter 2

Free Test And Demo Software

__________________________________________________



The test software may be downloaded from the AxleBase web site under the AxleBase licensing agreement. It is simple software that is designed to demonstrate and test the more complex AxleBase system.





_________________________
Free Test And Demo Software
Section
AxHandle ; GUI Test Host





Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
General



The primary purpose of AxHandle is routine testing of AxleBase in his development environment. He is also made available for demonstration purposes.

AxleBase is embedded in AxHandle so do not download AxleBase for AxHandle.

In this case, the host has a point and click GUI interface for interactive control of AxleBase, but an unattended server can also have an embedded AxleBase.

AxHandle is not intended for production use. His purpose is test and demonstration. A hidden problem is that he may be too powerful. He makes dropping a very large database easier than a query.

The Windows operating system requires a new handle for almost every event and the demo apps cannot release those handles so they eventually reach the Windows limits. AxServer hits the limit quicker than AxHandle because Windows communication objects also use handles.

AxHandle is multi-instancing. AxHandle is not multi-threaded and is not multi-tasking.





Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
AxleBase Objects



There are two interface objects, Manager and Vector, in AxleBase. They are covered in detail in later sections. For now, just be aware that they exist and that AxHandle tells AxleBase to create them as you need them.

When AxHandle loads, he creates a Manager object for you. You will initialize it by opening a domain and a database. The easiest way to do that is by pressing the demo_db button. When the operation is complete, you will be connected to the new demo database.

AxHandle creates a data Vector object when needed. When a new Vector object is created, AxHandle connects it to the Manager object which provides a database connection.





Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
Passing Commands



All commands are listed in the scrolling windows. The top window lists all of the Manager commands and the bottom window lists the commands that are used by the data Vector.

Each set of commands has a do_it button. To run a command, highlight it and press its do_it button to execute it. For example, select the ShowCopyright command and press the do_it button. The copyright will appear in the return window.

There is a parameter window next to each command window in which a parameter can be typed. When the do_it button is pressed, AxHandle will combine the parameter with the command before passing it to AxleBase.

Example :
        1. Click on the OpenDomain command, which is at the top in the top command window. That will highlight the command.
        2. Then, enter the domain path in the parameter window.
        3. Press the do_it button.
        AxleBase will open the domain database, load attributes from it, and use those attributes to configure itself for the domain.
        4. Click on the ShowDomainAttrbitues command.
        5. Press the do_it button.
        A list of the domain's attributes will be displayed.





Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
Returns



Messages, errors, and data returns will appear in the bottom window on the screen.

Sometimes, AxHandle puts instructions in that window to show how he performed an action. For example, when you tell him to create a new demonstration database, he will list the commands that he used so you can create your own databases.

If AxleBase returns an overwhelmingly large dataset, AxHandle will tell you that the return was too large for the window. When that happens, AxHandle will remind you that there are AxleBase commands that you can use to step through the dataset.





Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
Help



There are help options for each major operation on the help menu.

The AxleBase command syntax is available from the help menu. Click on help and then click on documentation. It will tell you how to find and display what you need. If you need help only for a specific AxleBase command, display the documentation and double click that command.

( AxHandle uses the same documentation mechanism that is used in the CoreReader and CoreModel family. This is not because it is so great, but simply because Microsoft's was so bad. Since this was done, others have created and offered better documentation tools, but they were simply too late. )

For a minimal amount of help with the SQL language, look in the ExecuteSql sub-section of the API chapter. The entire syntax is presented for each of the commands. The SQL language is one of the simplest languages in existence, but its use is one of the most complex. If you are not familiar with it, you may want to buy one of the many books on the subject.

For major assistance with constructing SQL queries, download the CoreReader tool from www.CoreReader.com . You can use it to query databases just by pointing and clicking on data objects and it will show you the SQL statements that it builds.

( The creation of CoreReader showed others how to create similar tools, so there are now many fine products on the market. However, aside from their user interfaces, they are no better than CoreReader at what CoreReader does, so you might as well use the original. )





Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
Stored Connection Strings



Each time that the connect command is used by AxHandle, he stores the connection string. He also saves the connection strings when he creates the demo databases. If the new string is identical to one on file, he will not save it, but the slightest difference will cause it to be saved.

Press the open_db button to display all stored connections. To open the desired database, highlight the one needed and press the do_it button, or just double click the desired string.

In conformance with the AxleBase design philosophy, connection strings are saved in a text file which can be edited in notepad. It is named connects.txt.





Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
Demonstration Databases



When the AxleBase project began, every time that a test garbaged the database, it had to be laboriously reconstructed by hand. (Yuck!) Therefore, AxHandle was given the ability to destroy and re-create test databases on demand.

Pressing the demo_db button will create a demonstration database domain, demoDom, under the app's location. Three databases will then be created in that domain; demo_main, demo_citizen, and demo_virtual. Each contains a dozen or so tables.

AxHandle contains scripts which consist of the commands and SQL statements required for the operations. When the button is pressed, AxHandle starts passing the commands to AxleBase.

The complete demo databases may be re-created at any time just by pressing the button. AxHandle asks AxleBase if they already exist, and if they do, AxHandle tells AxleBase to drop them, and then begins creating new ones.

The domain is preserved after it is first created. This is done to allow creating and populating databases with various domain-level parameters. It also allows you to create other databases in that domain. The entire domain and the demo databases may be removed by deleting the db directory.

The demos contain a few simple tables which contain some rows for experimentation. The column types are mixed so they can be used to test performance.

The demo_virtual database also contains a few virtual tables. Some of the virtual tables can function only if their attributes are modified to fit the local environment.

As it is being created, the system writes a script in the returns window which shows the commands that are used. This can be copied and saved for reference when creating other databases. If additional databases are created in the demo domain, AxHandle will retain them when re-creating the demo databases.

Feel free to manually alter the demo database and bang on it to experiment with it. If it becomes so badly corrupted that AxleBase cannot even destroy it, manually delete the entire \db directory under the app, and then press the demo button again.





Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
VLDB Expansion



For VLDB testing, AxHandle has been given the ability to generate large test tables. Each table that is created in the demonstration database may be expanded by selecting the appropriate option on the enlarger menu.

( A study of the VLDB chapter may be needed to understand what happens when AxHandle begins building a large table. )

AxHandle uses individual SQL statements to insert rows into tables. He creates an individual statement for each insert and then passes the command to AxleBase.

Allow the generator to run for a day or two or whatever is required to generate a table of the needed size. Each table has a different rate of growth. Depending upon which table it is, a four hundred megahertz machine can generate a million or so rows every day or two.

Caution ! :
        This opeation can fill a disk so it should be monitored.

AxHandle gives unique rows to some tables. Select the AxleBase command ShowTables to get the table names, and then use the ShowTable command to inspect the structure of each table.

HINT :
        For large tables, do a SQL count query to get a row count. Then use the AxleBase row clause in a SQL command to go directly to a specific area of the table for the operation.





Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
System Tests



Instead of just using a script to write data to disk, AxHandle actually drives AxleBase for the task, which tests many of the AxleBase commands and functions when the button is pressed.

AxHandle has additional miscellaneous tests built into it which he runs every time that he builds a database. They are not comprehensive, having just a few thousand lines of code, but they include many of the basic SQL statements that are not used by the database creation. You will see them run every time that you create a new demo database.

Sometimes I forget to press that button before uploading a new version. Oh, well....





Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
Continuous Cycling



The previously described tests can be run in a continuous cycle from a menu option. This is designed for stressing AxleBase; running load tests. It is not designed to be a test of speed.

Select the stop option from the same menu to stop the tests.

A well designed application would recover when AxleBase returns an error. For example, if AxleBase reports a query timout, the app might regenerate the failed request or ask the user if he wants to retry. However, AxHandle is designed to stop on error and display it.

The tests are designed to run against a fresh copy of the demo database. When they are started, AxHandle performs a few checks on the tables for that reason.

The slowest test cycle puts a minute between tests. That test can take over two minutes to stop because of the length of the pauses.

Since AxHandle is not multitasking, the cycling must be stopped before doing anything else. AxHandle should not be unloaded while a test is running.

YieldProcessor :
        Turning off the AxleBase yieldProcessor toggle can increase the system load, but if a high load is attained with it off, it may be extremely difficult to stop a test. If multiple instances of AxHandle are run simultaneously against the same database, then a yield is necessary so they will cooperate.

Logging :
        Logging is the best way to see what happens in a test, but logging will increase the system load. An AxHandle instance that opens the domain acquires the domain logging toggle that is currently set, so running multiple instances simultaneously with logging on may increase the load significantly.

If logging is on, its overhead and the impact of the log size should be assessed.

Some errors that can be logged cannot be passed back to the host, so AxHandle will not know about them. All errors that can be detected by AxleBase are logged if logging is on, whether or not they can be returned to the host.

Hardware danger :
        This feature of AxHandle is designed to stress the system. That includes the entire computer system. AxHandle is the tool that is used in the AxleBase development environment, so you can set up its tests to overwhelm a system and perhaps even destroy hardware and operating systems. AxleBase may or may not succumb before the infrastructure fails.

Test statistics and the SQL queries are displayed in the return window during the test cycling.

A test setup can be designed as needed. A single instance can be run at low speed to watch the operation, or can be run at high speed to watch the effect. Multiple instances can be run to load the system, and remote multiple instances can be run against a database to watch the effect. ( These are NOT recommendations. See the previous warning. )



Free Test And Demo Software
AxHandle ; GUI Test Host
Sub-Section
Step By Step Operation



Load the system. Accept the license terms to display the main screen.

Press the demo_db button. This will create demonstration databases under the app. The path may be something like c:\program files\AxHandle\db\demo\

After it creates the demo database, it will leave you connected to it so you can immediately begin querying and investigating.

You can easily change to a different database with a couple of different methods. If using the CONNECT command, enter the domain path which will be something like c:\program files\AxHandle\db\demoDom and enter the name of the database such as demo_virtual. Then press the do_it button.

Find the ShowDomainAttributes command and select it. Press the top do_it button. The domain's attributes will be displayed in the return window.

Select the OpenDatabase command. Type the name of a database, demo or demo_virtual in the parameters window. Press the do_it button. The database will be opened.

Select the ShowDatabaseAttributes command and press the do_it button. Attributes will appear which describe the currently open database.

Select the ShowTables command and press the do_it button. The names of the tables in the database will appear.

Select the ShowTable (singular) command. Enter the name of a table. Press the do_it button. The table's characteristics will appear. Now, try it with the ShowTableAttributes command.

Select the ExecuteSql command in the lower window. Enter a query in the lower parameter window, such as "select * from t_log". Press the lower do_it button. The rows will appear.

Try a select after unloading and reloading the app. You will find that it does not work. AxHandle creates a new Manager object and data Vector object for you when he loads, but you need to connect them to a database as was done previously.





_________________________
Free Test And Demo Software
Section
Database Server





Free Test And Demo Software
Database Server
Sub-Section
Description



AxServer is a simple database server host. It demonstrates the server support that is built into AxleBase for a database server. It is available for download from the AxleBase web site under the AxleBase licensing agreement.

( The server works on a local area network. It will be made internet-aware when I get a round tuit. AxleBase is internet-ready and waiting for a server.)

(Pursuant to the command of Him for whom I work, my software will transmit nothing other than that which is openly and simply specified. Furthermore, care is taken to insure that transmissions contain only what you want to be transmitted.)

When it goes on line, AxServer loads an instance of AxleBase in the background to do its work. An AxHandle client on a different computer can send commands to it and it will return the data or results.

When a communication session is established, only the server's AxleBase instance is used. The client passes commands straight to the server and the server passes them to AxleBase. The server then returns the result to the client.

The demo systems are not intended for production work. The Windows operating system requires a new handle for almost every event and the demo apps cannot release those handles so they eventually reach the Windows limits. AxServer hits the limit quicker than AxHandle because Windows communication objects also use handles.

( Reminder: The AxleBase API supports ODBC if you want to build a driver for your server.)



Free Test And Demo Software
Database Server
Sub-Section
What It Is Not



This is a simple demonstration app.

It is not a production-quality system.

It cannot perform high speed operations.

It is not designed for unattended operation. (It has a GUI.)

It has limited error handling.

It cannot handle multiple NIC's on either end.

It accepts multiple clients only for research purposes.

The server functions on a local area network. It will be made internet-aware when I get a round tuit. (AxleBase is internet-ready and waiting for a server.)

The primary function of this database server is research and testing in the AxleBase lab so, unlike a true database server, this one is designed to stop processing when certain kinds of errors happen and display them in a popup window. Obviously, if for no other reason, that one prevents it from being used as a production server.

AxServer is not solid. The majority of the development effort is put into AxleBase and secondarily into the AxHandle test app. That leaves little time for communication development and leaves the server in a primitive state.



Free Test And Demo Software
Database Server
Sub-Section
Step By Step Start



The demonstration requires two computers which communicate with each other on a network.

Perform these operations in the sequence shown.

Uninstall AxHandle and AxServer if you have them. New versions are needed.

Download AxHandle and AxServer from the web site.

Install AxHandle on a computer.

Install the server, AxServer, on the other computer.

Start AxServer and AxHandle.

Press the button on AxServer to start its server.

Press the server button on AxHandle to display the comm panel.

Enter the server's computer name and press the connect button.

Press AxHandle's demo_db button to create the demonstration database on the other computer.

If everything was done correctly, you will see the system building a database on the AxServer computer and then running a series of tests. The two systems will talk to each other during the process and will show you parts of their conversation.

After the tests are complete, you will be connected to the remote database so you can run tests. Select the ExecuteSql option in the lower window, enter
    SELECT * FROM T_LOG, and press the do_it button.
( The server will return data to AxHandle where it will be displayed. )



Free Test And Demo Software
Database Server
Sub-Section
SysLink Communication Protocol



Please ignore this protocol sub-section.

This information is provided as a courtesy to those who want to build a system to communicate with the AxServer server or with the AxHandle client.


Release Number

91101 is the current protocol release number.

Changes in the release number will reflect changes in the protocol.


Description

SysLink is an application-level communication protocol. To facilitate development and debugging in this complex profession, the SysLink protocol is designed for human readability as well as for machine use. Because it is for machine use, the command strings must be precisely stated.


Comments Outside Protocol

AxleBase does not use this protocol because AxleBase does not communicate. AxServer and AxHandle use the SysLink communication protocol. The main purpose of SysLink is to enable the operation of a distributed AxleBase database manager.


AxHandle And AxServer Usage

High-speed interactive systems can encounter timing issues. Without pauses, some operations frequently produce a cascading series of errors with unforeseeable results. For example, pressing the button to build the demo databases kicks off thousands of complex operations with checks, traps, feedback, etc. which proceed at high speed with the systems on both ends trying and failing to coordinate with each other.

The problem is usually seen when the client is on a slower computer. Media latency can also require adjustment of the time.

The wait time protects AxHandle and AxServer from being overwhelmed by high speed operations. It allows a system to pause after sending each command up to the specified time.

This is an application-level wait time which is used, in this case, by AxServer and AxHandle. Mechanisms within the communication objects have their own timing issues which are handled differently.

A wait time value does not require a wait. If the operation gets a return from the server earlier than that, then the pause will end.

The value is a maximum time in seconds. The default value can be changed in the GUI, and decimal values are accepted.

AxServer and AxHandle currently use a socket buffer of 2,048.

The AxServer port defaults to 3333 and AxHandle defaults to 3332.

The AxHandle and AxServer demonstration apps check the protocol release number in transmissions to insure that they can communicate reliably with each other.


Release Of Protocol

This protocol may be freely used and distributed in whole or in part with the following exclusions. No other permission is required and no compensation or acknowledgement is required.

Exclusion : This release applies only to this protocol and to no other intellectual property or work. This release does not in any way involve, include, or refer to AxleBase or to any other intellectual work.

Exclusion : The SysLink name is not included in this release, but the name may be freely used in reference to this protocol whether the protocol is used in full or in part.

Exclusion : Protocol development will not be bound by this release. The protocol is subject to change without notice. Development by the creator may continue, and if it does continue, the protocol may be changed in any manner at any time.

Exclusion : This release does not include the right to develop or alter the protocol. The developer invites requests and suggestions.


Transmission Envelope

Transmissions are inside an envelope. The envelope consists of a header and a footer. The envelope is used by all transmissions, including commands, messages, errors, returns, etc.

The transmission header contains twenty elements of variable length. The elements are each terminated by ASCII characters 13 and 10. The elements marked with a pound sign must contain the specified data.

________________________________________
1 . Reserved.
2 # ** open syslink transmission**
3 # Syslink protocol release number.
4 # Header length.
5 # Data length.
6 # Footer length.
7 . Net weight.
8 . Reserved.
9 . The system name such as AxHandle.
10 . A system instance identifier.
11 . The DateTime using the coredate protocol.
12 . Identifier of this message.
13 . A response identifier.
14 # The source computer name.
15 # The source computer address.
16 . Encryption flag.
17 . Current SysLink session identifier.
18 . Reserved.
19 . Authentication.
20 # ASCII character 127.

- The value shown in the second position is a case sensitive literal that identifies this as a transmission envelope.
- A value in the authentication position must authenticate the sender.
- Any value in the encryption position is a notification that the enclosed transmission is encrypted.
- The system identifier is expected to uniquely identify the transmitting instance.
- The message identifier is a case sensitive literal that uniquely identifies the transmission. Header and footer message identifiers must be indentical in each transmission.
- The response identifier can identify the source message to which it is a response.
- See following discussion of the session identifier.
- (Identifiers may be case sensitive.)

The footer has three elements, which are each terminated by ASCII characters 13 and 10.

_______ _________________________________
1 # ASCII character 127.
2   Identifier of this message.
3 # ** stop syslink transmission**

- The ASCII character 127 is the first character in the footer.
- Header and footer message identifiers must be indentical.
- The value in the last position is a literal which seals the transmission envelope.

The following rules are observed :
      Error: A header without a footer.
      Error: A footer without a header.
      Error: A header or footer is not properly constructed.
      Error: Envelope contains no transmission.
      Error: I.D's in header and footer do not match.
      Lack of an envelope is not an error.
      Transmission without an envelope will be discarded.
      Additional rules are applied if the system name is AxHandle or AxServer.


Double Encryption

The protocol does not deny compounded encryption.

Example : In this hypothetical situation, the currently running axsys is designed to use double encryption. All AxleBase instances are configured to encrypt all data returns. Each host will receive an enrypted return from its embedded AxleBase instance, request authentication from AxleBase, construct the transmission envelope which includes the authentication and the encrypted return, and then have AxleBase encrypt the entire transmission assembly. The receiving host would be designed to decrypt all inbound transmissions, so it would decrypt, validate protocol conformance, authenticate, and then decrypt the enclosed return.

In that example, the entire transmission is encrypted. Within the transmission is a syslink envelope. In the envelope header is an authentication. Within the envelope is the return in its own encrypted state.

( AxleBase is designed to handle multi-level encryption. )


Control Command Strings

The following control command strings are peculiar to and recognized within the protocol. Participating systems are expected to recognize and appropriately respond to them.

To facilitate development and debugging, the communication control strings are designed for human readability as well as for machine use.

Communication control commands are precisely 30 characters. Where a command or response requires parameters, the control string is followed by a right pointer (>) and a left pointer (<) which enclose the parameters.

Communication control strings are case-sensitive literals. Each of them includes two asterisks on each end as shown.

The header and footer strings are included in the following list only for clarity. The other control strings are placed inside the envelope.

Other than the header and footer strings, a transmission may contain only one control command string.

Currently recognized control strings:

        001 ** open syslink transmission**
        002 ** stop syslink transmission**
        003 ** open new syslink session **
        004 **break our comm connections**
        005 **reverse connection to port**
        006 **syslink session identifier**
        007 ** execute local app command**
        008 ** resend last transmission **
        009 
        010 
        011 ** information return query **
        012 ** information query return **
        013 ** identification requested **
        014 **identification is enclosed**
        015 **comm check please respond **
        016 **comm check 30 chr response**
        017 **authenticate**authenticate**
        018 ** authentication enclosed  **
        019 ** encryption specification **
        020 ** initialize app or system **
        021 **stop now. unload now. die.**
        022 ** transmissions size limit **
        023 
        024 
        025 ** * server return begin. * **
        026 ** * server return cease. * **


Command : 001 ** open syslink transmission**

This has nothing to do with beginning a SysLink communication session. This string is used in a header at the beginning of a transmission to declare the beginning of a single continuous transmission.


Command : 002 ** stop syslink transmission**

Used in a footer at the end of a transmission to declare the end of a single continuous transmission.


Command : 003 ** open new syslink session **

The SysLink protocol governs communications at the application level. Levels below that, such as TCP/IP are expected to be governed by their own protocols which will not impinge upon the SysLink level. Therefore, the involved apps must open the SysLink communication session.

A communication session may be opened either by this command or by the "reverse connection" command. If this command is used, then the "reverse connection" command may be sent subsequently.

A response is not required. The sender will expect one of four possible results:
      No response, which may infer acceptance or rejection.
      Acceptance.
      Rejection.
      Challenge.

Responses may take any form. For example, the challenge might be a demand for authentication.


Command : 004 **break our comm connections**

This string is sent to advise the respondent of the cessation of communication. When that string is sent or received, the system is expected to immediately initialize communications without response or notice.


Command : 005 **reverse connection to port**

After the client connects to the server, the server will expect to transmit to the same port number on the client. This command may be used by the client to tell the server to use a different port number for transmissions to the client.

If this command is used, then both connections will be used for the duration of the session.

The request for a reverse connection is in the following format:
      **reverse connection to port**>nnnn<
      The nnn is the port number.
      The port is enclosed by the pointers.

If the session has not been opened and established, then the establishment of a reverse connection will be construed as an accptance of the request for a SysLink session.

( This is not part of the protocol: AxHandle pauses for a tenth of a second to allow settling of the infrastructure and then sends this command to connect to his own port number. When AxServer receives the command, he creates the requested reverse connection to the specified port number. AxHandle will notify the operator via the GUI if one of the connections is not made. The operator should then initialize.)


Command : 006 **syslink session identifier**

If this command is sent by either side, then the enclosed value will become the indentifier of the current SysLink session indentifier until cessation. It will not be changed by either party. This identifier may be included in the header of every transmission.

Transmission of this command will constitute acceptance of a session request.

The complete command is in the form :
          **syslink session identifier**>id<
where id is the session identifier which is enclosed by the pointers. The identifier may be case-sensitive.


Command : 007 ** execute local app command**

Commands may be sent to a system which is embedded within the respondent. The respondent is expected to extract the command and pass it to the embedded app. The command and its parameters are placed in the following data structure which has nine elements.
      1. The 30 chr command: ** execute local app command**
      2. A right pointer.
      3. The name of the target app.
      4. A vertical bar. (Called a pipe by old Unix hands.)
      5. The command.
      6. A vertical bar.
      7. The parameters for the command.
      8. A vertical bar.
      9. A left pointer.
Example:
** execute local app command**>AxleBase|cmd|parms|<


Command : 008 ** resend last transmission **

Requests that the respondent retransmit the last transmission. The command is followed by a pointer enclosure. The enclosure may contain the identifier of the last transmission if it is available.
      ** resend last transmission **>aaaaaaaa<

If the transmission can be resent, the requesting entity will expect the re-transmission to contain the same identifiers as the original. The response identifier will identify the resend request.


Command : 009


Command : 010


Command : 011 ** information return query **

This is a request for information. The command is followed by two pointers enclosing the information specification.
      ** information return query **>aaaaaaaa<

Example: The location for the demonstration databases can be known only by the server, so before beginning a database build and test, AxHandle sends the following:
      ** information return query **>dbroot<


Command : 012 ** information query return **

If the system chooses to respond to ** information return query **, this is the appropriate response that is followed by two pointers enclosing the information.

Example: AxServer may respond to the dbroot command with:
      ** information query return **>\\computer\drive\axserver\<


Command : 013 ** identification requested **

This is a request to the respondent to return an identification. Failure to respond is not an error within this protocol.

The complete command must include the attached variable enclosure which is two pointers, and is in the form:
      ** identification requested **>id<
where id is the identification of the sender. Failure of the sender to identify self is not an error within this protocol.

Challenge and response encryption may be expected.


Command : 014 **identification is enclosed**

This is a response to a request for identification. The complete response includes the attached variable enclosure which is two pointers, and is in the form:
      **identification is enclosed**>id<
where id is the identification. Response failure is not an error within this protocol.

The identification is expected to be a string of identification elements. Each element consists of the name of the element, an equal sign, and the value. ASCII characters 13 and 10 terminate elements. The protocol does not stipulate the elements, but suggestions may be taken from the message header.

Challenge and response encryption may be expected.


Command : 015 **comm check please respond **

This control statement may be initiated by client or server to verify a functional communication link. The command will be the entire message.


Command : 016 **comm check 30 chr response**

This is the expected response to a communication check if the system chooses to respond. The entire message will consist of only the response.

Failure to respond is not an error within this protocol.


Command : 017 **authenticate**authenticate**

Receipt of this command with no parameter is expected to cause the recipient to respond with an authentication string.

If the command is followed by a start string enclosed by two pointers,
      **authenticate**authenticate**>start<
then a response is not expected, but all subsequent transmissions from the respondent are expected to contain authentication within the envelope header in the appopriate location.


Command : 018 ** authentication enclosed **

This is a reponse to the request for immediate authentication if the system chooses to respond. The complete statement includes the authentication string and is in the form :
      ** authentication enclosed **>nnnnnnnnnnnnnn<
      Where nn... is a string of indeterminate length enclosed by two pointers and is the authentication string.


Command : 019 ** encryption specification **

(This command protocol is still under active review and should be expected to change.)

This is a request to the respondent for encryption of subsequent transmissions. The complete statement includes an encryption specification which may be blank, but the enclosing characters must be present. The complete statement is in the form :
      ** encryption specification **>spec<
      Where spec is a string of indeterminate length enclosed by two pointers and is the optional encryption specification.

After this command is transmitted, the transmitting system will expect encryption until the command is rescinded. Rescission is accompished by transmitting the command with the "stop" string in the specification position.

( AxleBase will honor this command, but will use only his native encryption.)


Command : 020 ** initialize app or system **

The command is followed by two pointers enclosing the name of the system.
      ** initialize app or system **>aaaaaaaa<

This allows the client to tell the server to initialize an embedded app or the operating system.

An optional notice of compliance or an error may be returned. For example, AxleBase is an extremely complex system, so a return lets the client know whether or not he can proceed. Depending upon the app and the characteristics of the infrastructure, it may be a good idea for the client to verify server-side system compliance.

Example: AxHandle likes to initialize AxleBase in the server after heavy duty cycles and in some job streams. When AxServer receives this command, he stops, unloads, and reloads AxleBase.


Command : 021 **stop now. unload now. die.**

The receiving app, server or client, is expected to respond to this command by unloading itself and any client software. There is no provision for a restart.

This command should not be expected to include the operating system. The initialization command is used for that.

If the server is running a job, then this command may not be honored. Therefore, a comm-check is recommended after sending the command.

(The protocol does not require compliance.)


Command : 022 ** transmissions size limit **

Allows an application to limit the size of transmissions from the respondent. The value is not negotiable. If both sides request a limit, then the lower value wins. If a requested return exceeds that size, then the respondent will be expected to drop the response and send an appropriate error notice.

The specification will remain in effect for the duration of the communication session.

The command is followed by two pointers enclosing the return size specification.
      ** server return size limit **>nnnnnn<

Example: A 500,000 byte limit is currently used by AxServer and AxHandle to protect the computers. If larger returns are needed, see the optional AxleBase DeferReturn SQL clause in the API chapter. Designed for very large databases, it can safely return any amount of data under tightly controlled conditions.


Server Envelope

In a client-server exchange, as may be the case with a database manager, returns from the server are placed in a server envelope which consists of a header and a footer. Each is a thirty character literal terminated by chrs 13 and 10.
The server envlope header is :
          ** * server return begin. * **
and the server envlope footer is :
          ** * server return cease. * **

The server envelope is placed inside a transmission envelope.

The server envelope should not be in a control transmission.

An acceptable server return may be an error which will be placed within the server envelope. (AxServer formats data return tuples for the AxHandle return window.)

The header and footer conform to the control command format.


Error Handling

This protocol does not currently include error handling. The following applies only to AxleBase demonstrators, AxServer and AxHandle.

( The AxleBase error protocol is not part of this communication protocol and is not released from its copyright. See the AxleBase Error Protocol section of the Embedding And Running AxleBase chapter.)

Since all transmissions are in envelopes and since an error may pass through multiple systems before transmission, an error message may be embedded anywhere within a transmission so returns should be searched for AxleBase-type error headers.

An invalid envelope will halt processing and an error notice will be returned specifying an erroneous envelope. The transmission will be cleared and nothing else will be known about it at that point.

AxServer will tolerate almost anything within a correct envelope. The purpose of that is to allow experimentation and to speed development. AxleBase is not as forgiving. When AxleBase receives an invalid command, he generates an error which will be returned through the server.

Infrastructure errors are trapped by the system or sub-system that has the processor at that instant and are handled within the AxleBase error protocol.

Depending upon the type and source of an error report, the receiving system, whether client or server, may initiate a dialogue concerning it. See the preceeding control commands.







__________________________________________________

Chapter 3

Embedding And Running AxleBase

__________________________________________________





_________________________
Embedding And Running AxleBase
Section
Designing and Coding





Embedding And Running AxleBase
Designing and Coding
Sub-Section
RAM Requirement



AxleBase has been tested on a computer with sixty-four meg of RAM and a 120 mhz CPU. He has been designed to run on computers with far less than that amount.

AxleBase consumes no RAM while at rest. He needs RAM only when the host instantiates a Manager object. At that point, his needs will begin to vary. He may be expected to occupy at least 400k per instantiated Manager object.

Each Manager may occupy up to 800k, depending on what he is currently being told to do. For example, each data Vector object requires at least 400k and a Manager object can support an unlimited number of data Vector objects. So a poorly constructed host app could overwhelm any amount of RAM by telling a Manager to construct data Vector objects without control.

He will consume additional RAM for each dataset that he is told to build up to the size of the dataset. While building a dataset, he will use RAM for each table in the SQL and for working storage. (Note the deferReturn clause for large returns which is covered in the API chapter.)

To conserve resources, he releases all working storage as he finishes each task. He diligently destroys all objects that he creates immediately after they finish the assigned task. When a data Vector object is release by the host, it is destroyed and it destroys its dataset as it goes down. Unlike other database managers, AxleBase does not maintain unneeded objects in RAM for speed.

Finally, when the host app unloads him, he will again consume no RAM.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
Data Connectivity



AxleBase is designed to be embedded inside a host application. He talks directly to the host. As soon as he is installed, the host application can send commands to him.

He provides his own interface for programming. No driver is needed. No provider is needed.

If AxleBase is embedded in a server, then the server will, of course, need an ODBC driver. The AxleBase interface is designed to support the ODBC protocol.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
Indexing



AxleBase indexing is different.

A database manager cannot be optimized for both the large and the ordinary. One or the other must suffer, so AxleBase is internally optimized for very large data object indices. Since AxleBase is not intended for heavy concurrent access, the degradation on very small tables may not be noticable, but the improvement on very large tables will be obvious.

Usually, boolean columns should not be indexed. When a boolean column is indexed, reading its index and then reading the table takes longer than a table scan. However, the inclusion of a boolean colum in a multi-column index can sometimes be very wise.

Indexing a very large AxleBase table can have a tremendous positive impact on speed. Scanning a twenty billion row table for a value can take many days or weeks. An index can sometimes reduce those days to a fraction of a second.

( See the test section of the Introduction chapter for query tests. )

The AxleBase approach to indexing is unlike that of ordinary database managers. This is necessary to optimize AxleBase for his specialized abilities.

A management method that sometimes appeals to the DBA is to index every column in the database, but that can slow some operations in a very large database. Since the slowed operations in normal databases are not heavily used by most people, the cost is seldom noticed. For example, if it takes two thousandths of a second to insert a row instead of one thousandth of a second, nobody notices.

But what happens if the database manager is handling a truly large table? One thousandth of a second per row will add a week to the construction of a billion-row table. And if the table will become very big, that millisecond can turn into weeks or months.

The big name brands also sometimes use that approach. In some cases, a database manager will automatically create an index without the knowledge of the DBA. However, to do that in an AxleBase database could be disastrous simply because AxleBase is designed for the management of very large data objects. Therefore, the DBA can expect no unexplained gain in speed as sometimes happens with a big name brand.

AxleBase can index virtual tables which use external files and tables.

Th AxleBase query optimizer will combine indices as needed, but will not divide a multi-column index. When a query uses one column of a multi-column index, other database managers will split that column out of the index and use it in the query. AxleBase requires that the single column have its own index. (This may be re-evaluated in the future, but index division can slow queries of very large tables.)

However, the DBA should not use only single-column indices. A multi-column index is faster than multiple single-column indices, and the query optimizer knows that, so it mixes and matches as needed.

AxleBase has special tools to help the DBA with building and indexing. A high speed table build, such as with the arrayed insert, while building its index will slow the build greatly. Dramatic speed improvement can sometimes be attained by first building table segments and then indexing completed segments in a separate operation.

A normal table build usually hides the slow speed caused by indexing because the system spends much time just waiting for work. It is therefore sometimes advisable to allow the index to build during the table build for normal slow operations so that it can be immediately used.

AxleBase recognizes complex relationships between data characteristics, data object size, and the environment. He also knows that the characteristics of that data may change in ways that are important but are too subtle for a human to detect. He uses specialized internal algorithms that help him decide upon the best way to index each data object for the fastest build speed and the fastest index concomitant with his specialized mission objectives.

Before indexing a table segment, he analyzes the entire segment to choose the best options for it. If the segment has little or no data, then AxleBase makes his best guess about how to index it, but it is only a guess, so in that case, the index for that segment should be rebuilt after the segment is filled.

Some analysis operations use the buffer to determine the characteristics of the final index. The larger the buffer, as long as it is not too large for the hardware, the more efficient will be those indices after they are built.

When possible, the fastest insert and index operation, by far, is attained by first completely populating a segment and then indexing it afterwards. Creating an index as a table is built will result in much slower indices.

If the system stops or has a problem whilce indexing a segment, then the entire index for that segment must be restarted.

Reading a table that has been partially indexed may result in data being missed until that data is indexed. Therefore, in a very large database that is being built over a long period and which must be used during that period, it may be prudent to bring each table segment on line only after it is fully populated and entirely indexed.

See also the VLDB Addendum to the CreateIndex command, and the ShowIndices command in the API chapter.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
Remote Access And Paths



AxleBase is designed for the host, so he will always be running on the same machine on which his host is running. The objects that he creates are expected to be used only by his host on the local machine.

There will be times, however, when it is desirable to share local data with remote locations and the organization does not want to build a database server into their host. In such a case, domains and databases can be shared across a network without a database server.

Objects are shared after they are created. If a database is to be shared, then its controlling domain must also be shared.

The ShareDatabase and the ShareDomain commands are covered in the API chapter.

Of course, sharing in that manner obviates security controls.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
Database & System Design



Let us take an extremely complex subject which includes the broad areas of process design, application design, database design, etc., and pack it into a few paragraphs here and pretend that such simplicity reflects real life.

AxleBase is designed for high speed operation of compact databases.

When designing complex databases, design assistance may be obtained from the CoreModel tool at http://www.CoreModel.com . CoreModel is a professional quality database design tool.

While designing an installation, these features may help:
     
1 AxleBase supports multiple database domains in an installation.
2 Each domain supports multiple client databases.
3 Distribution across multiple spindles and computers is supported for speed.
4 Its domain/client database structure can help organize and control.
5 Multiple host apps can each run its own AxleBase instance against the databases.
6 A host app can tell its AxleBase to create multiple database manager instances, each of which will configure itself independently on the fly.
7 Each of those database manager instances can point to a different database.
8 The master app can use all of those instances simultaneously.
9 Each database manager instance can support any number of data objects which can operate independently.

There are only two objects in the AxleBase interface, the Manager object and the data Vector object. The following sections will address the nuts and bolts of their use. A recommended method is usually to instantiate a single copy of the database manager, use that one object throughout the system, and destroy on shutdown. (See the ShutDown command in the API chapter.)

However, if the application requires continual high speed support of many clients, many instances of the database manager object can be created every second with each working on a different database task and perhaps various copies working on different databases. ( Such intensive and complex database operations require large hardware investments and coding care to avoid memory leaks.)

The AxleBase data Vector object performs queries and returns data. In most cases, it is a good idea to destroy this object immediately after every use. However, for a high speed multi-cycle operation, the interface provides a means for continuous operation of a data object.

Hardware is an important factor in any database operation and AxleBase is no exception. Because he is designed for extremely large data returns, AxleBase does not build datasets in RAM.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
The Database Domain



AxleBase manages databases by grouping them into domains. The attributes and data for each domain are stored in the domain's database, and the host application's data is stored in the client-production-working databases.

A database domain is opened by the Manager object according to the attributes stored in the domain database. It does that by reading the attributes and using them to configure itself. After the domain is active, its client databases can be opened.

A domain may be opened regardless of whether or not it exists. If it does not exist, and the specified location is valid, AxleBase initializes a new domain database for the domain at that location. After a domain is opened, its client databases may be created. If the domain and its clients already exist, after the domain is opened, its clients may be opened.

Pseudo Code Example:
1.     dim oMgr as Manager
2.     set oMgr = new Manager
3.     o.OpenDomain "\path\demoDom\"
4.     o.OpenDatabase "prodClient3"

In steps 1 and 2 above, a new Manager object is created. The new Manager object is named oMgr in the example, but can be named anything appropriate. In step 3, oMgr is told to open the domain which is named demoDom. In step 4, oMgr is told to open the client database named prodClient3. oMgr is then ready to work with the prodClient3 database.

A database domain may be distributed across spindles, controllers, and computers. The client databases are not required to be on the same medium and may be located as desired. The same is true of other objects as covered in subsequent sections.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
Concurrent Operations



Concurrent users of a database server may not present much of a problem because all go through the same interface and the server can control them. AxleBase is not a server. It was designed to be embedded in other apps. Therefore, many people or systems can be hitting the same database and the same table simultaneously.

In that situation, the instances might bump into each other, trying to lock each other out, and trying to update the same data with catastrophic results.

Although he is not a server, AxleBase was designed with the concurrency problem in mind. If the app in which AxleBase is embedded is a database server, using AxleBase as the engine, then the problem is solved. However if the host is not a server, it can still take advantage of the AxleBase features to work with many other users and apps in the same database.

In a low speed or a low usage situation, the host probably needs to do nothing. The Testing section of the Introduction chapter presents the results of concurrency stress tests. As can be seen from those results, AxleBase may handle quite a load with no outside assistance.

In a high traffic situation, the host should be prepared to react to reports from AxleBase. One such report could be a lock timeout. When instance A tries to use a table, he normally runs through it without ado. However, if instance B has the table locked for an operation, instance A cannot use it, so he immediately stops, identifies the problem, checks the query timeout setting, and begins waiting.

While waiting, instance A periodically rechecks the table to see if it has been released. If he gains access to the table, he proceeds as usual. If he cannot gain access, and the duration of the wait exceeds the timeout setting, he aborts the process and returns an error message.

A query timeout is not actually an error. Although it generates an error message, a query timeout error is actually just a report that a data object could not be accessed within the specified time. A lock timeout is usually simply indicative of heavy traffic on a computer.

Note that there can be no queuing since there is no server. The first instance to encounter the lock might be the first to gain access when the lock is released, or it might not. For reasons beyond the scope of this documentation, that design is intentional.

A decision should be made during the design of the host app concerning what the host should do when AxleBase reports a lock timeout.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
Coding Tips & Techniques



AxleBase tries to make life as easy as possible for the developer. (Unencumbered by managers or by a marketing department, AxleBase's developer is building a system for people like himself.)

Character case is usually unimportant. Do it the way that you want. The system will accept anything and try to standardize internally for you.

If white space is required for delimitation, be sure that at least one character is present. Otherwise, use it as you want and AxleBase will clean up after you.

Speaking of white space, AxleBase does not store space padding. He trims leading and trailing spaces from data before saving it. All in-code comparisons must be constructed accordingly. This is not ANSI SQL-92 compliant, but I do not plan to change it.

Where parentheses, commas, colons, etc., are used, such as in standard SQL commands, be sure that they are present. However, do not be overly concerned about the presence or absence of a space before or after a parenthesis or a comma or whatever. Wherever possible, AxleBase attempts to read what you mean and not what you write.

AxleBase will accept formatting in a SQL command. Most of us format long SQL statements with paragraphs etc. so that we can understand them when they quit working six months later.

Never use an undocumented feature that you might stumble across. Such features tend to change or go away during development.

AxleBase does not return nulls. If a value is null, there is nothing to return, so he returns nothing.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
Important Coding Note



I am just plain tired of my own inability to use bad logic, regardless of how many people support it. After many years of programming, I am well aware that the zeroth element is how the programming community identifies the first element of a set, but that is far from logical.

Of course, it is possible to become comfortable with logical flaws, as evidenced by the many old programmers around the world. And it is possible to aspire to poor logic, as evidenced by the many young wannabe programmers.

Therefore, AxleBase reports the first element of a set as the first element. The number of elements in a set is the number of elements in the set. The number of elements in a set is not the number of elements in the set minus one.

If you want the fourth row, tell AxleBase that you want row number 4; not row number 3. If you want the first row, tell AxleBase that you want row number 1; not row number 0.

( Please look at the absolute stupidity of that last paragraph to see why I am adamant about this matter.)

I am hoping that few thinking people will object to this particular deviation from an industry standard. The fact that something is accepted, commonplace, and standard sometimes means only that millions of people are equally stupid.

( If this becomes the accepted way of the industry, then this section will be removed from the documentation.)

Additionally, where a command tells AxleBase whether or not to do something, he requires a yes or no. The state may or may not become true or false after the command is executed, but that state is after the command is submitted.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
The AxleBase API



There are two objects in the AxleBase programming interface. Each is covered in the following sub-sections.

AxleBase is just another DLL on the computer. When he is installed on a computer, his programming interface is immediately available to any host system. If you know how to use Windows objects in your code, then you can use AxleBase. He runs as a COM server inside a host system and only inside a host system.

His entire interface resides in two objects: The Manager object and the Vector object. The interface is immediately available when those objects are instantiated. Commands are sent to those two objects and all responses are from them.

The syntax that is used to instantiate the objects depends upon the language of the host system and how the developer wants to use the objects. If the developer wants a tightly coupled interface, then he can compile a reference to AxleBase within the host system. The code can then refer directly to the objects.

The AxHandle system does not have a reference compiled into it. The objects change so often in the development environment that a hard coded reference interfered with testing, so AxHandle creates the objects on the fly. An existing DLL can be unregistered, a new one placed where AxHandle can see it, and when AxHandle starts, he registers the new one and creates objects on the fly.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
The Manager Object



The Manager object handles the management and administrative affairs of databases and domains. He creates domains, databases, tables, etc.; destroys objects; maintains them; handles security; performs backups and purges; etc. (Data is handled by the other object.)

Depending upon the language, using the Manager object follows this pattern:
      Declare the object.
      Instantiate the object.
      Pass the command.
      Check for error messages.
      Destroy the object.

A database must be opened before any action can be taken on it. If it does not exist, it must be created and opened.

Before a database can be opened, the appropriate database domain must be opened. After a domain is opened, its databases can be opened.

Opening a database requires the execution of thousands of lines of code and many disk reads and writes. When the same database will be opened and closed repeatedly throughout the host system, a developer may decide to open and configure a Manager once at the top of his code and close it only as the host prepares to shut down.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
The data Vector Object



The Vector object handles data. He updates, inserts, deletes, retrieves, etc. He is the system vector for data. SQL queries such as select, insert, update, and delete are passed to him to tell him what to manipulate or return. The Vector object is a vector in both the mathematical and biological sense.

There are two ways to create a data Vector object. One uses an object creation command such as the VB CreateObject command, and the other way tells a Manager object to create it.

Creating it outside a Manager object creates a free-standing object which is sometimes referred to as a disconnected dataset. This allows it to remain active after the Manager object is unloaded for continued access to its dataset.

A free-standing Vector object is connected to a database by passing it a reference to the Manager object which has opened the database. (For command syntax, see the API chapter's Data section and the Connect sub-section.)

When the other method is used, a Manager object is told to create a Vector object. The Manager object should already have an open database to which it will connect the data Vector object, and it will then assist with managing the object. Each Manager object can create any number of Vector objects and each may be in use. ( For command syntax, see the API chapter, Manager section, DataObjectCreate command. )

In either case, a Manager object may support any number of data Vector objects.

The AxHandle system was creating free-standing Data objects at one time. Since the Manager object can now handle the job, AxHandle now first creates a Manager object and then tells it to create a Vector object as needed.

A line of code from AxHandle which creates a free-standing object:

Set oData = CreateObject("AxleBase.Vector")
This creates a Data object named oData which must be connected before it can be used.

A line of code from AxHandle which tells the Manager to create an object:

Set oData = goMgr . DataObjectCreate
This also creates an object named oData and which is already connected to the Manager that created it.

Depending on the language, using the data object may follow this pattern:
      Declare the Manager object.
      Instantiate the Manager object.
      Open the database domain.
      Open the target database.
      Check for error messages.
      Declare the Vector object.
      Instantiate the Vector object.
      Connect Vector object to the Manager.
      Pass the SQL command to the Vector object.
      Check for error messages.
      Do the job.
      Destroy the Vector object.
      Destroy the Manager object.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
System Identifiers



( ! The identifiers that are generated are linked ONLY to that which is stated. The systems that I build do not secretly obtain, store, or transmit any information about you or anything that you own! Simply because He for whom I work commanded us to not be deceitful with each other.)

The system contains the following object and process identifiers which are available to the host through the API.
      instance ID
      vector name
      domain connection ID
      database connection ID
      domain ID
      database ID
      table ID
      host computer name
      operator name

The identifiers (ID's) are in addition to names that are assigned to objects by human operators. All identifiers are unique. They are generated by AxleBase.

A vector name may be assigned by the host. If a vector name is not assigned by the host, it will be assigned by the system. The vector name is unique when assigned by the system.

Identifiers are stored only for permanent objects such as a database. They are stored only as part of the object's properties. When a transient object dies, such as a connection, it's identifier dies. When a permanent object is destroyed, such as a table, it's identifier is destroyed.

Note the excessive amount of identification. It is provided because the differences between some of the objects are subtle but important while the system is active. Not only do the identifiers provide control, they can be helpful in debugging.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
Visual Basic Examples



Visual Basic code to open a database might look something like this:
      dim oMgr as Manager
      set oMgr = new Manager
      sReturn = oMgr . OpenDomain ( "c:\domain\" )
      sReturn = oMgr . OpenDatabase ( "mydb" )
      sReturn = oMgr . ShutDown
      set oMgr = nothing

Visual Basic code to open a client database and run queries might look something like this:
      dim oMgr as Manager
      set oMgr = new Manager
      sReturn = oMgr . OpenDomain ( "c:\axlebase\db\" )
      sReturn = oMgr . OpenDatabase ( "mydb" )
      dim oQuery as Vector
      set oQuery = new Vector
      sReturn = oQuery.Connect( oMgr )
      sReturn = oQuery.ExecuteSql ("select * from myTable")
      for i =1 to oQuery.TupleCount
      sVariable = oQuery.ColumnContents ( 1, i )
      next i
      set oQuery = nothing
      sReturn = oMgr . ShutDown
      set oMgr = nothing





Embedding And Running AxleBase
Designing and Coding
Sub-Section
Microsoft Access Examples



See the previous Visual Basic examples.





Embedding And Running AxleBase
Designing and Coding
Sub-Section
WinBatch Examples



WinBatch code to open and/or create a database would resemble the following. ( Some code lines are broken for readability. )


; first, create the AxleBase database object
oMgr = ObjectOpen("AxleBase.Manager")

#DefineFunction fnInitializeDatabase(oMgr, sDatabase)
      sSql = ""
      sSql = strCat( sSql, "CREATE TABLE T_TEST ( ")
      sSql = strCat( sSql, "PROCESS string ( 20 ) , ")
      sSql = strCat( sSql, "PARAM_NAME string ( 35 ) , ")
      sSql = strCat( sSql, "PARAM_VALUE ( 30 ) )")
      sReturn = oMgr . CreateTable( sSql )
      if sReturn <> "" then goto unloader
      sSql = ""
      sSql = strCat( sSql, "CREATE TABLE T_LOG ( " )
      sSql = strCat( sSql, "DATE_TIME string ( 30 ) , " )
      sSql = strCat( sSql, "PROCESS string ( 20 ) , " )
      sSql = strCat( sSql, "LOG_NOTE string ( 50 ) )")
      sReturn = oMgr . CreateTable( sSql )
      if sReturn <> "" then goto unloader
      :unloader
      return sReturn
#EndFunction

#DefineFunction fnOpenDatabase(oMgr,
            sMasterDatabase, sDatabase)
      sReturn = oMgr . OpenDomain( sMasterDatabase )
      if sReturn <> "" then goto unloader
      sReturn = oMgr . ShowDatabases
          if sReturn == ""
          sReturn = oMgr . CreateDatabase( sDatabase )
          if sReturn <> "" then goto unloader
      else
          iFound = StrIndex( sReturn,
            sDatabase, 1, @FWDSCAN )
          if iFound < 1
              sReturn = oMgr . CreateDatabase( sDatabase )
              if sReturn <> "" then goto unloader
          endif
      endif
      sReturn = oMgr . OpenDatabase( sDatabase )
      if sReturn <> "" then goto unloader
      sReturn = oMgr . ShowTables
      if sReturn == ""
          sReturn = fnInitializeDatabase(oMgr, sDatabase)
          if sReturn <> "" then goto unloader
      else
          ; could also check here for specific tables
      endif
      :unloader
      return sReturn
#EndFunction

#DefineFunction fnReadData( oMgr, )

      ; first, create an AxleBase data object
      LastError( )
      oDs = ObjectOpen("AxleBase.Vector")
      iErr = LastError( )
      if iErr != 0
          sReturn = "Failed to create an AxleBase DataSet object."
          goto unloader
      endif

      ; set the data connection for the dataset
      ; Winbatch can't handle complex objects
      ; so tell the object to set its own connection
      ; This feature was added and will be in the next release.
      sReturn = oDs.Connect( oMgr )
      if sReturn <> "" then goto cleanup

      sReturn = oDs.ExecuteSql( "Select count(*) from myTable" )
      if sReturn <> ""
          ; a count can return a number as an error
          if isnumber(sReturn) then
          if sReturn < 0 then sReturn =
          "**ERROR: The AxleBase database manager
          returned an
          error during the data retrieval."
          endif
          if StrSub( sReturn, 1, 8) == "**ERROR:"
          then goto cleanup
      endif

      i = oDs.tupleCount
      if i < 1 then goto cleanup

      sReturn = oDs.tuple

:cleanup
      objectClose( oDs )

:unloader
      return sReturn
#EndFunction

sReturn = fnOpenDatabase( oMgr, "c:\db", "c:\db\thisApp" )
; the above will open the database.
; if it does not exist, the function will create it.
if sReturn <> "" then goto unloader

; close the AxleBase database object
ObjectClose(oMgr)





_________________________
Embedding And Running AxleBase
Section
System Lock Design





Embedding And Running AxleBase
System Lock Design
Sub-Section
General



The AxleBase locking mechanism is designed to support his very special objectives which include very large data entities and low client concurrency. For exaple, if an AxleBase instance needs to use an index, he suspends other operations until finished with the index, applies the appropriate lock to the entire index, does the operation, and unlocks the index. This results in faster over-all operation in the AxleBase enviornment.

Locks have precedence over security grants.





Embedding And Running AxleBase
System Lock Design
Sub-Section
AxleBase Lock Space Domains



Domain Description
D Discretionary.
P Persisted.
A Autonomic.

A lock space domain is a concept and is not a functional object. Its application to the subject helps describe how the system actually works.

Discretionary Lock Domain

Discretionary locks may be applied and removed by the host or user at any time by using the LockObject command. For example, the DBA might lock the database in preparation for a backup. That type of lock will exist until the user exits, or the user removes the lock, or the lock expires. If an instance abends and leaves a discretionary lock, it will be ignored after it expires and will be removed by the next system purge.

Persisted Lock Domain

Persisted locks are similar to discrtionay locks because they are set by the human or host app as desired. The difference is that they are object attributes and, therefore, are persisted indefinitely. They are controlled by the AlterTableAttribute, AlterDatabaseAttribute, and the AlterDomainAttribute commands.

The distributed architecture and independent nature of the AxleBase instances requires disk storage of discretionary as well as persisted locks.

Autonomic Lock Domain

Autonomic locks are system locks and are introduced only to complete the picture. They are seldom noticed and are visible only when a desired action is denied because of a system lock. A complete description of the autonomic locks would require separate documentation.

AxleBase is continually applying and removing autonomic locks during any operation. The autonomic locks are applied and removed by the system as needed to support user activity. The previous index example used an autonomic lock.

Share locking is used whenever possible. Share locks permit simultaneous reads, but prevent writes to the object while it is being read. In some areas, such as small system tables, he uses only write locks to preclude all reads until the write is complete and employs spinlocking to prevent read failures.

Autonomic locks allow data updates to use dirty reads or read-through locks which allows the data to be read during an update. They increase speed and are used with success in many database manager brands. A row update failure is not retried. If the update fails, an error is returned and the host or user is expected to take the appropriate action. Row updates are checked by rereads.

Discretionary locks, persisted locks, and autonomic locks are operationally integrated and respect each other. Autonomic locks take precedence, but discretionary and persisted locks honor each other.





Embedding And Running AxleBase
System Lock Design
Sub-Section
Concurrency Locking



Before addressing concurrency, it is important to observe a few very important facts in the AxleBase operation.
      Extremely large tables are involved and each may be distributed across a network.
      A database may be directly accessed by many remotely located systems.
      The system may be a distributed database manager whose components may simultaneously access tables at high speed.
      The entire system must run on desktop computers.

Concurrency is handled entirely by autonomic locks. Their activity is never registered in the lock tables since they are answerable only to each other, but they generate error messages appropriate to each concurrency problem. The host must be prepared to react to those error messages.

An important part of concurrency control is the spinlock value which may be adjusted by the DBA. When an instance encounters an object with a system lock, it performs a spinlock until the object is available up to the specified interval. If the object is not released in that period, the instance executes an access failure. The spinlock value must be neither too large nor too small to adequately support concurrency for each environment. (See the Spinlock section of the Configuration chapter.)

The query timeout is used in a way that is similar to the spinlock. In general, the query timout is applied to a table object and the spinlock value is applied to system objects.

As AxleBase operates, he uses many kinds of locks on various objects and sometimes locks objects similtaneously and sometimes sequentially in a single operation. It is, therefore, difficult to describe the operations in a small document. In general, he uses share locks for reads and exclusive locks for data updates, but that is only a general statement.

When he begins reading a table, he places share locks on all of the objects that constitute a table. As he finishes with each object, he removes the lock. Therefore, it is possible that a complex query could, in some situations, be interrupted by another instance putting a write lock on the table's index or pointer table, for example. That could happen if the query accessed the index multiple times. It might also happen if the table has billions of rows because its pointers are accessed every one hundred segments. Although unlikely, those events are possible. Tests, however, show AxleBase performing well at his design objective of low concurrency.

The requirements of updates are more complex than those of reads. Keep in mind the fact that AxleBase must be prepared to update petabyte-sized tables. The rows must be located that will be updated and then read like a query. Then they must be prepared for the update, and then the new rows must be committed, and finally, the old rows must be deleted. The easiest way would be to lock the entire table and all of its component objects, and that will work for small tables, but that would ruin concurrency in very large tables, so it is not a viable option for AxleBase. Traditional transactions were considered, but they are unwanted because they would slow operations.

The AxleBase solution for updates is to update with shared locking. All of the rows are found and read and new rows are constructed. Then the writes begin. The new updated rows are all added to the table and the old ones are then. For very large tables, all segment updates are performed simultaneously for the entire table.

Notice that a reader can jump into the middle of an update and read a row before the update is committed. That is because the primary objective of AxleBase is data storage and OLTP, on line transaction processing, is secondary. The AxleBase position is that data may change now, five minutes from now, or next week, and the reader must know that fact regardless of when it changes.

A simple insert is another matter. If it is a normal insert, which is usually a relatively small number of rows, it will be a quick operation, and locks will usually not even be noticed. If it is a very large table build, then the DBA wants a high speed operation so that millions of rows can be inserted around the clock and may even build off site. In either case, a write lock is needed, so a write lock is placed on each table segment until the write is complete or until the segment is filled.

Note that those concurrency locks are not recorded and will not show up in the ShowLocks report. All of those lock operations are expected to be far quicker than the generation of a report. Even the build of a very large table uses quick intermittent locking.

(See the Testing section for results of concurrency stress tests.)





Embedding And Running AxleBase
System Lock Design
Sub-Section
AxleBase Lock Granularity



Level Description Domain Control
1 db domain D, P
2 database D, P
3 table A, P
4 segment A
5 column P
6 row A, P
7 file A

Column and row level granularity are not functional. They may be considered later, but they do not presently seem to be consonant with the unusual objectives of AxleBase.

Locks may be placed at each level, but are vertically additive through the object hierarchy. For example, an operation involving a table will apply locks for the table, database, and domain before attempting the operation. An operation at the database level will first check both the database and the domain locks.





Embedding And Running AxleBase
System Lock Design
Sub-Section
Lock Types



Code Description Domain Level
c create P 1,2,3
r read P 1,2,3
u update P 1,2,3
d delete P 1,2,3
e execute P 1,2
x exclusive D 1,2
i in use A  
z system A  

The lock types follow an extended crud model. Each is a denial of a type of service. They are additive and multiple types may be set simultaneously. They are also additive hierarchically, so no level over-rides another. (Note that the denial of service is unlike the security system which grants service.)

A type x exclusive lock takes an object offline and locks out all other users and processes until it is removed.

A lock type may be used in multiple levels and multiple lock domains. For example, an exclusive lock is discretionary and not persisted. A "z" lock is the only system lock that may sometimes appear as an explicit code.





_________________________
Embedding And Running AxleBase
Section
Column-Data Types





Embedding And Running AxleBase
Column-Data Types
Sub-Section
General



A column-data type is neither a column type nor a data type, but is a combination of the two. They agree in most cases, so we tend to refer to them as one or the other, but the technical difference should be remembered because the two are not always the same.

AxleBase data storage is in human readable form regardless of data type.

If you have a favorite name-brand database manager, there is a comparison table in the Data Type sub-section of the Virtual Databases chapter. (If a type in your current database manager is not shown, send a note because I have only worked with a dozen or so different brands. )





Embedding And Running AxleBase
Column-Data Types
Sub-Section
Blob



BLOB is an abbreviation for Binary Large OBject. A blob can be anything that can be stored by a computer in a file. It is therefore, not considered data. It might be a photograph, music, text, etc. A BLOB is any object that can be retrieved and manipulated by software that is specially built for that type of object.

Every BLOB in the database has a handle which completely and uniquely identifies the BLOB and which completely and uniquely identifies its location. The BlobHandle in the Windows operating system is the path and name.

A query for the BLOB object will return its handle which is a pointer. The pointer can be used by BLOB handling software to load the BLOB object. AxleBase may be embedded in the BLOB handler or the handler can use a different host to do the querying.

The blob column width is discretionary because it must be able to contain the entire BlobHandle. Other characteristics are identical to the STRING type.

The operation of this type is unlike any of the others.
        A row may be inserted with an empty BlobHandle.
        A BLOB type is nullable.
        BlobHandles must be delimited like string data.
        Before deleting a row, the BLOB must be destroyed by setting its value to null or to a blank string.
        When a row is inserted or updated, the BLOB object is validated; i.e., the BlobHandle must identify an existing BLOB object.
        Table drops and database drops do NOT destroy BLOB's.
        Table truncations do NOT destroy BLOB's.
        Row deletes do NOT destroy BLOB's.
        Any system may use a standard SQL query to request a BLOB. The return will be the BlobHandle.





Embedding And Running AxleBase
Column-Data Types
Sub-Section
Boolean



The boolean type has only two value states which specify affirmation and negation.

Columns are defined as boolean with no length. The boolean type is stored as a single numeric character of either a 1 or a 0. The one is affirmative and the zero is negative.

The following boolean values are recognized by AxleBase in SQL statements.

true false
yes no
1 0
               

Name Max Size Return Size
BOOLEAN 0 1





Embedding And Running AxleBase
Column-Data Types
Sub-Section
Date



Columns are defined as date with no length. Storage and return are in the standard coredate format which has been truncated to its leftmost eight digits; i.e., YYYYMMDD; e.g, 19620130, which many people read as January 30, 1962 or perhaps as 30 January 62.

Since the DATE type is a truncated version of the coredate protocol, it has lost the BC descriptor character. If dates BC are required, then the standard DATETIME type or the standard DATETIMEX type must be used.

The DATE type is based upon the coredate protocol which may be found in the appendices.

All operations use the truncated coredate format. The convert function may be used to reformat other date formats.

See also DATETIME, DATETIMEX, TIME, and TIMEX data types.

( Storage is in human readable form without tokenization in consonance with the AxleBase design objectives.)

Name Max Size Return Size
DATE 0 8





Embedding And Running AxleBase
Column-Data Types
Sub-Section
Datetime



Columns are defined as datetime with no length. Storage and return are in the standard sixteen digit coredate format; i.e., YYYYMMDDHHMMSSNN; e.g. 2010012410230400, which many people read as January 24, 2010 at 10 23 04 AM or perhaps as 24 January 10, 10 23 04 AM.

The coredate protocol specifies that the final character of the string may be a digit or a minus sign descriptor character. If it is a digit value, the date is AD; if it is a minus sign, the date is BC.

The last two digits are decimal parts of a second. Tenths and hundredths. If greater precision is required, see the DATETIMEX type.

The acceptable DATETIME range is from 99990101 BC to 99991231 AD. Dates outside that twenty thousand year range must be stored as STRING types.

The DATETIME type is based upon the coredate protocol which may be found in the appendices.

All operations use the standard coredate format. The convert function may be used to reformat other date formats.

See also DATE, DATETIMEX, TIME, and TIMEX data types and the protocol appendix.

( Storage is in human readable form without tokenization in consonance with the AxleBase design objectives.)

Name Max Size Return Size
DATETIME 0 16





Embedding And Running AxleBase
Column-Data Types
Sub-Section
Datetimex



Columns are defined as datetimex with no length. Storage and return are in the standard extended twenty one digit coredate format without the optional time zone designator; i.e., YYYYMMDDHHMMSSNNNNNNN; e.g. 201001241023040062384, which many people read as January 24, 2010 at 10 23 04 AM or perhaps as 24 January 10, 10 23 04 AM.

The coredate protocol specifies that the final character of the string may be a digit or a minus sign descriptor character. If it is a digit value, the date is AD; if it is a minus sign, the date is BC.

The acceptable DATETIMEX range is from 99990101 BC to 99991231 AD. Dates outside that twenty thousand year range must be stored as STRING types.

The last seven numeric characters are decimal parts of a second. Accuracy is limited to one millionth of a second.

The DATETIMEX type is based upon the coredate protocol which may be found in the appendices.

All operations use the standard extended coredate format. The convert function may be used to reformat other date formats.

See also DATE, DATETIME, TIME, and TIMEX data types.

( Storage is in human readable form without tokenization in consonance with the AxleBase design objectives.)

Name Max Size Return Size
DATETIMEX 0 21





Embedding And Running AxleBase
Column-Data Types
Sub-Section
Integer



A column width should not be specified for this type. The actual storage width is 20 characters.

The INTEGER data type accepts any literal printable whole number up to twenty characters which may include a minus sign. Commas are disallowed.

The INTEGER data type was added to speed indexing because indexing the numeric type is far slower and the operation of the indices is slower.

AxleBase does not tokenize, categorize, segregate or alter numbers. They are stored as literal strings.

The twenty characters sets the maximum size. If the number of characters in a integer exceeds twenty, the number is truncated to the left-most twenty characters. Therefore, a number may be no larger than 99, 999, 999, 999, 999, 999, 999, and no smaller than -9, 999, 999, 999, 999, 999, 999.

See also the NUMERIC data type.

( Storage is in human readable form without tokenization in consonance with the AxleBase design objectives.)

Name Max Size Return Size
NUMERIC 0 20





Embedding And Running AxleBase
Column-Data Types
Sub-Section
Numeric



A column width should not be specified for this type. The actual storage width is 20 characters.

The NUMERIC data type accepts any literal printable number up to twenty characters which may include a sign and a decimal point. Decimals must follow the American standard. Symbolic representation is not acceptable. Commas are disallowed.

Where possible, the INTEGER type is recommended for speed. The INTEGER data type was added to speed indexing because indexing the numeric type is far slower and the operation of the resulting indices is slower.

AxleBase does not tokenize, categorize, segregate or alter numbers. Thus, float, decimal, tinyint, bigint, integer, plus, minus, etc. ad infinitum, are all stored as the numeric type. This also means that AxleBase respects precision. If a fifteen decimal place number is handed to AxleBase, he precisely stores all fifteen places.

The twenty characters set the value limit and precision of the number. If the character count in a number exceeds twenty, the number is truncated to the left-most twenty characters.

max value 99, 999, 999, 999, 999, 999, 999
min value -9, 999, 999, 999, 999, 999, 999
precision .000,000,000,000,000,000,1

See also the INTEGER data type.

( Storage is in human readable form without tokenization in consonance with the AxleBase design objectives.)

Name Max Size Return Size
NUMERIC 0 20





Embedding And Running AxleBase
Column-Data Types
Sub-Section
Serial



A column width should not be specified for this type. The actual storage width is 20 characters. A table can have only one serial type.

The serial type is numeric and is maintained by the system. Each row of a column may be expected to have a unique numeric value for that column and row. Values are incremented for each new row, but are not necessarily consecutive and cannot be predicted.

Where the system requires a value, such as in an arrayed insert, any value or a null value may be specified, and the actual insert will become a system-generated value.

A speed increase may be achieved in some cases by using a SERIAL column as the table key. This is certainly true where a table requires a key and there are no unique indices in it. Consistent with the AxleBase objectives, this column is not automatically indexed as some database managers do. The database administrator makes those decisions.

The values may be expected to be unique through the entire column across segment boundaries. However, be cautious of assuming uniqeness in every serial column. Virtual concatenated tables, for example, will certainly not be unique, and there are other exceptions.

At this time, the maximumn value for each column is 1x10^16 including deleted rows.

To add a serial column to a table that is in production :
      Back up the database.
      Copy the table file to another location.
      Drop the table.
      Create the table with the serial column.
      Import data from the copy.
      Re-index.

Name Max Size Return Size
SERIAL 0 20





Embedding And Running AxleBase
Column-Data Types
Sub-Section
String



It is called STRING because it is any string of characters including the IBM ASCII extension. The maximum length must be specified when creating a table, and that will become the enforced width of the column.

(This type is sometimes referred to as "alphanumeric", which is fine as long as we remember that the AxleBase system can also includes all of the other characters.)

Control characters and control strings are removed from string data before it is inserted into a database to safeguard the database. Therefore, it is better to store strings containing any extended or unprintable ASCII characters as BLOB data.

AxleBase trims leading and trailing white space in and out. (Since this is contrary to the ANSI 92 standard, it may be revisited in the future.)

The maximum STRING length is determined by the maximum row length, which is approximately two gigabytes. For long STRING data, BLOB storage is sometimes a better management alternative.

Review the AxleBase Limits sub-section before designing data objects.

Name Max Size Return Size
STRING 2 gig defined





Embedding And Running AxleBase
Column-Data Types
Sub-Section
Time



Columns are defined as time with no length. Storage and return are in the standard coredate format which has been truncated to its six digit time; i.e., HHMMSS; e.g. 202304, which many people read as 8:23:04 P.M., or as 20:23:04.

For precision better than a second, see the TIMEX data type.

BC times cannot be stored in this data type. See the DATETIME and the DATETIMEX types for BC time storage.

The TIME type is based upon the coredate protocol which may be found in the appendices.

All operations use the truncated coredate format. The convert function may be used to reformat other date formats.

See also DATE, DATETIME, DATETIMEX, and TIMEX data types.

( Storage is in human readable form without tokenization in consonance with the AxleBase design objectives.)

Name Max Size Return Size
TIME 0 8





Embedding And Running AxleBase
Column-Data Types
Sub-Section
Timex



Columns are defined as timex with no length. Storage and return are in the extended coredate format which has been truncated to its thirteen digit time; i.e., HHMMSSNNNNNNN; e.g. 2023040060523, which many people read as 8:23:04 P.M., or as 20:23:04.

The last seven numeric characters are decimal parts of a second. Accuracy is limited to one millionth of a second. If accuracy of that depth is not needed, perhaps the TIME data type might be more viable for the application.

BC times cannot be stored in this data type. See the DATETIME and the DATETIMEX types for BC time storage.

The TIMEX type is based upon the coredate protocol which may be found in the appendices.

All operations use the truncated extended coredate format. The convert function may be used to reformat other date formats.

See also DATE, DATETIME, DATETIMEX, and TIME data types.

( Storage is in human readable form without tokenization in consonance with the AxleBase design objectives.)

Name Max Size Return Size
TIMEX 0 13





Virtual Databases
Characteristics
Sub-Section
Mapping From Other Brands



Unfortunately, I do not have time to study all of the products on the market. The following are some data types from a few of the more popular database managers with suggested data type mappings. If you do not recognize a source type, then you probably do not need to recognize it.

Source       AxleBase
alpha string
bfile blob
bigint numeric
bigserial numeric
binary blob
bit numeric
boolean boolean or string
byte numeric
bytea blob
char string
clob blob
currency string
date string
dateTime string
decimal numeric
double numeric
double precision numeric
float numeric
geometry blob
geometrycollection blob
image blob
int numeric
integer numeric
line blob
linestring blob
long numeric
long (Oracle) blob
longblob blob
longraw blob
longtext blob
longvarchar blob
lseg blob
mediumblob blob
mediumint numeric
mediumtext string
memo string or blob
money string
multilinestring blob
multipoint blob
multipolygon blob
nChar blob
nclob blob
number numeric
nText blob
nVarChar blob
OLE object blob
point blob
polygon blob
raw blob
real numeric
serial numeric
short numeric
single numeric
smallDateTime string
smallint numeric
text string or blob
time string
timeStamp string
tinyblob blob
tinyInt numeric
tinytext string
varBinary blob
varChar string
varchar2 string





_________________________
Embedding And Running AxleBase
Section
AxleBase Error Protocol





Embedding And Running AxleBase
AxleBase Error Protocol
Sub-Section
General



The host system is expected to be able to react to all error situations. AxleBase's deeply embedded nature precludes all GUI error messages, so all user interaction must be handled by the host system. If the host system is incapable of capturing errors which AxleBase returns, then Axlebase logging may be turned on to capture them.

All operations are capable of returning error messages as variable length character strings. If an unexpected return is detected, it is probably an error message. In any event, all returns should be inspected for an error notification.

The last error is stored and is not cleared until the next error overwrites it. The host system can clear that message. (The LastError functions are covered in the API chapter. )

If the activity log has been turned on, when an error message is returned, it is additionally written into the activity log. A message is sometimes written as multiple log rows. The first row always contains the header and the identifier. A logged error may be terminated by the entry, "End of error report.**".

For most errors, AxleBase will simply raise the error and abort the process. In any case, AxleBase will attempt to recover and continue operation through the error situation. In the event of a system crash, AxleBase will attempt to log the situation before going down, but that is not possible in some operating system crashes.

In the event that a table becomes corrupted beyond repair, and there are no backups, the host application may delete the table. AxleBase will re-initialize it and continue operations.

With Reservations :
      The completion of some operations may be desired regardless of errors. For example, a database drop quickly reaches a point where a halt would leave a mess of errors. If errors occur after that point, the system will attempt to work through them. The return will include a list of all errors and the first error will be a "completed with reservations" error.





Embedding And Running AxleBase
AxleBase Error Protocol
Sub-Section
Format Of The Return



Format of error messages:
**ERROR: [ type ]: [ source ]: AxleBase: msgID: text: [ addendum ]

The return consists of seven elements. The element separator consists of a colon and two spaces. Elements may sometimes be zero length. Note that only elements 1, 4, and 6 are required, but all separators are always present.

AxleBase may sometimes include responses from other systems in the addendum when those might be helpful. Therefore, when evaluating an error, the host should proceed from the header to avoid the confusion of appended responses.

The first element is the message header. The message header is always present and consists of the eight character string, "**ERROR:". No other type of AxleBase return will have that header.

If AxleBase can identify the type of error, the type may follow the header. Otherwise, the type may be blank. The type has variable content.

The source of the error follows the type. It is usually blank. The source is the source of the error message and not the cause of the error. The source has variable content.

So that the host can positively identify the message, the string "AxleBase" follows the source. Case will usually be as shown, but may be changed under some circumstances or by other systems.

The message identifier, msgId, is a five byte alpha-numeric identifier. It always follows the AxleBase identifier and precedes the text message. (During development this identifier is subject to change for any given error.) Host code that references specific errors must be reviewed when upgrading to a new release of AxleBase.

The "text" in the illustration is the literal text description. The error text is intended for human communication. Its text string is standard and associated with only one message identifier. To enhance human readability, text stings will sometimes contain characters 13 and 10 and white space for log formatting.

The addendum is additional explication that is sometimes added onto the string. It is intended to amplify the standard message. It is frequently an empty string.

A given message may be generated by various sources for various reasons and causes. Therefore, an error message may sometimes appear to be duplicated by some identifiers, sources, etc.





Embedding And Running AxleBase
AxleBase Error Protocol
Sub-Section
Show Exceptions



The exception master list is made available to the host application by the Manager object. Use the ShowErrorList command to return a list of all of the errors, or use the optional error number parameter to return the specified error.

Syntax:
ManagerObject.ShowErrorList errorNumber

Returns the message specified by errorNumber. If errorNumber is blank, the entire list is returned with each message terminated by characters 13 and 10, carriage return and line feed.

The identification number and the text are returned. The size of the entire list varies and depends upon the current system release. It may be fifteen to twenty thousand bytes.

Example:
dim oMgr as Manager as
set oMgr = New Manager
sReturn = oMgr . ShowErrorList

sReturn will contain the entire list.

Example:
dim oMgr as Manager as
set oMgr = New Manager
sReturn = oMgr . ShowErrorList "E3025"

sReturn will contain "E3025: Column width exceeds 60,000."

The interface also provides a means of recalling the last error.





_________________________
Embedding And Running AxleBase
Section
Security





Embedding And Running AxleBase
Security
Sub-Section
General



AxleBase security is designed to be:
      Unobtrusive.
      Multi-level.
      Segmented.
      Very tight.

It is unobtrusive because, unlike the big-name brands, AxleBase does not force the use of its security. AxleBase has been designed primarily for the kinds of databases that are usually accessible only by a few. A new AxleBase installation requires no security configuration, no passwords, no user setup, etc. Tables can be read as soon as they are created.

However, it is possible to design and implement an extremely complex security structure for an installation.

Since AxleBase is embedded, the host application and the host operating system are expected to share security responsibility.

Security features are effective only when the host is a database server. (See the Demonstration Database Server in the AxHandle chapter.) For example, password access means little when somebody can locally access the password file. By restricting access to remote connections, the database server completes the security.

AxleBase is designed to provide extreme security when it is needed. Implementing and administering AxleBase security can require a great deal of thought and time because it allows detailed and tight control.





Embedding And Running AxleBase
Security
Sub-Section
Security Toggle



AxleBase installs with security turned off. When he creates a domain or database, the object defaults open to all access.

The security toggle is the password for each object. As long as a domain or database has no password, there is no security for it. Giving it a password turns on security for it. Removing the password turns it off.

If a database has a master password, then access is restricted only for that database and for that entire database. That is true for each database.

Access can be restricted for the entire domain by setting a password on the domain. If a password is set on the domain and no database in the domain has a password, then entry into the domain will permit unlimited access to all databases in the domain.

The AlterDomainAttribute and the AlterDatabaseAttribute commands are used to set passwords. The password parameter in the "Configuration" chapter has guidance and examples.

If that were all of the security, then security would be a state of all or nothing. But finer granularity is provided by the GRANT and REVOKE commands. (See GRANT and REVOKE in the API chapter.)

Individual grants over-ride master passwords. If security is turned on for a database and an individual has been granted access to it, then the individual can enter the database without knowing the master password. However, that over-ride only allows passage through that level and gives access to objects only insofar as the grant allows.

The GRANT and REVOKE commands provide additional granularity. Providing the master password in the connection command is not what is usually desired because it immediately allows unconditional access to the object as an owner. When access is controlled by granted privileges, then those privileges are each explicitly granted to the individual.

The AxleBase GRANT and REVOKE commands allow control of domain and database ownership. For example, granting ownership to the domain allows the individual to use the GRANT and REVOKE commands. Before turning on security, insure that the administrators have been granted the necessary privileges.

Before turning on domain-level security, be sure that individuals have been granted access to the domain so that they can pass through it to get to their databases. To do that, create a grant to the domain with no privileges. The domain will recognize the individual and let him pass through. If the grant is made with a password, then the individual must enter his password before he can pass through.

Recommendation: Domain level security is not required for database level security. For the implementation of serious security for an installation, the domain level security may be turned on and configured in addition to the database security.





Embedding And Running AxleBase
Security
Sub-Section
Visibility Of Stops



A security stop is a refusal by the system to perform an operation for somebody who does not have the required permission/rights/clearance.

It is customary for high end database managers to hide security stops. That is not a bad thing and it certainly enhances security. However, millions of manhours have been wasted by hidden security stops. People who have a tendency to assume responsibility have spent endless hours debugging a healthy app because the database server simply had not been correctly updated by an administrator.

Additionally, security stops can sometimes hide valid problems. I have personally found problems in big-name brand systems which appeared to either be in my code or was a security problem.

Another problem is simply the complexity of all of the involved systems. Telling a DBA that you cannot access a table does not give him much information. The problem could simply be in your local network router. So security can be equally problematic on the server side.

AxleBase allows security stops to show. When the time comes to put the database into production, if security is a serious issue, the administrator can turn off the return of stops.

The value for each database and domain defaults to no. When security is turned on for an object, the value of HideSecurityStops should be evaluated. In a development environment, the value can be turned off in dev databases and turned on in prod.

Although a security stop is not a system error, it will be an error as far as the host system or operator is concerned, so security stops are returned as a error messages.

See also the "Hide Security Stops" section of the "Configuration" chapter.





Embedding And Running AxleBase
Security
Sub-Section
Canonical Permeability



AxleBase is designed to maintain canonical integrity at all times. Those who seek the undocumented tricks that can be done in other database managers will not find them.

Other systems have excellent security that was created for design objectives that are very different from those of AxleBase. Oracle's security is legendary although it uses canonical transparency. Ms. SQL Server has great security although it uses canonical permeability. So this is not to suggest that the canonical transparency or canonical permeability of Ms Sql and others is wrong. But AxleBase has chosen to strive for canonical integrity.

The closest that AxleBase might come to behaving like others would be in his virtual objects. Please refer to the Virtual Databases chapter.





Embedding And Running AxleBase
Security
Sub-Section
The Architecture's Impact



The architecture of an AxleBase installation is designed to present multiple levels of administrative control, and each of those levels is segmented to permit zoned administration. That administrative control includes the realm of security.

Multiple levels are achieved by placing a group of databases under the control of a domain. A database can be opened only by first opening its domain and then opening the database through the domain. Security can be turned on and applied at the domain level or at the database level or at both levels.

AxleBase is universally vertically segmented so that parts of an installation can go to any extreme or degree of security independently of other parts. For example, multiple domains may be established in an installation so that databases can be grouped under the various segmented security umbrellas. The same applies to the various databases.

( Additional lower levels and segmentation at those levels are being considered. )

All of those points apply to the SAM ( Storage Architecture Model ) which has been developed for AxleBase.
( Although attempts may be made to copy parts of it, it was developed exclusively for AxleBase. )

An AxleBase installation may also be designed as an axsys which is also discussed in the Tuning section. An axsys is expected to be distributed across computers and disks to give the installation more processing power. Distribution may be of AxleBase instances, database domains, databases within domains, or within databases.

If the installation is distributed, then the physical attributes of the segments may be used to further increase security. For example, segments may be placed on computers which limit access through the operating system permissions.





Embedding And Running AxleBase
Security
Sub-Section
Passwords



AxleBase provides the ability to set master passwords for each database domain and for each database in the domain. The security system is turned on by setting a master password. It must be turned on for each domain and for each database.

A master password is set or cleared with the AlterDomainAttribute and the AlterDatabaseAttribute commands. See the command in the API section for syntax and the appropriate section in the Permanent Configuration Of Objects section for discussion.

Opening an object with its master password allows operation of the object with ownership privileges. Ownership operation also reduces audit logging. It is therefore prudent practice for the DBA to grant access rights to himself as well as others so he can log on with his identity.

Unique passwords may also be assigned for each individual-object combination which would be required when the object is accessed by that individual. (See also the GRANT and REVOKE commands in the API chapter.) Individual passwords are effective only when security is turned on.

Commands are designed to fail silently when incorrect passwords are passed. If the host application fails to check the state of the object, the host may continue processing, oblivious to the fact that it is talking to nothing. This can be expected to produce inexplicable errors and potential instability in the entire system.

Passwords should not be considered locally secure. With a little work, a system that can physically access the host system can find and read them.

Maximum password length is 100 characters, but fewer characters may be used.

Passwords are case sensitive.

Semi-colons are permitted in passwords, but those passwords cannot be used in a connection string.

End of line markers and carriage returns are not permitted in the password. Any other character that can be passed by the host system may be used.

If the leading or trailing characters in the password might be confusing to the systems, the password may be delimited by apostrophes. Delimiting apostrophes will not be included in the password. For example, AxleBase routinely strips leading and trailing blanks from variables that are handed to him. If the password begins or ends with blank characters, then delimit it with apostrophes to protect those blanks.

To protect internal apostrophes, the value is not checked for escaped apostrophe's. If the password has an external apostrophe, it will need delimiting apostrophes. (The system does not normally require apostrophes. They are allowed when needed to delimit a value to insure its literal acceptance.)

Use care when selecting extended ASCII characters. If they are also used by a participating system such as the operating system, the results will be unpredictable.





Embedding And Running AxleBase
Security
Sub-Section
Granting Access



This section assumes that the host app does not have a GUI to assist with the task. If it does have a GUI, then this section will tell you how the GUI works.

AxleBase offers more flexibility and power than may be common. For that reason, what may appear to the user to be a simple command can actually produce powerful and complex results. When granting and denying access, the user should give thought to even the simplest command.

A crud table specifies the type of access to an object that is allowed for each person or entity. When AxleBase receives a request for access to an object, he reads the appropriate crud table to determine actions that are permitted for the person or entity.

The following are configurable permissions for each object:
create
read
update
delete
execute

The type of operation that is being controlled is interpreted by AxleBase. For example, the create right for a table allows the insertion of rows, for a database allows the creation of tables, and for a domain allows the creation of databases. And if the DBA does not have update rights on a database, he cannot alter a table. Creating and dropping indices are actually updates of a table's characteristics, so they require update rights.

Also, the crud table can allow passage without rights. If, for example, security is turned on in the domain and in all databases, then granting a user-domain access with no privileges will allow that person to pass through the domain to get to his database.

The crud table is updated by the GRANT and REVOKE commands. See their usage in the API chapter.

Rights at the domain level should be granted only for administrators at that level. For example, domain update rights allow the person to grant privileges at that level. Delete rights will allow dropping an entire database.

The flexibility and power given to the DBA in the GRANT command makes it possible for a careless DBA to create duplicate, ambiguous, or conflicting grants. When he receives a GRANT command, AxleBase attempts to find any existing grants that may be duplicates, conflicts, or ambiguous, but the subtle needs of that task sometimes exceed his ability. If the host app does not provide a GUI to ease the operation of granting access, it may be prudent to first use the ShowPermissions command and then analyze the existing security state.

Rights at the database level should be granted only for administrators at that level.

When security has been turned on, each person must be granted access rights to each object in the database.

Please recall that a design objective of AxleBase is to return ownership of the database to the rightful owner, so now that we have a strong and sophisticated security system in place, let's honor that objective. Many who need security do not need such a detailed system. Therefore, AxleBase provides a means of crud table simplification by allowing the keyword "all".

The keyword "all" can be used in any combination in the grants, the type of object, the object name, and the person's name. For example, a person may be granted rights to all tables in a database. The administrator must insure that such grants do not conflict with detailed grants. When used for the object type, it will not be applied to the domain and database objects.

Permissions can be especially confusing for the inexperienced and for those who do them rarely. Permissions at the domain level are usually needed only by the domain DBA. Everybody else is just passing through. Likewise, permissions at the database level are usually needed only by the database DBA, and perhaps by the domain DBA. Domain and database permissions are both maintained at the domain level.

Permissions at the table and job level are needed by all who work with the data. But the create and delete permissions that are granted for those objects pertain to the rows within them. The ability to create and drop tables and jobs is controlled by the create and delete at the database level. Likewise, the ability to create and drop databases is controlled by permissions at the domain level.

Updating permissions must be done with the revoke and/or grant command. It may seem easier at first glance, but it is actually more complicated. The most positive way to insure that the correct permissions are given is to first revoke all permissions, check the file, then grant a new set, and check the file again.





Embedding And Running AxleBase
Security
Sub-Section
Step-By-Step Turn On



Security begins at the domain level, then to the database level, and then to the objects within the database.

A very light security that might be appropriate for a single user might be set simply by setting the domain password. Since no grants had been made, access could be attained only by presentation of the password.

The problem with that is that only the owner of the domain could get to any of the databases, and if the password were shared with others, then they would have all of the owner's permissions. To prevent sharing domain ownership, permissions could be set at the domain level for individuals without giving any permissions. That would allow them to pass through the domain level to the databases.

We will now try some heavy security in the following example.

Hypothetical situation: AxleBase has been embedded in a server. It serves only a small department, but the very large database cost a great deal to build the institution directors are considering selling access to other institutions, so they want to lock it down very tightly. Since the database is being used already, the lockdown must have a minimal impact. The senior DBA takes the following steps in sequence.

1. Every employee is granted access to the domain.
This will allow them into the domain so they can access their database, but they are granted no privileges at the domain level.

2. At the domain level, the senior DBA grants himself "all" rights. This is not entirely necessary but it will allow him to work in the system without using the master password so as to maintain adequate audit trails.

3. Each database DBA is given ownership of that database by granting each of them "owner" rights to the database. That will allow them to administer the database including security.
Since the remainder of the security can become tedious because every object has its own set of options, the senior DBA may elect to allow the DBA's to administer database security.

4. Every employee is granted access to the appropriate database.
Like the domain level, this will allow them into the database, but they are granted no privileges at the database level.

5. Each is granted appropriate access to tables and other objects in the database.

6. A connection string is prepared for each employee and he/she is briefed on how to open the database the next day.
If they are working through a sophisticated client-server app, then the app might shoulder part of that task.

7. If it is not already on, AxleBase logging is turned on at all levels.

8. The "hide security stops" parameter is set to yes for maximum security.

Note that security is not yet on. Everybody continues to use the system as before.

9. After working hours, the senior DBA sets a master password for the domain and for each database which turns on security for the entire installation.

This example may be too extreme for many installations and is presented only to show what might be possible.





_________________________
Embedding And Running AxleBase
Section
Database Server Suggestions







Embedding And Running AxleBase
Database Server Suggestions
Sub-Section
General



These are only suggestions and ideas for those who consider embedding AxleBase in a server to create a database server. These are suggested areas of consideration and a few thoughts for handling problematic areas and are not an attempt to be comprehensive.





Embedding And Running AxleBase
Database Server Suggestions
Sub-Section
The VLDB Server



The AxleBase VLDB abilities present an excellent opportunity for a server. A high-end VLDB operation will create a very large distributed operation which can benefit from management tools. For example, without a server, all computers on the VLDB network must be shared. Since the server will be using AxleBase, it can communicate directly with its computers without that administrative chore.

A full featured VLDB server could be an extremely interesting and valuable asset. Before beginning the project, the builder should understand the nature of a VLDB including its value and its problems. An understanding of its theoretical nature would be beneficial in the conceptual design phase.

A VLDB server should be aware of two major features that could present problems or opportunities for it. One is the shear mass involved. The other is extreme distribution.

AxleBase is designed to handle tables so large that they can be comprehended only in mathematical terms. More than with any other database manager, an AxleBase server must stay out of the way so that AxleBase can manage massive operations.

The distributed nature of an AxleBase database can be extreme. Even a single table can be scattered across the network on thousands of computers. That scattering is encouraged by making it a simple task and by making its use transparent to the operator.

The AxleBase instance that is embedded in the server is designed to transparently handle massively distributed objects to relieve the host of that worry. The server could ignore that distribution, but the working DBA cannot, so it should be considered by the server designer. AxleBase has many tools which the DBA will use to manage his database.

If your interest is in the VLDB realm, a careful and reading of the VLDB chapter is recommended. It contains ideas which are addressed to the specialized VLDB server.





Embedding And Running AxleBase
Database Server Suggestions
Sub-Section
Axsys Node Host



AxleBase is engineered in such a way that multiple instances can be used in unison to work on an extraordinarily large task. That unit is known as an axsys.

That is more than useful. AxleBase is designed to manage databases containing the largest imaginable tables so the axsys object is a necessity.

The axsys and its use is described in the "The Distributed Database Manager" section of the VLDB Operations chapter. The nature of the axsys must be understood before the ANS concept can be understood.

To help him handle massive data objects, AxleBase is designed so that he can function as multiple instances working on the same database and even on the same data entities. That ability presents interesting opportunities for the server builder.

An axsys can work on multiple tasks on various objects or on the same object. All instances can even perform the same task on one object. The complexity increases when the DBA staff can understand and architect multi-dimensional operations.

A node host could extend that power tremendously through inter-process communication across the network which would give the DBA more immediate control of distributed operations. (Remember that each instance will usually run on its own computer.) That tighter control of the distributed processes might in turn increase the number of instances that the DBA staff could use simultaneously.

There are axsys configuration tables within each database. The functionality of an ANS can be extended through them.

When the server is a node host, then it may be distributed with a central server console to manage the database operation. Various specialized server components, each with an embedded AxleBase instance, may be suggested by a reading of the VLDB chapter.

The builder of a node host will find that many of the AxleBase commands are functions which are designed with that end in mind.

The small size of the AxleBase object can be misleading. His design makes him one of the most powerful tools in existence. That power can also present powerful surprises which are counter-intuitive. For example, the builder of an ANS should become familiar with the synchronization warning in the VLDB chapter.





Embedding And Running AxleBase
Database Server Suggestions
Sub-Section
Error Handling



Error handling in the server might begin with an assessment of the AxleBase error protocol which is constructed especially for a host system. The AxleBase error sub-system tries to work in concert with the host to handle all possible errors including unrecognized and unhandled errors.

There might be a classification of errors in the server so that those that must be handled at the central console are passed through and the rest are handled by the local server. The AxleBase protocol includes error numbering specifically for the purpose of identification by the host.

The AxleBase error protocol is designed to allow a host to easily strip out parts of the error return before retransmission.





Embedding And Running AxleBase
Database Server Suggestions
Sub-Section
Security



Most of the security sub-system is intended for use by a server. For example, the password feature is obviously secure only when it is used by a server.

A server should be aware of those commands that are designed to fail silently although action may not be needed by the server.

Some thought might be given to the SAM's impact on security. The server design, for example, may account for the manner in which domain's are handled. A domain must be opened before one of its databases can be opened, but that could be done by the server to prevent the creation of new domains, or the server might entirely filter out domain openings.

The server design may elect to filter commands. For example, the builder might elect to deactivate the locate command.

AxleBase allows all ASCII characters in passwords and in some areas outside security. That could require more programming esoterica than desired, so the server might be designed to filter or reject extended characters in command parameters.





Embedding And Running AxleBase
Database Server Suggestions
Sub-Section
ODBC And Native Connections



The AxleBase interface is designed to support the ODBC protocol for the benefit of servers and ODBC drivers. A few of its more esoteric features were intentionally ignored.

The AxleBase interface also supports Oracle style native connections which do not use the ODBC protocol. That type of connection is demonstrated in the AxHandle server. If that approach is used, it may be possible to reduce the complexity of the server by passing AxleBase commands from the remote client directly to AxleBase on the server side.

A native connection need not necessarily locally instantiate a Manager object. That is touched on in the AxHandle section where the command string is discussed.





Embedding And Running AxleBase
Database Server Suggestions
Sub-Section
Concurrency Issues



Although he supports concurrency, it must be remembered that AxleBase is designed for purposes other than heavy concurrency. The use of one of the big-name brands is recommended for heavy concurrency; MsSql, Oracle, MySql, Access, etc. (See the test section in the introduction.)

Since he is designed to be embedded, AxleBase provides some assistance in this area, but cannot do the whole job. For example, queuing must be handled entirely by the server. The use of a server with the AxleBase features with queuing should increase concurrency. The addition of a server queue and other mechanisms are possibilities.

The server builder might also consider how AxleBase handles concurrency issues. It might be decided to pass all concurrency errors back to the client, or the server might monitor error numbers and intervene to modify system behavior.







__________________________________________________

Chapter 4

A.P.I.
Lexicon And Syntax Reference

__________________________________________________



_________________________
API Lexicon And Syntactical Reference
Section
Functions and Operators





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
Limitations



If post-return processing is needed, then the host is expected to provide it. The AxleBase API is intended to provide the functionality that is required for storage and retrieval. It is not intended to be a full function programming language although some DBA's attempt to use SQL for that purpose.

See also the intentional abridgements in the introduction.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
Commenting SQL Code



The parser permits commenting SQL.

Requirements:
     Comments must precede the SQL.


     Only one comment is allowed.
     (But it can be of any length and can be formatted.)
     Begin with the two character string "/*".
     End with the two character string "*/".

Example:
/* The following code is commented here. */ select avg ( PERSON_AGE ) from T_PEOPLE





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
Conditional Select Operators



The following symbols are, or were at one time in database history, standard logic operators.

The 'like' and the 'sounds' operators do not take advantage of indices. They always do a table scan.

To help beginners and those who know only one or two SQL dialects, AxleBase supports more conditional constructs than necessary. (Some of the lesser known are, or have been, used in extant or dead big-name database managers.)

The following logical operators are currently supported by AxleBase in the SQL where clause. Those who want to continue using their favorite syntax can do so without penalty. The conversion is shown as a suggestion toward the simplicity of uniformity.

Supported Operator Converts To
=
<
>
>=
<=
<>
like
is like like
not like
is not like not like
not is like not like
! like not like
sounds like
not sounds like
is =
is equal =
eq =
equal =
equals =
! <>
!= <>
not <>
is not <>
not is <>
not equal <>
not equals <>
is not equal <>
not is equal <>
not eq <>
is not eq <>
not is eq <>
in
between
!in not in
!between not between

The "SOUNDS LIKE" uses the original soundex algorithm. (Courtesy of the American taxpayer like so much of what we take for granted despite the Big Names taking credit.) Soundex delivers approximate results and works for standard American pronunciation of people's first names. It can increase processing time tremendously for large files.

The logical constructs that use null follow the same conversions. Some attempt is made to standardize incorrect null constructs, but that cannot be depended upon simply because I have moved on to other areas.

There is currently no plan to support the old "isnull". It must be "is null".





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
DateAdd



Syntax:
DateAdd ( unitType , quantity , date )

This is an AxleBase function which is provided for use in SQL statements. It adds the specified number of units to the specified date. The unitType is one of those shown in the datediff table. Only whole number quantities are accepted.

The date must be one of the AxleBase date types; date, dateTime, dateTimex. (See the Column Data Types section of the Embedding And Running AxleBase chapter.) The operation construct must be consonant with the fact that dates BC are respected.

Accuracy : AxleBase does not yet account for leap-seconds and leap-centuries.

The calling operation must be prepared for the return of an error message.

If a datum is encountered in the job stream which cannot be coerced to a valid value and value type, then AxleBase returns an error.

(The host is expected to be able to perform its own calculations, so functions are not acceptable in the SQL column return clause.)

Return expected:   Date.
Return on error :   Error message.

Example:
sReturn = dateadd ( m , 2, 2005081218550400 )

sReturn will contain 2005081218580400.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
DateConvert



Syntax:
DateConvert ( variable to datatype )

This is an AxleBase function which is provided for use in SQL statements to convert a string to a date datatype.

Variable is a date which is formatted in one of the commonly used date formats or is an AxleBase date format. It may be either the name of a column or a delimited literal.

The return will be in the format that is specified by the datatype parameter. If the request includes data that is not contained in the variable, then the extra data will be returned as zeros. Fictitious data may be generated by specifying the fictitious DateTimeF datatype.

Datatype is a literal expression which specifies an AxleBase data type.

If a datum is encountered in the job stream which cannot be coerced to a valid datatype, AxleBase returns an error.

(The host is expected to be able to perform its own calculations, so functions are not acceptable in the SQL column return clause.)

Datatype Return Description
date YYYYMMDD date
datetime YYYYMMDDHHMMSSNN datetime
datetimex YYYYMMDDHHMMSSNNNNNNN datetimex
time HHMMSSNN time
timex HHMMSSNNNNNNN timex

The calling operation must be prepared for the return of an error message.

Example:
select * from T_LOG where log_date < '2005081218550400'

Example:
select * from T_LOG where log_date < dateconvert ( '01 JUN 98' to date )

Example:
select LOGGED_EVENT , dateConvert ( LOGGED_DATE to datetime ) from T_LOG





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
DateDiff



Syntax:
DateDiff ( unitType , date1 , date2 )

This is an AxleBase function which is provided for use in SQL statements. It returns the number of whole units by which the two dates differ. The second date is subtracted from the first. The unitType specification must be one of those listed.

(Note: One purpose of the coredate protocol is to ease data handling. If the objective is a date comparison and the two dates are in the same format, then dateDiff is not needed and a direct comparison will work. For example, '2007090214253604' > '1997082523153245' will work.

Permissible unitTypes:
     century, centuries, c
     year, years, y
     month, months, m
     week, weeks, w *
     day, days, d
     hour, hours, h
     minute, minutes, n
     second, seconds, s

The data type of the values must be date, datetime, or datetimex, although they are not required to be the same. (See the Column Data Types section of the Embedding And Running AxleBase chapter.) The operation construct is consonant with the fact that dates B.C. are respected.

The complexities of date arithmetic can be misleading due to its nonlinear logic and due to psychology. For example,
     weeks are sometimes thought of as whole calendar units and sometimes as seven day units.
     Or consider the possibilities when a year is added to a date preceding a leap year.
     Or consider the effect of adding one month to 28, 29, 30, or 31 Jan.

Accuracy :
      AxleBase does not yet account for leap-seconds and leap-centuries.

The calling operation must be prepared for the return of a non-numeric value to allow for an error return.

If a datum is encountered in the job stream which cannot be coerced to a valid value and value type, then AxleBase returns an error.

(The host is expected to be able to perform its own calculations, so functions are not acceptable in the SQL column return clause.)

Return expected:   Numeric.
Return on error :   Error message.

Example:
sReturn = datediff ( m , 2004081218550400 , 200505121855042354352 )

sReturn will contain 9.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
DateFromSerial



Syntax:
DateFromSerial ( number )

This is an AxleBase function which is provided for use in SQL statements. It returns a date from the specified number of days. Negative numbers return dates B.C.. A number outside the valid date range will generate an error. The date will be an AxleBase DATE datatype.

Accuracy: AxleBase does not yet account for leap-seconds and leap-centuries.

The calling operation must be prepared for the return of an error message.

(The host is expected to be able to perform its own calculations, so functions are not acceptable in the SQL column return clause.)

Example:
The following will insert 7 September 2007.
sReturn = oData.ExecuteSql ( "insert into T_citizen values ( '' , '' , dateFromSerial(732941) , '' )

sReturn allows error returns.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
DateNow



Syntax:
DateNow ( [ optionalType ] )

This is an AxleBase function which is provided for use in SQL statements. It may be used to insert the current date as a literal in the SQL string.

The optional parameter may be one of the AxleBase data types; date, datetime, datetimex, time, or timex. If omitted, the datetime type will be returned. The parentheses in this function are not optional.

Times that are generated by computers are generally suspect. Times that include seconds are especially suspect and greater precision than that increasingly so. AxleBase will return a time that includes hundredths of a second, but the caller must be aware that the precision is only a relative value. Timex and datetimex values will contain only placeholder zeros after that value.

Testing sometimes requires the generation of unique datetimex values. The host can coerce AxleBase into returning fictitious values in place of the placeholder zeros by entering the fictitious DateTimef parameter in the type option. DateTimef values are assigned sequentially from a pool of 100,000 for all current processes by AxleBase. The generation of 100,000 values per second may be expected to produce unique values for each object at the current speed of computers.

(The host is expected to be able to perform its own calculations, so functions are not acceptable in the SQL column return clause.)

The calling operation must be prepared for the return of an error message.

Spaces are not permitted in the string.

Return expected:   Date string.
Return on error :   Error message.

Example:
sReturn = dateNow

sReturn will contain 20050506.

Example:
sReturn = dateNow ( datetime )

sReturn will contain 2005050619072300.

Example:
sReturn = oData.ExecuteSql ( "insert into T_LOG values ( dateNow ( datetimex ), '', '', '')

sReturn allows error returns.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
DateToSerial



Syntax:
DateToSerial ( date )

This is an AxleBase function which is provided for use in SQL statements.

It returns the number of days in the specified date as a long integer. In other words, the return is a numeric variable and is not a string. Dates B.C. are returned as negative numbers.

The specified date must be one of the AxleBase date data types; date, dateTime, dateTimex.

Accuracy :
      AxleBase does not yet account for leap-seconds and leap-centuries.

If a datum is encountered in the job stream which cannot be coerced to a valid datatype, AxleBase returns an error.

(The host is expected to be able to perform its own calculations, so functions are not acceptable in the SQL column return clause.)

Example:
If today is 7 September 2007, then the following will insert a row containing only the citizen_id field with a value of 732941.
sReturn = oData.ExecuteSql ( " insert into t_citizen (citizen_id) values( datetoserial ( datenow ( date ) ) ) " )

That is the same as the following.
sReturn = oData.ExecuteSql ( " insert into t_citizen (citizen_id) values( datetoserial ( '20070907' ) ) " )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
DeferReturn



The DeferReturn tells the data vector to compile the data return on disk so that none of the computer's RAM is used. It is an AxleBase-specific SQL clause designed for working with very large data returns. It tells AxleBase to stage the result of a select and to defer building a dataset until requested.

The deferReturn is used inside the SQL statement. After the SQL runs, it appears that nothing happens, but a ShowAttributes command will show the size of the staged return. The ReturnDeferred command will perform controlled returns of segments of the dataset.

( This is a non-standard AxleBase SQL extension to support a VLT. Beginners are advised to avoid non-standard SQL in any database manager and to be wary of those brands which do not provide this warning.)

All other operations in the query are performed up to the dataset build. Then, everything pauses until a return is requested. When a return is requested, the dataset will be built.

The number of tuples that are staged is available upon request, but no operations can be performed on them because the dataset is empty.

When used, DeferReturn must be the last clause in the SQL statement.

See also: The Defer Returns section of the Configuration chapter. The data Vector object ReturnDeferred command.

Return expected:   None.
Return on error :   Error message.

Example:
select * from t_log row ( 14000000 , 1000000 ) DeferReturn

This will return nothing because it terminates with a DeferReturn. One million rows will be staged.

Example:
ReturnDeferred 100

This will return the first 100 of the million rows that were requested above, and will remove that 100 rows from the million row result set.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
In



Syntax:
[ NOT ] IN ( value1 [ , value2 [,...n] ] )

Provides a way to specify a match of any single value in a list of values. Values are evaluated from left to right until all are tested. The process exits at the first match.

Hint :
      When selecting from a very large table, remember that the list must be evaluated every time that a row is read. Speed can sometimes be increased by placing the value with the greatest probability of being found at the beginning of the list.

Hint :
      If the system will use an index in the search, and the probability of a match is approximately the same for all values in the list, then speed can sometimes be increased by placing the values in sorted order.

Example:
select * from t_log where owner IN ( 'kate' , 'ruth', 'naomie' )

This will return any row where the owner value is kate, ruth, or naomie.

Example:
select * from t_log where owner NOT IN ( 'kate' , 'ruth', 'naomie' )

This will return any row that is not kate, ruth, and naomie. It will return sarah, julie, and dana.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
IsDate



Syntax:
isDate ( value )

This is an AxleBase function which is provided for use in SQL statements.

Returns a boolean evaluation of the value. If the value is a valid date or datetime value, the evaluation is positive.

This example returns yes.
sReturn = IsTime ( 2007131803152600 )

This example returns no.
sReturn = IsTime ( 2007137803152600 )





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
IsTime



Syntax:
isTime ( value )

This is an AxleBase function which is provided for use in SQL statements.

Returns a boolean evaluation of the value. If the value is a valid time or timex value, the evaluation is positive.

This example returns yes.
sReturn = IsTime ( 03152600 )





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
Locate( )



( Under construction or consideration and not yet operational. )

Locate is a function that can be placed in a SQL clause to locate a data source in a very large and distributed table. When used, each tuple in a dataset is tagged with its source.

To avoid confusion, it may be used only in a select query that has no joins. It must be placed at the end of the query immediately preceeding the deferReturn. It is a function so the parentheses are expected.

The source tag is sixty characters long, consisting of three elements, the segment number, the row number, and the computer. The computer is available only if the segment location included the computer name or address when the segment was created.

The count for each number begins with the read, so the number is relative to where the SQL statement starts the read. If the read is permitted to begin at the beginning of the table, then the location numbers will match the table's segment and row numbers. If it begins at the first row of a segment, then the row numbers will match those in that segment.

( The Locate clause is a non-standard AxleBase SQL extension to support a VLT. Beginners are advised to avoid non-standard SQL in any database manager and to be wary of those brands which do not provide this warning.)

Return expected:   Locations of all tuples.
Return on error :   Error message.

Example:
select * from t_log
where owner = 'kate'
locate( )
deferReturn

If tuples are returned, they will include their source locations.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
Math Operators



( Under construction and not yet available. )

Math operators are:
+ Add
- Subtract
/ Divide
* Multiply
^ Raise

Math operators are supported only in the select and where clauses. Hosts are expected to be capable of manipulating returns.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
ROW Clause In SQL



Syntax:
row ( firstRow , returnRows )

The row clause is an AxleBase-specific function which may be used to target specific table rows in a SQL statement. It was developed primarily as a VLDB tool to target a range of rows in a very large table.

A SQL statement may contain multiple row clauses to control multiple tables in the query. There may be only one per table and each must immediately follow the table to which it will be applied.

( The row clause is a non-standard AxleBase SQL extension to support a VLT. Beginners are advised to avoid non-standard SQL in any database manager and to be wary of those brands which do not provide this warning.)

The Row clause may be used in the following types of SQL statements :
      delete
      select
      join
      update

Deleted Rows :
      Deleted rows are included in the search count until the table is purged. That behaviour increases the speed for very large tables in which deletions and updates are expected to be sparse.

Updated Rows :
      An update deletes the row and rewrites it at the end of the table, which changes its row number.

Since deleted rows are no longer bypassed, the location of a target row now remains unchanged by deletes and updates until the table is purged. However, a target row may have been deleted. The result is that targeting the billionth row will return nothing if that row has been deleted and not purged. A large table segment may be purged of deleted rows.

Parameters :
      Both parameters are required. FirstRow is the number of the first row to read, counting from the beginning of the entity. ReturnRows is the number of rows to which the operation will be applied including the first row read.

The first AxleBase row is number 1 and not number 0. (Please do not laugh because that is a serious problem for some older programmers.)

When a row clause is used in a SQL operation, AxleBase will begin at the specified row and will read no more than the specified quantity of rows from the table. In a multi-table join, each table may have a row clause.

Speed Variance :
      Will work on any table, but was designed for very large unchanging tables.
      Fastest in fixed width segments that have no deleted or updated rows. A billionth row can be expected in milliseconds, and a trillionth row slightly longer.
      Variable width tables are slower then fixed width tables. (An indexed serial column may perform a similar function at higher speed for a variable width table, but it does require management.)
      Deleted and updated rows slow the seek.
      The time to seek a very distant row can be estimated by first seeking a lower row.

Exceeding Table Size :
      If a row clause exceeds the entity size, the excess is simply ignored.

Deletes :
      The row clause can be used in a delete command. Its use without a where clause is not recommended.

Updates :
      A row clause may be used in an update command.

Segment Boundaries :
      The row clause is designed to transcend segment boundaries so that it operates across boundaries as though they do not exist. When used with the segment clause, the row clause treats the specified segments as the entire table.

Row Clause With Segment Clause :
      The row clause and the segment clause may be used together. The segment clause takes precedence so that the row becomes operational in the first specified segment and will not exceed the boundary of the last specified segment. When used together, the row clause treats the segment range as though that range of segments is the entire table. Therefore, row one of segment ten is the first row in segment ten.

Indexed Tables :
      AxleBase will decline a query that uses both a row clause and an index in the where clause.
      When a where clause includes an indexed column, AxleBase constructs a list of pointers into the table which do not use the table's row numbers. That results in a conflict between the index logic and the row logic which would produce unexpected returns.
      If AxleBase merely disabled one or the other in the query, that also would produce unexpected returns so he returns an error.
      This may be reassessed in the future.
      The segment clause does not share that limitation.

Return expected:   Dependent upon the application.
Return on error :   Error message.

Example:
select * from t_log
row ( 14000000 , 1000000 )
left join t_screen
row ( 1 , 200 )
on t_log.owner = t_screen.owner deferReturn
deferReturn

This will join one million t_log rows starting at row number 14 million with 200 t_screen rows starting at row 1.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
Segment Clause In SQL



Syntax:
segment ( segmentStart , segmentCount )

The segment clause is an AxleBase-specific function which may be used to target specific table segments in a SQL statement. It was developed primarily as a VLDB tool to target a segment range in a very large table. It is sometimes used to achieve high speed through systemic parallelization.

A SQL statement may contain a segment clause for each table. There may be only one per table and each must immediately follow the table to which it will be applied.

( The segment clause is a non-standard AxleBase SQL extension to support a VLT. Beginners are advised to avoid non-standard SQL in any database manager and to be wary of those brands which do not provide this warning.)

The Segment clause may be used in the following types of SQL statements :
      delete
      select
      join
      update
      function

Parameters :
      SegmentStart is the number of the first segment that will be read, counting from the beginning of the entity. :
      SegmentCount is the number of segments to which the operation will be applied and must be at least one to include the start segment.

The base table file is always treated as segment number one regardless of its name. If a segment is added to the table, then that segment will be identified as number two regardless of its name.

Without a segment clause, a SQL statement is applied to all segments including the base table. The segment numbers begin at one, which is the base table. Therefore, in a SQL statement, the first segment is the primary table segment.

The segment clause constructs a fixed query window and may be used without concern for table topology. If a validly constructed segment clause exceeds the entity segment count, the excess is simply ignored. Thus, an operation starting at segment number 2000 of a 1000 segment entity will simply return nothing. That SQL statement will not generate an error and an error will be returned only if there is an operation failure.

The segment clause may also be used without concern for location of the table or its components and without concern for table distribution. The system will handle all background tasks during the qurey.

When a segment clause is specified in a SQL operation, AxleBase will read no more than the specified segments from the table. In a multi-table join, each segment clause will be applied only to its table.

Deletes :
      A standard SQL delete statement without a where clause is a request to empty the entire table. A segment clause is ignored in a request to empty a table. (This logic thread conforms to the standard SQL logic, but may be reevaluated in future development because it does not conform to the ability to use a segment clause in an update.)

Updates :
      A SQL update command honors the segment clause. (The row clause in an update command requires great caution. It can be especially useful for a VLDB DBA, but is otherwise discouraged.)

Row Clause With Segment Clause :
      The row clause and the segment clause may be used together. The segment clause takes precedence so that the row clause becomes operational in the first specified segment and will not exceed the boundary of the last specified segment. When used together, the row clause treats the segment range as though that range of segments is the entire table.

Exceeding Table Size :
      If a validly constructed segment clause exceeds the entity size, the excess is simply ignored. Thus, an operation targeting segment 100 of an entity which has only 5 segments will return nothing. That event will not return an error and an error will be returned only if there is an operation failure.

Index :
      The segment clause may be used with indexed queries. (The row clause cannot be used with indexed queries.)

Return expected:   Dependent upon the application.
Return on error :   Error message.

Example:
select * from t_log
row ( 14000000 , 1000000 )
segment ( 10000 , 100 )
deferReturn

This will return one million rows starting at row number 14 million from 100 segments starting with segment number ten thousand.

Example:
select * from t_log
segment ( 1 , 10 )
deferReturn

This will return all data from the primary table segment and from the next nine segments after it.





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
SQL Functions



The following summary functions may be used in the SQL select clause. (See the data Vector object - Select sub-section for discussion of the SQL select.

Function Return
count( ) row count
sum( ) column summation
avg( ) column average
min( ) minimum value
max( ) maximum value

AxleBase allows the count function to be abbreviated to cnt( ) to make it uniform with the other functions.

A select function returns a calculated value which is derived from the contents of the specified column. The column must be specified and only the count function accepts an asterisk.

Function returns are not permitted with tuple selections. A query that contains a function will return a single tuple containing the function results.

An AxleBase function may be run against any column regardless of the defined data type and the data type will not produce an error. The validity of the return should be ascertained by the host. If the defined type is numeric, then the function will treat the data as such in the evaluations and calculations, and a string type will be treated as such.

If a sum or average is requested for a non-numeric field, then only non-numeric values will be included in the result.

The maximum value bound for a function is 1.79769313486232E308.

( A standard deviation function is not available because it is easily done in the host app. However, this is subject to re-evaluation. )

Each of the following examples will return a one-row dataset with the specified value(s) contained in that row. Example uses sReturn to catch error returns.

Example:
sReturn = oData . ExecuteSql ( "select sum ( PERSON_AGE ) from T_PEOPLE" )

Example:
sReturn = oData . ExecuteSql ( "select avg ( PERSON_AGE ), min ( PERSON_AGE ), sum ( income ) from T_PEOPLE" )

Example:
sReturn = oData . ExecuteSql ( "select count ( * ) from t_statistic" )





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
String Function



Syntax:
string ( [ start , length , ] value [ & value [ & n.... ] ] )

This is an AxleBase function which is provided for use in SQL statements. It may be used to perform one or more of any of the following operations on a string of characters:
      Converts to a string datatype.
      Concatenates.
      Extracts a sub-string.

The concatenation operator is the ampersand. Leave a space on each side of the ampersand so that it can be recognized as a stand-alone character and not part of a variable.

Values may be literals and may be column names in the where clause,.

(The host is expected to be able to perform its own calculations, so functions are not acceptable in the SQL column return clause.)

Example:
sReturn = oData . ExecuteSql ( "insert into t_log (log_msg) values(string(15, 6, datenow('datetimex') & 'test' & 2594 ) )" )





API Lexicon And Syntactical Reference
Functions and Operators
Sub-Section
Wildcard Characters



Variables in the where clause may include wildcard characters. Those characters are recognized by AxleBase as wildcards only in the like construct.

The AxleBase default multiple-character wildcard character is an asterisk. The multiple-character wildcard character represents any string of characters.

The AxleBase default single-character wildcard character is a question mark. The single-character wildcard character represents any single character in that position in the variable.

AxleBase permits changing the wildcard characters in each domain, but such is discouraged. See the Configuration chapter, Wildcard sub-sections.

Example:
like '*r*' will return mary, morrie, marie, fred

Example:
like 'm?r*' will return mary, morrie, marie





_________________________
API Lexicon And Syntactical Reference
Section
The Manager Object Interface





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
General



The Manager is an object which controls the databases. The general manner in which this is done is covered in the Embedding And Running AxleBase section and the commands that are used are covered in this section.

The Manager object is also the link and pipe from databases; sometimes called the connection. A Manager object must be created before a data object can be used. It links the data object into a database and provides the pipe through which data is returned.

Where a return is expected from a command, the return should be checked for an error message.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
AbortJob



Syntax:
oManagerObject . AbortJob

This command is provided to stop very long running jobs without data loss or system disruption. The command is sent only to the Manager object, but it will also intercept Data Vector jobs.

It is not recognized by all jobs. It is not provided to stop big jobs; just long-running ones. In tests, for example, AxleBase has shown that he can empty a ten billion row table spread across a network in a split second. The command is therefore entirely ignored by those jobs. If a massive select is started without the DeferReturn clause, this might be able to stop it before the computer crashes, but that is improbable.

This command will work only if the YieldProcessor property is set to yes. (See the Yield Processor section of the Configuration chapter.) If it is set to no, the command cannot be passed.

A job may not immediately respond to this command. Jobs can check for an abort only at certain points. The host should be capable of sending the command and returning a wait notice. (See the AxHandle demo for an example.)

When the job is stopped, AxleBase returns a notice of success in the form of a standard error message.

( The addition of this ability was considered for a very long time because its existence certainly slows AxleBase. Normal database managers do not need it, but AxleBase is built for running massive operations. It has therefore been added with some misgivings and may be removed if complaints are received about speed.)

See also:

Return expected:   Notice of a successful abort.
Return on error :   Error message.

Example:
sReturn = oMgr . AbortJob

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
AlterAxsys



( The axsys object is operational, but it is still under construction and is subject to dramatic changes.)

Syntax:
oManagerObject . AlterAxsys operationType , attributeName, computerName , [ loginID ] [ , valueList ]

AxleBase contains an extended and distributed database manager called an "axsys". This command configures that object so that it can come on line. (See the VLDB chapter for extensive discussion of the axsys operation and control.)

This configuration should not be confused with the domain, database, and table configurations which are covered in the Configuration chapter.

( Each axsys object belongs to a database so the axsys configuration belongs with the database properties. However, the large size and operational complexity of the axsys object prompted the removal of its management from database configurations.)

Operation Type :
      Required.
      Options are create, delete, or update.

Attribute Name :
      Required.
      Options are node, map, row, segment, temp, axsys, or one of the node column names.

Computer and Login :
      A node is identified by the computer and login.
      Computer is required and login is optional.
      If only a computer is used to identify the node, then any AxleBase instance which comes up on that computer will become that node.
      The wildcard characters asterisk and question mark are recognized. (Care is cautioned because wildcards can cause multiple loads of a node.)
      If a computer and a login name identify the node, then an instance will become that node only if it is on that computer and is loaded by that login ID.
      Multiple instances on a computer are strongly discouraged.

Value List :
      This is a comma separated list of values.
      Do not include the value names.

Create Operations :
      An axsys is configured by creating its nodes.
      A node must be created before its attributes.
      A node may have multiple attributes such as, for example, maps for both the T_LOG and for the T_JOB tables.

Delete Operations :

axsys Drops the entire axsys configuration.
node Drops the entire node.
map With table. Drops that map for the node.
Without table.Drops all of node's maps.
row With table. Drops that table node.
Without table.Drops all of node's rows.
segment With table. Drops that segment record.
Without table.Drops all node's segments.
temp Drops the node's temp location.

Node Value List :

Name Description Data Length
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
node name User-assigned name. alpha 20
status Node status. alpha 10
type Node type. alpha 10
class Node class. alpha 10
axsysId Axsys object name. alpha 20
cell Axsys cell unit. integer
fromcomputer Failover from. alpha 20
fromlogin Failover from. alpha 20
tocomputer Failover to. alpha 20
tologin Failover to. alpha 20
interval Inter-event seconds. integer
dataprotocol Return protocol. alpha 20
deferreturn Defer data return. alpha 20
location Physical location. double 50
port Node port. integer
sendpause Pause between sends. double
buffer Comm buffer size. integer
burst double
base double
hop double
commprotocol App-level protocol. double 20
encrypt Yes or no. alpha 7
authenticate Yes or no. alpha 12
description Admin description. alpha 100

      For a node update or create, all values must be passed. Any not passed will be set to null.

Individual Node Column Update :
      After a node exists :
      Members of the node list can be updated individually.
      Use the member name as the attribute name.
      Member names are not case sensitive.
      Value list will be only a single item.

Map Value List :
      table name , alias name

Row Value List :
      table, start row, row quantity

Segment Value List :
      table, start segment, quantity

Temp Value List :
      location
      The complete path relative to that node.

Node ID :
      Each node has a unique read-only thirty byte node I.D.. It is generated at creation and ceases to exist when the node is deleted. It cannot be updated. (Pursuant to the command of Him for whom I work, identifiers created by my systems cannot be used to identify hardware, platform, owner, or anything other than that which is openly specified.)

Row Attribute :
      Creates a SQL row clause for the table in any query which contains that table. Over-rides SQL row clauses. (See the Row Clause sub-section.)

Segment Attribute :
      Creates a SQL segment clause for the table in any query which contains that table. Over-rides SQL segment clauses. (See the Segment Clause sub-section.)

Map Attribute :
      The map attribute maps table names to virtual table names. SQL statements will be scanned for the virtual table name, and if found, the mapped table name will be substituted.
      It allows a single SQL statement to be dispatched against many tables in one or more databases. The data returns will appear to be from a single specified table.
      A node may have multiple tables mapped to the same virtual table. However, a real table can be mapped to only one virtual table.
      Can be used with SQL aliases.
      Can be used with table attribute aliases.

Temp Attribute :
      This parameter allows each instance to have its temp work location on a local drive to relieve contention. The location should be local to each instance because the NetworkScan utility cannot check it.

See also: ReloadNode; ShowAxsys; AlterAxsysRunningNode; The Axsys section of the VLDB chapter.

Return expected:   Nothing.
Return on error :   Error message.

Example drops the entire axsys configuration:
sReturn = oMgr . AlterAxsys ( " delete, axsys , , " )

Example uses sReturn to catch error returns.

Example creates a node:
sReturn = oMgr . AlterAxsys ( " create , node , server4 , , , , , , , , , , , , , ,server3, , server28, , 4, , " )

Example uses sReturn to catch error returns.

Example updates a node:
sReturn = oMgr . AlterAxsys ( " update , node , server4 , ,,,,,,,,,,,,,,,,,,,a test " )

Example uses sReturn to catch error returns.

Example of same update using only the value name:
sReturn = oMgr . AlterAxsys ( " update, description, server4 , , a test " )

Example uses sReturn to catch error returns.

Example removes all of a node's row records:
sReturn = oMgr . AlterAxsys ( " delete, row , server4 , " )

Example uses sReturn to catch error returns.

Example removes a node:
sReturn = oMgr . AlterAxsys ( " delete , node , server4 , julie" )

Example uses sReturn to catch error returns.

Example adds a row record for a node:
sReturn = oMgr . AlterAxsys ( "create,row,server4,,t_log,4000000,1000000" )

Example uses sReturn to catch error returns.

Example adds a temp work location:
sReturn = oMgr . AlterAxsys ( " create , temp , server4 , , c:\temp" )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
AlterAxsysRunningNode



( The axsys object is operational, but it is still under construction and is subject to dramatic changes.)

Syntax:
oManagerObject . AlterAxsysRunningNode specifications

This command will tell the running instance to reconfigure itself into the specifications. It is a run-time command and will not save the alterations. Whereas the ReloadNode command tells the instance to reload from the stored configurations, this command directly changes the node configuration in the running instance.

Specifications :
      The specifications are a list of attribute name-value pairs.
      Each spec. consists of the name, an equal sign, and the value.
      The specs. are separated by commas.
      The specification names are found in the AlterAxsys section.
      Sequence is irrelevant.

The entire node cannot be updated in a single string. Each of the node's parameters must be updated separately. Map, row, and segment settings will be appended to any existing settings. To clear all map, row, and segment values, submit the name with a blank value.

Map :
      The map parameter requires multiple values which must be separated by single spaces. The values are the table name and the virtual name, and must be in that sequence.

Row and Segment :
      The row and segment parameters require multiple values which must be separated by single spaces. The values are the table name, start number, and quantity, and must be in that sequence.

See also: ReloadNode, ShowAxsys, AlterAxsys, AlterAxsysRunningNode, The VLDB chapter.

Return expected:   Nothing.
Return on error :   Error message.

Example adds a temp work location:
sReturn = oMgr . AlterAxsysRunningNode ( "encrypt=yes, cell = 11 , PoRt= 5000 , row = , segment = t_log 4000 10 , commprotocol=syslink" )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
AlterDatabaseAttribute



Syntax:
oManagerObject . AlterDatabaseAttribute attributeName = value

Sets the value of the named attribute of the currently open database. By design, each command can set only a single attribute.

It is the responsibility of the host app to insure that all other user processes have closed the database and no tables are open before executing this command. If not controlled, this command can produce an inconsistent database state with corrupted data.

This command makes one of the specified changes to a parameter for the currently open database. Although not necessary, it may be a good idea to close and re-open the database after this command is executed. If possible, it is probably best to reload everything.

For locks, see the LockObject section.

See the "Configuration" chapter for attributes and discussion.

See also: ShowDatabaseAttributes.

Return expected:   Nothing.
Return on error :   Error message.

Example setting a password:
sReturn = oMgr . AlterDatabaseAttribute ( "PASSWORD = sklAXClsei8994Sskk" )

Example uses sReturn to catch error returns.

Example dropping the password:
sReturn = oMgr . AlterDatabaseAttribute ( "PASSWORD = " )

Example uses sReturn to catch error returns.

Example relocating a database:
sReturn = oMgr . AlterDatabaseAttribute ( "location = c:\program files\AxHandle\db\demo" )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
AlterDomainAttribute



Syntax:
oManagerObject . AlterDomainAttribute attributeName = value

Changes a characteristic of the currently open database domain object.

By design, each command can set only a single attribute.

A database domain must be open before this command can be used. Some changes become effective only after the domain is closed and the master database is reopened.

This command makes one of the specified changes to a parameter for the currently open database. Although not necessary, it may be a good idea to close and re-open the domain after this command is executed. If possible, it is probably best to reload everything.

For locks, see the LockObject section.

See the "Configuration" chapter for attributes and discussion.

See also: ShowDomainAttributes.

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . AlterDomainAttribute ( "LOGLOCATION = \\server84\c:\dblog\" )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
AlterTable



( Under consideration or construction. )

Syntax:
oManagerObject . AlterTable ( SQLstatement )

Where sqlStatement is a complete SQL statement in the form:
( [ ALTER TABLE ] tableName [DROP CONSTRAINT constraintName] | [ADD CONSTRAINT constraintName primary key ( column1, column2, ... ) )

May be used to add or to drop table keys. Only the key constraint is operational at this time.

Note that the 'alter table' string is optional when using this command. The redundency engendered by employing standard SQL may cause some confusion. However, it is hoped that the use of standard SQL may make life easier for the experienced DBA.

The command is used by the Manager object instead of by the Vector object because it treats a Vector object and not the data.

The constraint name must be unique within the table constraints and indices. It must adhere to the AxleBase naming requirements. At the present time, constraint names are limited to ten characters.

The table must be reopened after a structure change.

See also: CreateIndex; DropIndex.

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . AlterTable ( " alter table T_LOG add constraint primary key ( log_time ) ) " )

Example uses sReturn to catch error returns.

Example:
sReturn = oMgr . AlterTable ( " alter table T_LOG drop constraint PK_LOG " )

sReturn is provided in case an error is returned.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
AlterTableAttribute



Syntax:
oManagerObject . AlterTableAttribute tablename . attribute = value

Sets the value of the named extended attribute of the named table.

Note the syntactical identification of the target. The target table is specified by linking its name to the attribute name.

This command is introduced to allow maintenance of a table's non-standard configuration values. A non-standard configurable feature of an object is an AxleBase attribute of the object.

It is the responsibility of the host app to insure that no other hosts are using the table when the command is submitted. Incorrect use of this command can result in an inconsistent or corrupted database.

Although not necessary, it may be a good idea to close and re-open the database after this command is executed. Most certainly, open datasets must be reloaded.

See also: "Configuration" chapter.

See also: ShowTable, ShowIndices.

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . AlterTableAttribute ( "t_log . lock = r" )

Example uses sReturn to catch error returns.

Example changing to fixed width. Note the escaped commas separating the parameters.
sReturn = oMgr . AlterTableAttribute ( "t_log.columnType = f /, /, " )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
Authenticate



Syntax:
oManagerObject . Authenticate parameter [ , [ KEY=key ] , string ]

Behaviour depends upon the parameter.

Parameter :
      Parameter must be passed by reference and not by value.
      Empty string will produce an authentication string.
      A presented value will be authenticated.

KEY :
      A key is optional.
      If not present, AxleBase will generate its own.
      The keyword "key" must precede it.
      Both comma separators are required if key is used.
      All participating systems must use the same key.
      Key may contain any digits and English characters.
      Spaces will be dropped from the key.
      The use of a key may increase local security.
      Discretionary length. ( Perhaps 15 or 20.)

Return :
      Returns may be expected in both the parameter and as standard errors. The host should always check first for an error return.
      An invalid external authentication returns a standard error.
      If there is no standard error return, then:
      Authentication returns "valid" in the parameter.

Errors :
      The host must be able to distinguish between an authentication error and an operational error. Both errors will follow the AxleBase error protocol, but the first will simply be the rejection of an invalid authentication from another system.
      As of this writing, "E1003" is the standard error number of an invalid authentication.

An AxleBase design objective is to run on low-power desktop PC's in addition to more powerful machines. To support that objective, the authentication mechanism must produce very large authentication strings. An authentication string should be expected to contain three to five thousand characters.

This command is primarily for the support of an axsys that is running on a shared network. This is not a digital signature, but is a heavyweight exchange that is designed for use between AxleBase instances.

Compromise of the internal algorithm is expected, so it may be changed at any time. For that reason, the release numbers of AxleBase instances in the organization should be the same. When one instance is upgraded, all should be upgraded.

( The algorithm is expected to be changed without warning, but not periodically. If local compromise is suspected, then a request may be honored for a new AxleBase release with a change. New algorithms should not be expected to be more secure, but only different.)

Return expected:   None.
Return on error :   Error message.

Example requesting an authentication value :
sReturn = oMgr . Authenticate ( "" )

sReturn may contain an error message.
The empty parameter will contain an authentication.

Example requesting authentication of a value. :
sReturn = oMgr . Authenticate ( ",10,96,90,70,34,10,41,45,23,107,..." )

The actual parameter will contain thousands of characters.
sReturn will contain a standard error if the authentication is invalid.
A valid authentication will return "valid" in the parameter.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
Backup



Syntax:
oManagerObject . Backup objectType , [ objectName ] , archiveLocation, [ , generational [ , RetentionType, RetentionValue [ , nodeSpec ] ] ]

Creates an archive copy of the specified object.

Optional Parameters :
      When an optional parameter is used, any preceeding optional parameters must also be present, but may be represented by only the comma. A blank or null value is represented by inserting only the comma.

ObjectType :
      Valid objectTypes are domain, database, and table, which specify the type of object that will be archived
      A single table can be archived only by an axsys.

ObjectName :
      The name of the table that will be archived.

ArchiveLocation :
      Specifies where the object will be placed. The location must exist when the command is submitted.

Generational :
      A boolean which specifies whether it is to be over-write or generational. If set to yes, the backup will be generational, meaning that multiple backups will be retained for the specified time limit. If set to no, the backup will over-write previous backups.

RetentionType :
      Acceptable values are :
      second, seconds, s,
      minute, minutes, n,
      hour, hours, h,
      day, days, d,
      month, months, m,
      year, years, y.

RetentionValue :
      The retention value may be an integer from 1 to two million inclusive. The generational retention purge is done after the current backup is complete.

The optional retention directives may be used only if the generational parameter is yes. When entered, the optional retention directives tell AxleBase to monitor the archives. All archived objects that are older than the specification will be immediately terminated without question.

NodeSpec :
      Not needed by normal databases and should be ignored. See the following VLDB addendum.

A domain must be opened before it can be archived. A database must be open before it can be archived.

A domain backup will get only those objects at the domain level and wll not include its databases. To backup everything in the domain, backup the domain and then backup each database in the domain. If all are wanted, the ShowDatabaseCatalogue command can be used to cycle through them.

Invalid objects in the target location may be purged by the backup. When the optional retention directives are used, anything in the target location that is not an AxleBase generational archive will be endangered. A root directory should never be used.

External Objects :
      Objects that have been relocated outside the default database locations will not be included in a backup. That is a safety feature to avoid a backup of a VLT. Otherwise, a backup of a distributed database could make a mess of the infrastructure.

Virtual Tables :
      Virtual tables in a database will be backed up, but their external data will not be included.

Distributed Tables :
      Distributed table segments can be backed up only by an axsys. See the following VLDB Addendum.

Lock Requirement :
      An exclusive lock is not required, but may be used.
      See following discussion of contention.
      The restore will require an exclusive lock.

Contention Errors :
      If a backup will be done while other processes are using the database, then the DBA should assess the spinlock value. As each object is addressed, if it cannot be immediately copied, then it will be addressed until the expiration of the spinlock. If the spinlock expires for an object, the failure will be noted, the object will be skipped, and the operation will proceed. At the end of the operation, a "completion with reservations" error will be returned listing lock failures.
      The inability to copy a known data or index file, regardless of the cause, other than a lock problem, raises concern for table integrity, so it will cause interruption of the process.

Purge :
      The DBA controls purging as a separate operation. Some database managers purge their database during the backup which increases risk to very large data entities. A suggested managment method is to schedule a purge that runs prior to each backup.

Disk Space :
      If there are previous backups then the archive location must contain enough room for an additional backup because the old backups are not purged until the backup is complete. This is true even for non-generational backups.

See also: Restore.

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . backup ( database, demo, c:\backup\)

Example uses sReturn to catch error returns.

Example:
sReturn = oMgr . backup ( database, demo, c:\backup\, yes, d, 5)

Example uses sReturn to catch error returns.

Example:
sReturn = oMgr . backup ( table, calendar, c:\backup\,,,, node( cell23 )

Example uses sReturn to catch error returns.

Example:
sReturn = oMgr . backup ( database, demo, c:\backup\,,,, node( cell23 )

Example uses sReturn to catch error returns.

VLDB Addendum To Backup

The following comments and instructions do not apply to normal databases.

Base Segments :
      Only the base segment of each table is included in a normal backup to prevent the accidental backup of a distributed VLT.
      The fact that the base segment of a VLT is usually not used for data storage enhances the efficiency of very large backups. The axsys can be used to backup the distributed data portions of very large and geographically distributed tables and a normal backup can then archive all other objects.

ArchiveLocation :
      The backup provides only a single location. Do not allow an axsys to use a single location on the network.
      When using an axsys for a backup, all nodes must have an identically named local target location or single nodes must be sequentially targeted.

NodeSpec :
      The optional node specification can be used by an axsys to target nodes. When a node specification is present, then only the qualifying nodes will participate in the operation. The syntax of the parameter is :
      node ( server6 , server29jperkins, 15 )
where 'node' is a literal. Node and cell specifications may be listed within the parentheses.

Segment Ranges :
      The nodes in an axsys look for segment specifications in their configurations. If found, they will each work on that table and on their specified segments.
      Encountering a non-existant segment number during the operation may not be an error and the operation may then simply stop. That allows the DBA to plan for expansion by using ficticious segment ranges in the axsys.
      Segment existance is not checked before the operation begins, so the DBA may want to run a preliminary TableCheck. The disappearance of an existing segment during the operation will raise an error.

Instance Exclusions :
      The following AxleBase instances will not participate.
      Instances that are not axsys nodes if the node spec is used.
      All axsys nodes if the node parameter is not used.
      Any axsys node that does not meet a node specification.
      Nodes will skip tables for which they have no segment spec.

Operation Exclusions :
      An axsys will archive only table data files and index files.
      Table control objects are archived by standard backups.
      An axsys will not archive a domain.

Table Exclusions :
      There is no provision in the command for the exclusion of a very large table from a general database backup.
      A general backup will get all of the local objects and will not get distributed objects. An axsys backup may get table data and index objects and is not permitted to get other database objects. That insures backup of all objects without contention if the DBA keeps VLT base segments empty and distributes other VLT segments.

Contention Area :
      An AxleBase instance that works on a segmented table must read the table's segment pointer table. Therefore, an axsys working on a large table may sometimes experience contention problems. Before beginning the operation, the spinlock should be made adequate and the database objects should be backed up to safeguard the pointer tables.

Indices :
      Indices must be included when planning space and time requirements. Each node will backup the index files with each segment.

Note the exclusions above. If the DBA wants an entire axsys to do a general backup of all tables, then the asterisk should be used in the node spec. In that case, all nodes in the axsys will participate and each will check its segment range for each table. Nodes that have no segment range for a table will skip it.

Despite the provision of VLDB extensions, a VLDB backup should be monitored. The DBA staff should monitor resource utilization during the process and perform a detailed evaluation afterwards.

A lock is applied to each segment as it is encountered and then removed when the operation is complete for that segment. Thus, a VLT will never be entirely locked.

Errors :
      Some errors will not halt the operation. See the contention errors paragraph.
      Some errors in a distributed database manager will, themselves, be erroneous. See the Axsys section of the VLDB chapter for discussion.
      Nodes may be expected to entirely fail in a large axsys during a backup. The Axsys section of the VLDB chapter has suggestions for handling node failures.

Completion :
      AxleBase does not signal completion of operations, and nodes may complete at various times. The Axsys section of the VLDB chapter has guidance for state determination.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ClearFailedQuery



Syntax:
oManagerObject . ClearFailedQuery [ ShowFailure|ShowRows|DropHistory]

A row update consists of a set of multiple operations which is treated as a transaction. The operations in a transaction set are performed sequentially. To improve speed for very large tables, if multiple rows are involved, then the operations are performed sequentially for the entire dataset; i.e., the first operation is performed for all rows before the second operation is started.

A failed update can sometimes leave the database in an inconsistent state. For example, a computer crash in the middle of an update might hide rows that should be available. Such a problem cannot be automatically handled as it is in a normal database because it may involve a VLT, distributed objects, or other sophisticated requirements. This command allows the DBA to correct such problems.

A SQL update normally clears all history of the update when it completes satisfactorily. Also, if an error causes an automatic update rollback, the history will be cleared. If the update fails and cannot be automatically reversed, then the system makes a detailed record of the query and its failure.

This command will clear only a single failure each time that it is run. Caution and planning are encouraged if the failure involves a VLT. The command itself does not need locks.

A computer crash will sometimes corrupt data on disk, which will render this recovery impossible. When that happens, the utility will report the situation and will attempt to clear the error.

Be alert for repetitive failure. If the condition that caused the initial failure still exists, then the repair may also fail. Failure of the repair may render another attempt impossible.

Returns :
      Since this is not an automatic process, it always returns a message even if it's only to report a successful operation. If one of the optional reports is chosen, then taht report will be returned. Report rows are terminated by the Windows eol.

Recommendation :
      Run the optional reports and save them before running the utility. This is especially true of a VLT. Some errors, such as a computer crash, cannot be fixed or can only be partly fixed. If a message of that nature is returned when the utility is run, the previous reports may be of assistance to the DBA.

ShowFailure :
      Optional report.
      The report will include :
      The unique ID of the failed query.
      Date and time at which the query was run.
      Computer name from which the query was run.
      Operator name who ran the query.
      Job number which identifies the work files.
      Table name.
      Row quantities.
      Segment quantities.
Repairing the problem will clear that information.

ShowRows :
      Optional report.
      Returns the rows that were targeted for update.
      Updates may or may not have been started or completed.
      Run after the ShowFailure report to insure that the local system can hold the return.
      Each row of the report consists of update Id, table name, segment no., row location in the segment, row size, and row number in the segment.

DropHistory :
      If AxleBase reports that the failure cannot be resolved, then this parameter can be used to remove all record of the problem. It's use will not correct any error or any part of an error and is not recommended.

Security :
      Although it involoves only a table update, database update clearance is required if security is turned on.

See also: Update command in The Vector Object Interface for extended problem discussion.

Return expected:   Report of operation.
Return on error :   Error message.

Example:
sReturn = oMgr . ClearFailedQuery

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ClearLastError



Syntax:
oManagerObject . ClearLastError

AxleBase saves a copy of the last error message that was generated anywhere in the system. The error remains available to the host system until the next error or until the host system uses this command to clear it.

See also: ShowLastError.

Return expected:   Nothing.
Return on error :   Error message.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
CloseDatabaseConnection



Syntax:
oManagerObject . CloseDatabaseConnection

Closes the currently open database connection.

If free-standing data Vector objects are open when this command is executed, they will be disconnected from the database.

They will thereafter return errors for all commands executed against the database. They may be reconnected by issuing the OpenDatabase command or by issuing the Connect command, or the data Vector objects may be destroyed.

If there are Vector objects which were created by the Manager object, they will be destroyed by this command.

See also: OpenDatabase.

Return expected:   Nothing.
Return on error :   Error message.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
Connect



Syntax:
oManagerObject . Connect connectionString

Passing this command to a Manager object will open the domain and open the database. Some connections can only be made with a connection string because they require that extended parameters be included in the connection request.

The connection string is a string of parameters which define the desired connection. The string is nearly freeform. The sequence of parameters, the letter case, and spacing are ignored. The string may consist of only those parameters that are needed. Parameters with empty values may be included without detriment. If a value is not needed for a connection, the parameter may be entirely omitted.

Each parameter consists of four elements; the name, the equal sign, the value, and the closing semicolon. (name=value;) The parameter value is not required unless the parameter is required (name=;), but of course, it may be entirely omitted in that case if desired.

A connection does not need to be closed before making a new connection. If a connection is open when the command is received, the object will close it and clean up before attempting the new one. However, professional development should explicitly close connections in case of system failure. If the new one fails, no connection will be open. Note that any dependent Vector objects must be considered.

If the requested database is already open in the current connection, this command will close and re-open it. Therefore, if the database is open, the host must want to re-initialize the connection with this command.

Comments, requirements, and cautions expressed in the OpenDomain and openDatabase sections are applicable to this command.

( If the domain does not exist, unlike the OpenDomain command, the connect command will not create a new domain. )

Errors :
      Some errors are so serious that the connect must be halted and an error returned. That situation can be rectified only by a restore from backups.
      Otherwise, it will attempt to proceed to completion and an error will then be returned. In that case, operation should not continue; the host should handle the returned error or pass it on to the user and halt.

Parameters that are under construction may be included without detriment.

description:
      Optional. In the spirit of the AxleBase objective of making things accessible to the owner, he will allow the inclusion of a description. This may be of use to the host operator. For example, the AxHandle demo app saves connections with their descriptions. description = This is a connection to the production database. ;

When using a description in the connection, do not include reserved words. The recommended position is at the end of the string in case a reserved word is accidentally used in the text.

driver:
      Optional. The ODBC or local driver name. Local direct connects do not currently require this parameter. driver = AxleBase_a ;

domain:
      Required. This must be the entire path to the domain's master database including the final directory which must also be the name of the domain. domain = value ;

domainPassword:
      Optional. This is not the user's domain password. It is the domain's master password. domainPassword=value ;

database:
      Required. The name of the database. Only the name of the database without its path. databaseName=value;

databasePassword:
      Optional. This is not the user's database password. It is the database master password if needed. databasePassword=value ;

userDomainId:
      Optional. The user's domain-level login name if crud is active at that level. userDomainId=value ;

userDomainPassword:
      Optional. The user's domain-level password if crud is active at that level. userDomainPassword=value ;

userDatabaseId:
      Optional. The user's database-level login name if crud is active at that level. userDatabaseId=value ;

userDatabasePassword:
      Optional. The user's database-level password if crud is active at that level. userDatabasePassword=value ;

server:
      Optional. May be the name or the IP. server=value ;

connectTimeOut:
      Not currently used.
Number of seconds for the system to try to connect. After that period, the system will return a timeout error. May be left blank, but if a valid value is entered and it is greater than zero, then it will over-ride the system setting. connectTimeOut=value; (See also the Configuration chapter, Connect Timeout sub-section.)

queryTime:
      Not currently used.
Number of seconds for the system to wait on a query return. After that period, the system will return a timeout error. May be left blank, but if a valid value is entered and it is greater than zero, it will over-ride the system setting. queryTimeOut=value ;

See also: OpenDatabase; OpenDomain; The Default Database attribute.

Return expected:   Nothing.
Return on error :   Error message.

Example with minimum requirements:
sReturn = oMgr . Connect ( " domain = c:\program files\AxHandle\db\; database = demo; )

Example uses sReturn to catch error returns.

Example:
sReturn = oMgr . Connect ( " driver = AxleBase_a; domain = //192.168.48.200/program files\AxHandle\db\; database = demo; description = this is to the test database; )

Example uses sReturn to catch error returns.

Example:
sReturn = oMgr . Connect ( " driver = AxleBase_a; domain = //192.168.48.200/program files\AxHandle\db\; database = demo_virtual; description = this is to the test database; )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
CreateDatabase



Syntax:
oManagerObject . CreateDatabase databaseName , location [ , databaseType ]

The Manager object must open a domain before it can create a database. The new database will be created in that domain.

A database cannot be open when this command is executed. After the new database is created, it is opened for immediate use in the database object which created it.

Name :
      Database names must be unique within each domain. Names must begin with letters. They cannot contain spaces or extended ASCII characters. They cannot be a SQL command word or a data type. The reserved word list may be obtained from the Manager object with the showReservedWordList command.

Location :
      Databases may be located anyplace on the network to which the domain has access.
      The location is a complete path including the final directory in which the database resides. The recommended name for the final directory is the name of the database. AxleBase will accept a drive letter or an UNC in this parameter. A drive root is not permitted.

Operating System:
      An AxleBase database may be located on any computer and any operating system.

CAUTION:
      Do not locate a database under a domain database. At an unforeseen time in the future, the database will probably be destroyed. As noted elsewhere, the domain database must contain only those things which AxleBase puts there.

DatabaseType:
      The database type is not yet used and should be blank.

See also: DropDatabase; ShowDatabaseCatalogue; The Default Database attribute.

Return expected:   Nothing.
Return on error :   Error message.


sReturn = oMgr . createDatabase ( Databasename , "c:\program files\AxHandle\db\DatabaseName" )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
CreateIndex



Syntax:
oManagerObject . CreateIndex sqlStatement [ ; extensions ]

Where sqlStatement is a statement in the form:
CREATE [ UNIQUE ] INDEX [ indexName ]
ON tableName ( columnName1 [ , columnName2 ... ] )

And the non-standard VLDB extensions are:
[ ;
[ SEGMENT( start,count ) ; ]
[ LOCATE ( location [ , permanent ] ) ; ]
[ NODE ( nodeSpecifications ) ; ]
[ FORCEVALUE ( value ) ; ]
]

Index names may be duplicated in the database, but must be unique within each table. They must adhere to the AxleBase naming requirements. At the present time, index names are limited to ten characters.

The index name is not required. If it is left blank, then a meaningless randomly generated character string name will be assigned to it.

The creation of a primary key also creates an index to support the primary key.

The ExecuteSql command requires the complete SQL statement, but the 'create index' keywords are optional when using the AxleBase CreateIndex command. This feature allows the same command string to be used with the ExecuteSql command for uniformity.

The Indexing sub-section of the Embedding And Running AxleBase section comments on the subject of indexing.

VLT Extensions :
      The extensions are non-standard clauses.
      They can be ignored in normal databases. They are provided for the management of very large and geographically distributed tables and are covered in the VLT addendum to this section.
      Beginners are advised to avoid non-standard SQL in any database manager and to be wary of those brands which do not provide this warning.

Virtual tables which use an external text file source may be indexed. It may be unwise to index objects that are outside the database, so such action should be well considered beforehand.

Unique :
      Because AxleBase is expected to handle astronomically large tables, a unique index is enforced only within each table segment.

Segment Size :
      The use of an index on an over-sized table segment may fail or may return erroneous data. Therefore, if the database segment size has been changed from the default size to zero, which is unlimited, or to more than the standard size, then AxleBase will decline the index. (This may be reviewed at a later date.)

Index Size :
      Indices occupy space in storage, and the indices of a VLT occupy considerable space, so they require management by the DBA. When calculating a table's requirements, indices must be included. The projected size of an index is ( (51 + fSize) * r ) where fSize is the total size of all indexed fields and r is the segment row count.
      The segment size limitations for the table also apply to index files. If an index is allowed to exceed the maximum, the excess will be unuseable so that query returns will be erroneous. If the projected size is greater than the 2.1 gig limit, then the table segment size should be reduced. That will reduce the row count per segment which will thereby reduce the index file size per segment.

High Speed Build :
      A high speed table build, such as with the arrayed insert, while building its index will slow the build greatly. Dramatic speed improvement can sometimes be attained by first building table segments and then indexing completed segments in a separate operation.

Normal Build :
      A normal table build usually hides the slow speed caused by indexing because the system spends so much time waiting for work. It is therefore usually advisable to allow the index to build during the table build for normal operations.

AxleBase is optimized for very large tables. He monitors table segment data as the table grows and may sometimes decide that a segment needs to be reindexed. That will happen only if the index is built as the table is built. It will not happen if the table segments are indexed after they are built. It will also seldom happen in small tables.

The AxleBase indexing mechanism is specially designed to reduce disk I/O and network traffic in axsys operations on a VLT. The result is that a single-engine index operation is slightly slower than a big name brand, but it reduces the load on the target computer and on the network to allow an axsys to work faster.

Build Time :
      A modest sized field of repeating values can be indexed in a matter of minutes by a fast computer even for a two gig segment. However, a field that has unique values can require great computational power for each segment. For very large tables, see the VLDB Addendum to this section for assistance.

Locks :
      An index build does not lock the table source. When the source is a large dataset, AxleBase reduces contention for storage access by reading in large data chunks on each access. That usually means that megabytes are read each time which may impact other operations.

See also: DropIndex, ShowIndices, AlterTable, ForceIndexEvaluation in the Configuration chapter.

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . CreateIndex ( "create index myindex on t_log ; ( log_time ) ; " )

Example uses sReturn to catch error returns.

VLDB Addendum To CreateIndex

The following comments and instructions do not apply to normal databases.

This addendum should be ignored unless very large tables are used. When using the specialized VLDB mechanisms, the DBA staff must insure that the index names are controlled and accurately used by all instances.

If an index operation is interrupted, the index file will be corrupted for the segment which was being indexed at that time and that file must be deleted and rebuilt.

Parameter Control :
      When extended parameters are used, all clauses must be terminated by semi-colons which includes the SQL clause.
      Parameter sequence is not observed, but the SQL must be first.

Locate :
      Purpose is to increase speed and reduce file fragmentation.
      Each table has its own index files that are always located in directories named dbndx under their table files.
      The LOCATE parameter will write the index to a temporary location. The temporary location is not saved.
      The locate can reduce the time for a single segment index from hours to minutes and has been seen to reduce fragmentation form a quarter of a million to one. The location and the source data should be on separate drives to give dedicated heads to each.
      This parameter will not change the required location of the index after it is built. The index files must afterwards be manually moved to their correct locations.
      The optional 'permanent' keyword can be entered to make the location permanent. The location will apply to all segments that are being indexed and only to those segments.

ForceValue :
      The AxleBase development environment uses the forceValue parameter and it should be ignored. That is its sole purpose and it may be dropped in the future.

Segment :
      The optional non-standard SEGMENT parameter allows very fast indexing of very large tables by allowing the assignment of segments to separate AxleBase instances.
      The starting number specifies the first segment in the range and the count will be the number of segments that are indexed.
      Table segments are numbered sequentially beginning with the base segment which has the table name. The segment clause requires the number of the segment and not its name.
      The segment clause creates the index files without showing that the table is indexed. That feature allows extensive work on a large index to take place without confusing a production environment. To make the index available, run the index command with a segment count of 0. This cannot be done by an axsys node. (The ShowTableAttributes command reports whether or not a table has an on-line index.)

If a segment index file exists, then the index command will bypass it. That feature protects index files and prevents instance contention in a large operation. That also means that a corrupt segment index can be rebuilt only after its file is deleted.

NodeSpec :
      The optional node specification can be used by an axsys to target nodes. The syntax of the parameter is :
      node ( server6 , server29jperkins, 15 )
where 'node' is a literal. Node and cell specifications may be listed within the parentheses.
      The nodes in an axsys look for segment specifications in their configurations for the table. If found, they will each work on their specified segments. The SEGMENT parameter will be ignored.
      Caution : When used with the LOCATE parameter, all nodes must have an identically named local target location.

Instance Exclusions :
      The following AxleBase instances will not participate.
      Instances that are not axsys nodes if the node spec is used.
      All axsys nodes if the node parameter is not used.
      Any axsys node that does not meet a node specification.
      Nodes having no segment spec or a zero spec for the table.

This example marks the table as indexed and builds the first segment index.
sReturn = oMgr . CreateIndex ( "ndx1 on t_log ( owner ) ; segment(1,1) ;" )

Another computer runs this command simultaneously to index the second segment.
sReturn = oMgr . CreateIndex ( "ndx1 on t_log ( owner ) ; segment(2,1) ; " )

While a third computer runs this command to build twenty index files offsite.
sReturn = oMgr . CreateIndex ( "ndx1 on t_log ( owner ) ; segment(3,20) ; locate ( \\server25\server25c\db\dbndx ) ; ")

Note that all three submit a complete command for the index.

To create an index without building a segment index, the segment number or count may be 0. In that case, the index will be created without an index build for any segment.

This example creates the index and quits without creating any index data files.
sReturn = oMgr . CreateIndex ( "ndx1 on t_log ( owner ) ; segment(1,0) ;" )

If the index file for a segment is lost, it may be rebuilt with the segment specification. Note that this would temporarilly create an incomplete index for the table, so a query using that index would return erroneous results until the file is replaced. The table might be taken off-line while the file is being rebuilt to avoid such problems.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
CreateTable



Syntax:
oManagerObject . CreateTable sqlStatement

Where sqlStatement is a SQL statement in the form:
[ CREATE TABLE ] TableName (
columnDef_1 , columnDef_2 , columnDef_n ... [, constraint ] )

Where column definitions are:
columnName dataType [ (width if string) ] [not null] [default defaultValue]

Where the optional constraint is:
constraint [constraintName] primary key ( column1name, column2name, ... )

AxleBase checks name validity within the SQL statement. Names must begin with a letter. They cannot contain spaces or unprintable ASCII characters. They cannot be the root or the master database. They cannot be a SQL command word or a data type. There is a word list and a character list in the appendix.

Standard SQL uses the words 'create table' in the statement. The words 'create table' are optional when using this command.

The command is used by the Manager object and not by the Vector object because it treats a data object and not the data.

Constraints :
      All constraint clauses are accepted and parsed, but only the primary key constraint is currently operational. The constraint name may be blank. If the constraint name is blank, AxleBase will assign a name. The constraint name must be unique in the database.

Default :
      If a default is specified, it must be a literal with no no embedded punctuation, which meets the column specifications, and must be last in the column specification.

AxleBase does not yet recognize computed columns and column constraints.

See also: DropTable, ShowTables

Return expected:   Nothing.
Return on error :   Error message.

Example:
sreturn = oMgr . CreateTable ( " CREATE TABLE T_LOG ( log_time datetimex not null, error_flag string(1), operator string(20) default none, station string(20), log_msg string(100), constraint primary key ( log_time ) ) " )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
CreateVirtualTable



Syntax:
oManagerObject . CreateVirtualTable SQLstring | virtualParameters

Where SQLstring is the standard create table statement:
[ CREATE TABLE ]   TableName (
column_1 dataType , column_2 dataType , column_n ...
[, constraint [constraintName] primary key ( column1, column2, ... ) ] )

and the virtual parameters are in the form:
              | sourceType = value
            [   | sourceName = value ]
            [   | sourceLocation = value ]
            [   | columnType = value ]
            [   | columnSeparator = value ]
            [   | rowTerminator = value ]
            [   | encrypt = value ]
            [   | connectionString = value ]
            [   | makeString = value ]

The bar in this case is not an "or" symbol.

CreateVirtualTable instantiates one or more external objects in the local database. The table appears real, but it is a local manifestation of a remote data entity by a virtualization mechanism.

Clarification :
      A virtualization is not a copy of data.
      It is an expression of a real external data entity inside the local database.
      Data in an AxleBase virtual table is actually the live remote data which is virtualized in the local database and the live remote data can even be updated in most cases.

The command string is a standard SQL CREATE TABLE command to which is appended the virtual parameter string. Parameter sequence is optional. See the Configuration chapter for additional discussion of the various parameter values.

Virtualization should not attempt to circumvent the AxleBase constraints. For example, a text file source must meet the segment size constraints.

Separator :
      The parameter separator is the vertical bar (Known as a pipe to old UNIX users.) because the usual separators may be encountered within parameters.

Locations :
      Every location that is used in a definition must be accessible from the local database. Testing before definition is recommended.

Reserved Words :
      Text files may require the use of ambiguous or reserved characters. The problem can be circumvented by using the following seven-character string to specify row and column separators.

string   to replace
-*com*- Comma.
-*cos*- AxleBase columns separator
-*eol*- End of line.
-*pip*- | (The virtical bar.)
-*sem*- The semi-colon. (;)
-*spc*- Space.
-*tab*- ASCII chr 9 (windows tab)

Text File Source

updates no
inserts no
deletes no
indexing yes
________________
sourceType T
sourceObjectName Source file name with suffix.
sourceLocation Complete path.
ColumnType [optional]
ColumnSeparator [optional]
RowTerminator [optional]
EncryptString omit
ConnectionString omit
MakeString omit

Source Validation :
      Organizations frequently need to prepare in advance for delivery of text files, which requires that the table be created without an existing text file. Therefore, this type of table is not validated against the text source and the individual must assume responsibility for that validation.

Index :
      The table may be indexed like any other.

Caution :
      Do not define an AxleBase table segment as a text source. It is possible to do that, but indexing will conflict and may result in corruption. Instead, use types X or C virtualization.

End Of Text File Source

External AxleBase Table

updates yes
inserts yes
deletes yes
indexing Uses source indices.
________________
sourceType X
sourceObjectName Source table name.
ObjectLocation omit
ColumnType omit
ColumnSeparator omit
RowTerminator omit
EncryptString omit
ConnectionString The database name.
MakeString omit

Database Source :
      The source table may be in another database. The sources must be in the local domain. If a database is in a different domain, it must be quailified by its domain path. Qualification is effected by pepending the database name with its domain path and connecting the two with a period; e.g. \\server200\c\db.databasename.

Shared Attribute :
      The source table's shared attribute must be set to yes or read. If shared is "yes", then all operations may be performed on the data. If shared is "read", then virtual tables will be read-only and rows cannot be updated, inserted, or deleted on the virtual end.

Attributes :
      Table attributes are changed when necessary to match the source such as the column separator. The name alias is not changed. After successfully creating a virtual table, the ShowTableAttributes command is recommended to review the results.

Columns :
      The column specification is irrelevent. The system's create mechanism changes all column specifications to match the source columns. Any string of characters may be used.

Source Changes :
      After a table is shared, its structure and attributes cannot be changed.
      To change the source, change shared to no, make the changes, and change shared back to yes.
      If changes are made to the source structure, attributes, indices, or to one of its locations, then the virtual table must be dropped and re-created. The drop and re-creation of a virtual table will not effect source objects.

Indexing :
      The table cannot be indexed. It will use the indices of the source table.
      Indices of the source table must be created before virtualization.

Security :
      Security of the data is shared by all participating databases because all have direct access to the live data. The virtual table's security becomes the responsibility of each database that virtualizes it.

Chains :
      For security, chains are not permitted; i.e., sharing a virtualized external table.

End Of External Table Source

Concatenated External Tables

updates yes, discouraged
inserts yes, discouraged
deletes yes, discouraged
indexing Uses source indices.
________________
sourceType C
sourceObjectName Source table names.
ObjectLocation omit
ColumnType omit
ColumnSeparator omit
RowTerminator omit
EncryptString omit
ConnectionString Database names.
MakeString omit

Comments for the External AxleBase Table are applicable to concatenations.

Sources are checked at the time of creation and all must pass. Other than names, all source structures and attributes must be identical. Column names are taken from the first table in the list.

Limitation :
      Concatenation is limited to seven million tables. The practical limit may be less because the table is built and evaluated in RAM.
      Virtual concatenated table is limited to seven million segments. (That may be increased to the AxleBase limit in the future.)

Source List :
      The source names are the tables and the connections are the databases. The table sequence must match the database sequence. The lists are comma-separated. Repeated sources is permitted for testing purposes so the DBA must avoid repetition unless it is intentional.

CAUTION :
      If a concatenated table becomes a VLT, then it will require some cautionary measures that are applicable to a VLT.

CAUTION :
      ! Updates are strongly discouraged !
      An update may move the data across tables or databases.
      The location of an insert will be unknown.
      A delete across live tables may not have the intended effect.
      Row and segment ordinality may move across databases.

Indexing :
      The virtual concatenated table cannot be indexed, but it will use the indices of the component tables.
      Indices of component tables must be created before concatenation.
      All component tables must be identically indexed including identical index and column names. In queries, the index structure is taken from the first table read by the loader. Failure to insure indentical indices will result in query data loss.
      If an index is dropped or created, the virtual table must be dropped and re-created.

Table Refresh :
      This kind of table is not on line immediately after creation. It is brought on line when the database is opened after the table is created.
      The segment pointers are then harvested from the source tables. They will not be refreshed until the database is opened after the temp timeout.
      New segments in source tables are detected during refreshes.
      Refreshing a very large concatenated table might take a long time because the concatenated source pointers are harvested from the source databases.
      To increase speed, the system limits itself to one refresh per table per timeout period, which defaults to once per day. That causes only the first opening instance to be slowed by the harvest. (See the Configuration chapter to change the cat timeout.)
      The refresh is recorded by writing a refresh file into the \dbcat\ location. A refresh can be forced by deleting that file and opening the database.

End Of Concatenated Tables Source

ODBC Source

Source type : O

When a problem occurs in a big-name database manager, the connected system is blamed, so it is doubtful that AxleBase will use ODBC sources. It would be a simple addition and most of the internal structure was built for it, so this may be reconsidered if there is a serious need for it, but that is doubtful.

End Of ODBC Source

See also: DropTable, ShowTables, ShowVirtualTables, ShowTableAttributes commands and the Virtual Databases chapter.

Return expected:   Nothing.
Return on error :   Error message.

Example instantiating a remote text file in a table:
sReturn = oMgr . CreateVirtualTable ( "T_VIRTUAL_FERTILITY_FACTBOOK_TEXT ( COUNTRY string(52) FERTILITY_RATE string(46) ) [sourceType = t | sourceName = fertile.txt | columnType= f | sourceLocation = D:\factbook\2002\database ]")

Example uses sReturn to catch error returns.

Example instantiating an external AxleBase table:
sReturn = oMgr . CreateVirtualTable ( "T_LOCAL_LOG ( filler see notes above ) | sourceType = x | SourceObjectName = t_log | ConnectionString = demo_main ")

Example uses sReturn to catch error returns.

Example virtualization from a different domain:
sReturn = oMgr . CreateVirtualTable ( "T_LOCAL_LOG ( filler see notes above ) | sourceType = x | SourceObjectName = t_log | ConnectionString = \\server38\server38c\domain.demo ")

Example uses sReturn to catch error returns.

Example virtualizing concatenated tables:
sReturn = oMgr . CreateVirtualTable ( "T_VIRTUAL_LOG_CAT ( filler see notes above ) | sourceType = c | SourceObjectName = t_log, t_log_dup,t_log, t_log | ConnectionString = demo_main,demo_main, demo_virtual , large_table_test ")

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
Crypt



Syntax:
oManagerObject . Crypt operation, [returnType],[level], key, string

or
oManagerObject . Crypt2 operation, [returnType],[level], key, string, byteArray()

This function encrypts and decrypts whatever is passed to it. The crypt technology was developed specifically for AxleBase and without review of cryptographic literature, so it may deviate from the norm.

Operation :
      The required operation type must be "e", "d", "encrypt", or "decrypt".

Input :
The input can be passed as a string of characters, a comma seperated string of ASCII values, or as a byte array.

Key :
      Key is required.
      No maximum length.
      Spaces are ignored.
      Use only the American English keyboard.
      Carriage returns and other controls are not allowed.
      Randomness is not required.
      But repeating characters are not allowed.
      Level 1 minimum length is 10 characters.
      Deeper Levels minimum length is twenty characters.
Using the wrong key for a decryption may return an error, or nothing, or garbled text. The unpredictability is by design.

Crypt2 Command :
The second command form is provided for advanced developers who need to use a byte array. It gives no other advantage.
      Both the string and array are required, but one is used.
      If the string is empty, the byte array will be used.
      The array must be dynamic to allow a redimensioned return.

ReturnType :
      Optional.
      If blank, the type of return will match the input.
      If present, it will dictate the type of return.
      It works the same way for encryption and decryption.
      There are three valid types:

code     description
c     A character string.
n     ASCII character numbers.
a     A byte array.

Returns :
      The return is "by reference" within the input variable.
      It may be a string, string of ASCII numbers, or byte array.
      An ASCII number string will be comma-separated.
      Error returns use the standard error protocol.

Spoken Language :
      All languages can use the ASCII numbers and byte array.
      Character strings are only English.

The crypt technology is intended only for communication between AxleBase instances. AxleBase will not participate in external encryption and will not accept external participation in its encryption. If third party encryption is desired, then it must be handled by the host.

Attempting to read an AxleBase encryption in transit sometimes corrupts the message.

Release Numbers :
      If the encrypt/decrypt is not working between instances, check their release numbers with the ShowRelease command. Internal encryption mechanisms may be changed without notice in new releases to change the encryption algorithm.

Level :
      Optional.
      Will over-ride the database attribute setting.
      See discussion in the Configuration chapter.
      (The use of deep levels requires a corporate key to discourage thieves.)

Encryption Strength :
      The AxleBase objective is heavy data management on light personal computers which cannot be expected to deliver high speed data encryption of large datasets. Therefore, the encryption is relatively weak to maintain database speed. Where strong encryption is needed, it is expected to be built into the host or outsourced.

Requests :
      Compromise should be expected in continued use; especially in a large axsys on a shared network. Requests for new releases with an altered encryption algorithm may be considered because the internal mechanism is designed to be changed. Such a change should be expected to deliver only a changed algorithm and not necessarilly stronger encryption.

RAM Usage :
      Encryption sometimes requires enough RAM to hold several copies of the dataset. Not having sufficient RAM for the encryptor will result in disk thrashing for virtual memory with enormous slowing. Overly large datasets can be avoided by using the DeferReturn option.

Number String :
      AxleBase uses the entire range of characters, but operating systems and hosts cannot handle all of them. The number return solves that problem.
      The number string simplifies moving an encryption through various operating systems and networks.
      The number string provides a way to encrypt binary data that otherwise might require a byte array.
      A number string must have more than one number. If it has only one number of three digits, AxleBase must regard it as a string of three digits.

Byte Array :
      The byte array should be used only by advanced developers who need to operate at a low level.
      Its encryption is no deeper.

EncryptReturn :
      When the EncryptReturn attribute is turned on, AxleBase uses this function internally to encrypt the dataset before passing it to its host. The receiving system must pass the encrypted dataset to its AxleBase instance for decryption. (See EncryptReturn in the Configuration chapter.)
      If the host wants to embed the dataset in an encrypted envelope, then EncryptReturn should be off. After getting the unencrypted dataset from AxleBase, the host should place it in the envelope, pass the entire envelope to the Crypt function, get the returned encrypted string, and then transmit it.

See also: ReturnDataStream; ReturnDataset; the EncryptionLevel and EncryptReturn sections of the Configuration chapter; DeferReturn .

Return expected:   None.
Return on error :   Error message.

Example:
sReturn = oMgr . crypt ( "e", "n", , "myFavoritekey" , "This is a test." )

The encrypted return will be a comma-separated string of numbers.
Example uses sReturn to catch errors.

Example:
sReturn = oMgr . crypt ( "d","c",,"myFavoritekey",",84,104,105,115,32,105,115,32,97,32,116,101,115,116,46")

The decryption will be a string of characters although numbers are passed.
Example uses sReturn to catch errors.

Example:
sReturn = oMgr . crypt2 ("encrypt",,,"this is my key","", byteArray())

The return will be in the array because it holds the input.
Example uses sReturn to catch errors.

Example:
sReturn = oMgr . crypt2 ("decrypt","c",,"this is my key","",byteArray())

The return will be in the string although the input is in the array.
Example uses sReturn to catch errors.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
DataObjectCount



Syntax:
oManagerObject . DataObjectCount

If the Manager object is used to create the data Vector objects, this command will return the quantity of extant Vector objects.

The first Data created is 1, and succeeding objects are numbered sequentially. (Please do not laugh. Some older programmers have a hard time remembering that.)

When the last created object is destroyed, it is set to nothing and the count is decremented by one. When an object that is not the last is destroyed, it is set to nothing, but the total count is unchanged; i.e., the count includes one which is nothing.

See also: DataObjectCreate; DataObjectDestroy; the Embedding And Running AxleBase chapter.

Return expected:   An integer value.
Return on error :   Error message.

Example:
sReturn = oMgr . DataObjectCount

sReturn will receive the value or will trap an error message if one is returned.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
DataObjectCreate



Syntax:
oManagerObject . DataObjectCreate [ internalName ]

Tells a Manager object to create a data Vector object. If successful, the command returns a reference to the new object.

A Manager may create and use any number of Vector objects.

When a Manager object creates a Vector object, it automatically connects the Vector object to itself. When the Manager object opens a database, the Vector object has an immediate connection to the database and can immediately query it.

If the optional internalName is passed with the command, the internal name of the new object will be set by the Database manager. Internal names are checked for validity. An invalid internal name will cause the function to fail without an error. Names are not checked for duplication.

This method of creating data Vector objects uses the Manager object to do the work and to help with subsequent control of the object.

A programming note :
      Objects that are created in this way must be destroyed with the DataObjectDestroy command before destroying the Manager object.

TIP: Since this command returns a reference to an object, there is no way for it to return an error notice. After running this command, if the object is nothing, then the ShowLastError command will return the error.

See also: DataObjectDestroy; DataObjectCount; The Embedding And Running AxleBase chapter.

Return expected:   Reference to the new data object.
Return on error :   Nothing.

Example:
set oObject = oMgr . DataObjectCreate
if oObject is nothing then
sReturn = oMgr.ShowLastError
end if

oObject is the locally defined object that will be set to the object created by oMgr.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
DataObjectDestroy



Syntax:
oManagerObject . DataObjectDestroy [ DataIdentifier ]

If a Manager object is used to create data Vector objects, this command may be used to tell it to destroy the Vector.

If the optional DataIdentifier is omitted, then all Vectors that were created by that Manager will be destroyed. ( Although the Manager tries to clean up when he is destroyed, good programming techniques would always run this command to insure cleanups.)

DataIdentifier :
      Since the Manager may create any number of Vectors, the optional DataIdentifier may be used to identify the target object among all of those currently extant in the Manager. It may be a name or an integer. A name would be the internal name of the Vector object if one was set by the host application; it is not the name handle that is used by the host. An integer would be the index number of the object within the extant collection of objects. The first object created is 1, and succeeding objects are numbered sequentially.

When the last created object is destroyed, it is set to nothing and the count is decremented by one. When an object that is not the last is destroyed, it is set to nothing, but the total count is unchanged; i.e., the count includes the one that is nothing.

If the specified object is already nothing or if it does not exist, no error is returned.

A programming note :
      The object in the host must first be set to nothing. The host's object is not actually an object, but is a reference to the object in the Manager. As long as there is a reference to the object in the Manager, it cannot be destroyed, although it will appear so. First, set the host Vector object to nothing and then destroy the Vector object in the Manager.

See also: DataObjectCreate; DataObjectCount; The Embedding And Running AxleBase chapter.

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . DataObjectDestroy ( "4" )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
DropDatabase



Syntax:
oManagerObject . DropDatabase databaseName

Destroys the data, all objects, the definition, and all references to the named database. The action is immediate and irrevocable.

This happens right now, and your database is gone in an eye-blink!! The command is accepted for execution even if the database contains data.

The database must be open when the command is submitted. The command will be attempted regardless of the state or condition of the database.

Lock Requirement :
      An exclusive database lock is required for this operation. (See LockObject command.) Before setting the lock, insure that the lock timeout will allow enough time for you to start the operation.

Notice that if the host has an open data object which has been connected to the database, then the database is still in use. The result will be an error and an inconsistent database. The data object should be closed before the command is submitted. (This was a long-running problem in AxHandle because the developer (me) forgot to clear the dataset after creating and testing the demo database.)

When told to drop a database, AxleBase traps errors only during the early phases of the operation. After object destruction has begun, an error will create an inconsistent database with no possibility of a rollback, so he will bypass errors after that point and continue the destruction of objects. After the DropDatabase command is used, remote and local objects should be checked to insure total destruction. This is especially true of an extensive VLDB.

See also: CreateDatabase, ShowDatabaseCatalogue

Return expected:   Nothing.
Return on error :   Error message.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
DropDomain



Syntax:
oManagerObject . DropDomain

Destroys the entire database domain. The action is immediate and irrevocable. The domain must first be opened.

Client Databases :
      The target domain can contain no client databases. If client databases exist, they must be dropped before this command will execute. An error will be raised if the domain contains databases.

Rollback :
      This operation has no rollback. Failure in mid-operation will leave the domain in an invalid state. Before execution and after dropping all databases, the host app must insure that the domain is not in use and has been locked down. Backup of the entire domain before execution is recommended.

Lock Requirement :
      An exclusive database lock is required for this operation. (See LockObject command.) Before setting the lock, insure that the lock timeout will allow enough time for you to start the operation.

See also: OpenDomain.

Return expected:   Nothing.
Return on error :   Error message.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
DropIndex



Syntax:
oManagerObject . DropIndex tableName . indexName

Destroys the specified index. The action is immediate and irrevocable.

CAUTION :
      AxleBase is designed to empower the Master DBA, so it is possible to drop all of a table's indices with a single command regardless of its size. Even more dangerous is the fact that a single command can drop every index in the entire database.

Primary keys are dropped by using the alterTable command; not with this command.

The index name parameter accepts an asterisk wildcard character. If the index name is an asterisk, then all indices will be dropped from that table including the key.

If the index name is a single asterisk without qualification or an asterisk qualified by another asterisk, then all indices in the entire database will be dropped.

See also: CreateIndex; ShowIndices; AlterTable.

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . DropIndex ( "myindex" )

sReturn is provided in case an error is returned.

VLDB Addendum To DropIndex

The following comments and instructions do not apply to normal databases.

A single AxleBase instance can usually drop an index quickly even if it is very large and distributed across a network. If there are no errors or network problems, and if the operating system has not been allowed to fragment files, an index of fifty billion rows in thousands of segments scattered across the network will take less than a second.

The system tables are updated before beginning the deletes of the segment index files. That makes the table available quicker and it makes a cleaner drop.

A process that is engaged in working with many files scattered across a network is susceptible to encountering problems. After the process updates the system tables, it will attempt to work through all errors without returning error messages until it is finished with the deletes of the segment index files. That allows the process to clean up as well as possible without corrupting the system tables, but the DBA should check the index locations afterwards. If the system shows that the index has been dropped, but a segment index file remains, it can be manually deleted.

Most networks are susceptible to producing spurious noise which can interfere with an extended drop process of a VLT. Therefore, the dropIndex process applies the spinlock value to each segment index operation.

When dropping a large index, it should be remembered that the operating system is extremely inept at file management and may have fragmented the files extensively. It is not unusual to find that the operating system has split a two gig segment file into a half million storage fragments. When that happens, each file deletion can take a very very long time.

As an example, in the test and development environment, a well-maintained index with five hundred segment index files will be dropped in a split second. However, when the operating system is allowed to fragment that same index, dropping it can take hours or days.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
DropTable



Syntax:
oManagerObject . DropTable sqlStatement

where sqlStatement = [ drop table ] tableName

Destroys the data, the definition, and all references to the named table. The action is immediate and irrevocable.

The words 'drop table' are optional when using this command. The redundency engendered by employing standard SQL may cause some confusion. However, it is hoped that the use of standard SQL may make life easier for the experienced DBA.

If the object is a VLT with extensive remote objects, their drop should be verified afterwards.

See also: DropTable; ShowTables.

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . DropTable ( "T_LOG" )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ExecuteSql



Syntax:
oManagerObject . ExecuteSql SQLcommand

Allows the Manager object to execute the SQL commands that would otherwise be passed to the customized AxleBase commands.

The customized AxleBase commands provide an interface that is designed for easy learning and control. The ExecuteSql command is provided as a single point of access for those who are more comfortable with SQL. It is recommended that when using this command, one should be familiar with the documentation for the customized commands.

The currently accepted SQL statements include:
            alter table
            create index
            create table
            create table (virtual)
            drop table
           

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . ExecuteSql ( " CREATE TABLE T_LOG ( log_time datetimex not null, error_flag string(1), operator string(20), station string(20), log_msg string(100), constraint primary key ( log_time ) ) " )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
Grant



Syntax in the industry standard:
oManagerObject . Grant
OWNER | ALL | SELECT | DELETE | INSERT | UPDATE | EXECUTE
ON [ DOMAIN ] | [ DATABASE databaseName ] | [ TABLE tableName ] | [ JOB jobName ]
TO userName

Syntax to use extended AxleBase features:
oManagerObject . Grant priviledgeType
ON objectType objectName
TO userName [ PASSWORD userPassword ]

The Grant command grants permission to access or perform operations on specified objects.

The first syntax is provided in conformance with the ANSI standard. The second syntax is the non-standard AxleBase version which is a bit easier to understand because the permissions are more logical. It also provides additional object control and adds the user password.

AxleBase adjusts the meanings of the parameters to match the object type. For example, if the second syntax is used for a table type of object, then the CREATE option includes row inserts and READ includes selects.

This command takes a single parameter which is the entire command string. To simplify host operations, the string may contain the grant keyword when the ExecuteSql command is used and when the Grant command is used.

This is a security component. As discussed in the Security section of the Embedding And Running AxleBase chapter, this feature is effective only when the host is a server such as a web server or an odbc server so that activity can be limited to remote connections.

AxleBase deviates from the standard to allow the command to cover entire domains and entire databases as well as tables.

The keyword DOMAIN applies the operation to the currently open domain, but the name of the object is always required after the object type keyword.

The optional user password is also a deviation from the standard. It sets a password that the person/system must present to gain access to the object. It can be required at any or all levels or objects. For example, its presentation might be required at a table level and not at the domain level.

Using the password requires some caution in the construction of the statement. If the string 'password ' keyword is encountered (note the space at the end of the string), then all characters that follow the space constitute the password.

For extended discussion of password use and construction, see the Embedding And Running AxleBase chapter, Security section, Passwords sub-section.

Names cannot contain spaces or other formatting characters. Names are case insensitive.

Components of the command are separated by spaces. There are no commas or other separating characters.

The rights keywords ALL, CREATE, READ, UPDATE, DELETE, and EXECUTE may be used in any combination to grant permission to perform the indicated operation. The keyword ALL may be used by itself to grant all of those permissions, but it will not include OWNER. They are case insensitive.

The rights keywords are optional so that the command can be used to allow passage through a level without giving rights to it. If, for example, it is a domain grant without a privilege keyword, then the person will be allowed to pass through the domain level to reach a database.

Upon installation, AxleBase defaults open to provide an unobtrusive security mechanism. At that point, all objects are available to all processes and do not require any grants. (See also Turning On Security in the Embedding And Running AxleBase chapter.)

See also: Revoke, ShowPermissions.

Return expected:   Nothing.
Return on error :   Error message.

Example granting ownership control of the demo database.:
sReturn = oMgr . Grant ( " all on database demo to allen password mysecret " )

or
sReturn = oMgr . Grant ( " grant all on database demo to allen password mysecret " )

Example uses sReturn to catch error returns.

Example giving limited access to the T_LOG table.:
sReturn = oMgr . Grant ( " select update insert on database table T_LOG to betty " )

Example uses sReturn to catch error returns.

Example allowing betty to enter the domain with no rights so she can get to her database:
sReturn = oMgr . Grant ( " on domain demodom to betty password mysecret " )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
Locate



Syntax:
oManagerObject . LOCATE LocationType , newLocation

This command will move specified objects and update system catalogues.

Following are valid LocationTypes:
      blob
      log
      segmentpointer
      temp

To help insure that the location parameter is indeed the desired location, the new location must be an existing location.

The system will immediately try to move all objects to the new location regardless of any system using them. The database should be closed, cleared and locked before issuing this command.

If an error is encountered during the operation, AxleBase will not attempt to roll back; rollback is the responsibility of the operator. AxleBase will update system tables only if the operation is a success. If the failure happens before relocation, no action is required. If the operation moves any files, then no existing files are deleted until all files have been copied to the new location.

It is possible to locate a client database under the domain database. Do not do that. At an unforeseen time in the future, the database will be destroyed. The domain master database must contain only those things which AxleBase puts there.

Caution:
      The relocation of large stores is strongly discouraged because of the probability of unforeseen problems and system failure.

Shared Tables :
      The relocation of indices or segement pointers may break shared tables.

This example relocates the database log.
sReturn = oMgr . locate ( " log , c:\log\ " )

Example uses sReturn to catch error returns.

This example relocates the temp work directory.
sReturn = oMgr . locate ( " temp , c:\dbtmp " )

Example uses sReturn to catch error returns.

VLDB Addendum To Locate

The following comments and instructions do not apply to normal databases.

A write map can be used to bypass the base table segment file. This might be done to reduce the load on the local system. The base table segment file is the first segment in a table and is written into the primary database location. If it is bypassed, it will remain empty and subsequent table segments can be directed to remote locations. See the discussion of the write map in the VLDB chapter.

Indices are always located under their table locations. If a table has multiple segment files, each segment index will be written under its segment.

The relocation of large files is not recommended because the movement of large files is subject to many operating system errors. This is especially true when the operating system has created great fragmentation in files. If the relocation is necessary, consider a manual relocation.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
LockObject



Syntax:
oManagerObject . LockObject objectType, lockType

Sets or removes a temporary discretionary lock on the currently open database or domain.

ObjectType :
      The required objectType parameter is database or domain.

LockType :
      The type parameter is a single character code which designates the type of lock. Only an "x", exclusive lock is currently functional.

Exlusive Lock :
      An exclusive lock takes an object offline. No other instances can open the object.
      The system will not accept an exclusive lock while other processes are working in the object and will return an error message.

Lock Removal :
      A blank specification will remove all locks.
      Repeating a lock command will release that lock.
      The system automatically removes all locks that belong to an instance when the instance does a controlled exit. A controlled exit is one that uses the shutdown command before destroying the Manager object.

Lock Storage :
      Locks are stored and controlled in lock tables that are named "t_lock.dat".
      If the entire "t_lock.dat" file is deleted, AxleBase will restore it without fault when the next instance loads.
      If an object is destroyed before shutdown and leaves an exclusive lock in force, the DBA can manually delete the lock file without fault.
      The lock table is purged of expired and invalid rows by the purge command.

Timeout :
      The system configuration includes a lock timeout. After a lock expires, it may be removed at any time by any process or instance regardless of the status of the instance that set it.

Attempting to open a locked object returns an error which tells the process that the object is locked.

See also the ShowLocks command and the Lock Timeout section of the Configuration chapter.

Return expected:   Nothing.
Return on error :   Error message.

Example placing a lock on the current database:
sReturn = oMgr . LockObject ( " database" , "x " )

Example uses sReturn to catch error returns.

Example removing the previous lock:
sReturn = oMgr . LockObject ( "database" , "x" )

Example uses sReturn to catch error returns.

Example removing all locks:
sReturn = oMgr . LockObject ( "database" , "" )

Example uses sReturn to catch error returns.

Example locking the current domain:
sReturn = oMgr . LockObject ( " domain" , "x" )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
NetworkScan



( Under construction or consideration. Currently unavailable. )

Syntax:
oManagerObject . NetworkScan [ returnToggle [ , tableName ] ]

This utility is designed for VLDB operations and will not usually be needed for normal databases.

The network is defined by the database; the utility looks for locations which are used by the database. A database must be open before execution.

This command is not designed to replace the network administrator's tools, but it can identify potential problems for database operations. Such problems are frequently of little or no interest to the network administrator.

It is designed to be run in a cyclical loop. A pause between loops is recommended. The recommended procedure is to dedicate an instance to running it. Since it is intense, the YieldProcessor should be set to yes so that it can be stopped.

ReturnToggle:
      Optional.
      The default is for the output to go into the log.
      If ReturnToggle is "yes", output will also be returned.
      Either logging must be on or ReturnToggle must be "yes".

If run interactively, an offline computer or network segment will cause each internal operation to take up to a minute. If the table has many segments on the faulty infrastructure, the report can take a very long time to return.

Each time that it is run, it checks the validity of all locations in the database. If the optional TableName is used, then only that table is checked. Otherwise, it checks all tables. (If that optional parameter is passed, then the returnToggle must also be passed.)

More discussion of operation and usage may be found in the Axsys State Assessment sub-section of the VLDB chapter. This command is not interchangeable with the TableCheck command.

See also: TableCheck

Return expected:   Nothing unless a return is requested.
Return on error :   Error message.

Example:
sReturn = oMgr . NetworkScan ( " no, t_log" )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
OpenDatabase



Syntax:
oManagerObject . OpenDatabase databaseName [ , userId [ , userPassword [ , databasePassword ] ] ]

Opens and makes a connection to the database. If the database does not exist, a trappable error message is returned. (The existence of a database may first be determined with the ShowDatabaseCatalogue command.)

The domain must be opened before one of its databases can be opened.

Optional apostrophe parameter delimiters may be used with the password option when AxleBase might otherwise not accept the literal string of characters. For example, leading spaces would be dropped by AxleBase, but if the string is inside apostrophe delimiters, then leading spaces are protected.

A database does not need to be closed before opening a new one. If a database is open when the command is received, the Manager object will close it and clean up before attempting to open the new one. If the new one fails, no database will be open. Note that the developer must consider any dependent data Vector objects.

If the database is already open, the object will be initialized and the database will be reopened.

Errors :
      Some errors are so serious that the open must be halted and an error returned. That situation can be rectified only by a restore from backups.
      Otherwise, it will attempt to proceed to completion and an error list will then be returned. In that case, operation should not continue; the host should handle the returned errors or pass them on to the user and halt.

See also: CloseDatabase, ShowDatabaseCatalogue.

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . OpenDatabase ( "DEMO" )

Example uses sReturn to catch error returns.

Example:
sReturn = oMgr . OpenDatabase ( "DEMO" , , , mysecrete )

Example uses sReturn to catch error returns.

Example:
sReturn = oMgr . OpenDatabase("DEMO" , , , mysecrete )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
OpenDomain



Syntax:
oManagerObject . OpenDomain pathWithName [ , userId [ , userPassword [ , domainPassword ] ] ]

This command opens the specified domain for administration and for access to its databases.

Purpose :
      The purpose of a domain is to control a group of databases.
      Its databases can be located anywhere on the network.
      It controls access to its databases.
      A domain must be opened before one of its databases can be opened or created.

Path :
      The pathWithName parameter must be the complete path. The name of the final directory in the path must be the name of the domain.

Security :
      The following is applicable only if security is turned on.
      Passage through the domain is required for database access.
      (See the Security section of the Embedding And Running AxleBase chapter.)

Domain Creation :
      This command will create the specified domain if it does not exist. The first step in initializing a database installation is the domain opening which creates the domain. AxleBase will accept a drive letter or an UNC. If the command creates the domain, all of its system tables are created with default values. (See the AlterDomainAttributes command and the Configuration chapter.)

Connection String :
      The Connect command can use a connection string to bypass this and other commands. It will open an existing domain and open its database. (See the Connect command in this chapter.)

Name Problem :
      Microsoft operating systems have created a genuine problem for us. For this command to function properly, it must conform to the operating system which allows the creation of nonsensical paths. Therefore, the operator must take care with this command so that he does not create trash on his hard disk. For example, entering
      OpenDomain "c:\program   files\db\domain\   ;"
will create a domain that is absurdly named " ;" because Ms Windows accepts spaces in directory names.

The AxleBase system is designed to support any number of database domains in an installation. Each domain can control any number of databases.

Errors :
      Some errors are so serious that the opening must be halted and an error returned. That situation can be rectified only by a restore from backups.
      Otherwise, it will attempt to proceed to completion and an error will then be returned. In that case, operation should not continue; the host should handle the returned error or pass it on to the user and halt.

See also: DropDomain; CreateDatabase; Connect

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . OpenDomain ( "c:\program files\AxHandle\db\demoDom ")

Example uses sReturn to catch error returns.

That example will open, connect to, or create the master in
c:\program files\AxHandle\db\demoDom

Example:
sReturn = oMgr . OpenDomain ( "c:\program files\AxHandle\db\demoDom, me, mypassword ")

Example uses sReturn to catch error returns.

Example:
sReturn = oMgr . OpenDomain ( "c:\program files\AxHandle\db\demoDom, , , masterpassword ")

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
Purge



Syntax:
oManagerObject . Purge [ object [ , action [ , nodeSpec ]]]

This utility reorganizes and deletes unused objects and data. (All brands of database managers must purge their databases, although some hide the operation.)

An update failure must be recovered before purging because rows that were involved in incomplete transactions will be purged.

Optional Parameters :
      All parameters are optional. When an optional parameter is used, any preceeding optional parameters must also be present, but may be blank and represented by only their separating commas. Blank parameters are ignored.

Object parameter may be :
      Blank which defaults to "database".
      "database".
      "domain".
      "system".
      Any table name.
      Any table name preceded by "not"; e.g., "not t_log".
Objects are mutually exclusive.

Database Object :
      Database does not need to be specified because it is the default. Requires DBA clearance if security is on.

Domain Object :
      Requires domain-level DBA clearance if security is on.

System Object :
      If the keyword "SYSTEM" is encountered in the object parameter, then only the database system objects will be purged. For example, the DBA may have cause to be suspicious of the performance of the lock table and want to purge it without purging data files. (See example below.)

Table Object :
      The table specification may contain up to four elements.
      If only a table name is present, only it will be purged.
      If "not" precedes it, all except it will be purged.
      A start segment number may follow it.
      A segment count must follow a segment start.
      Segment specification may not be used with a "not".

Action :
      The optional action accepts only "force" or "count".

Force Database :
      Purge normally bypasses table segments without deleted rows.
      A "force" action will force it to purge all objects.
      A purge may need to be forced for an inconsistent database. It should be forced, for example, if a failed transaction cannot be recovered.

Force Domain :
      Purge normally does not check databases.
      A "force" action will force it to look for databases.
      Catalogue will be purged of unfound database locations.
      No other action will be taken.
      CAUTION : A domain backup is recommended before this.
      If the network causes the temporary disappearance of a location while this utility is running, that database will be removed from the domain and will become inaccesible.

Count :
      A "count" action will correct all row counts.
      It will change or correct nothing else.
      A count that encounters a deleted row will err.
      An uncompleted transaction will err.
      An error signals the DBA to run a normal purge.

NodeSpec :
      Not needed by normal databases. The node specification is used only by an axsys and usually only with a very large and geographically distributed table. See the VLDB addendum.

Backups :
      A backup is recommended before execution of this command. It might also be helpful in the event of a failure to turn logging on before execution.
      Some database managers run a purge of their database during the backup. Because AxleBase can have immense tables, the purge and backup are segregated to give the DBA better control.

TableCheck :
      The purge mechanism no longer runs a TableCheck before beginning because you may need to clear a tablecheck error by running the purge. Since it does not automatically run, it is advisable to run it beforehand for diagnostics.

Frequency :
      The frequency of use of this command depends upon the activity level of the database. A table that only stores data for queries might never need a purge. A high usage table in which rows are updated or deleted might require a purge interval measured in hours.

Component Procedures :
    Removes deleted or unused rows from the storage space.
    Rebuilds all indices.
    Purges, validates, and initializes system tables.

Empty Segments :
      The purge will not remove empty table segments because the sequential property of segments is used to verify table integrity and because empty segments occupy little storage.

The following will not be purged. :
      External tables.
      Concatenated tables.
      External files.

Indices :
      The purge will not alter an index definition.
      Indices are rebuilt for each segment that is purged immediately after it is purged. This increases the internal complexity of the operation and sometimes increases the duration of a purge, but the overall result is a faster and safer operation.
      If an index was built as the data was added, then a general type of index was built. The purge will analyze existing data to determine the best index for it, which may increase system performance.

Restarts :
      A purge process insists on checking everything for itself, so it always starts at the beginning. If a problem stops a purge and it is restarted, it will again run through all operations and objects from the beginning of the process.

The operation is intense and is especially so for a VLDB.

Lock Requirement :
      An exclusive database lock is required for this operation unless it is executed by an axsys. (See LockObject command.) Before setting the lock, insure that the lock timeout will allow enough time for the operation to complete. The lock is required even for a single table since the system cannot know the use or importance of that table.

For those who are accustomed to other database managers :
      Oracle uses the term "table reorg" for similar operations.
      InterBase uses the term "sweep" for similar operations.
      FireBird uses the term "sweep" for similar operations.
      Ms. Access uses "pack" and "repair".
      Mainframes hide the process under dollar bills.
      InnoDb purge means something totally different.

Return expected:   Nothing.
Return on error :   Error message.

Example purges everything in the database :
sReturn = oMgr . Purge

Example uses sReturn to catch error returns.

Example purges all except the t_log table :
sReturn = oMgr . Purge ( "not t_log" )

Example uses sReturn to catch error returns.

Example forces a purge of t_log whether or not it needs it :
sReturn = oMgr . Purge ( "t_log , force" )

Example uses sReturn to catch error returns.

Example forces a purge of 10 segments starting with segment 50 :
sReturn = oMgr . Purge ( "t_log 50 10 , force" )

Example uses sReturn to catch error returns.

Example purges only the system tables :
sReturn = oMgr . Purge ( "system" )

Example uses sReturn to catch error returns.

VLDB Addendum To Purge

The following comments and instructions do not apply to normal databases.

The behavior of an axsys in purge operations is different from its behavior in queries. Generally speaking, the entire axsys is vectored in a purge and the parameters can be used to increase the vectorization.

NodeSpec :
      The optional node specification can be used to target nodes in an axsys. When a node specification is present, then only the qualifying nodes will participate in the operation. The syntax of the parameter is :
      node ( server6 , server29jparks, 15 )
where 'node' is a literal. Node and cell specifications may be listed within the parentheses.

Segment Ranges :
      The nodes in an axsys look for segment specifications in their configurations. If found, they will each work on that table and on its specified segments.
      Encountering an invalid segment number during the operation will not be an error and the operation will simply stop. That allows the DBA to plan for expansion by using ficticious segment ranges in the axsys configuration.
      However, the disappearance of a valid segment during the purge will raise an error.

Instance Exclusions :
      These instances will not participate in a purge :
      An instance that is not an axsys node if the node parameter is used.
      All axsys nodes if the node parameter is not used.
      Any axsys node that does not meet a node specification.
      Nodes will skip tables for which they have no segment spec.

Operation Exclusions :
      For safety, nodes cannot purge database and domain system tables.

Contention Area :
      Any instance that works on a table in a purge must access and update the table's segment pointer table, which is a single object. Therefore, the multiple nodes of an axsys working on a large table may sometimes experience contention problems. Before beginning a purge operation, the spinlock should be made adequate and a copy should be made of the pointer table. If nodes report problems, the pointer table may require restoration and the purge should be restarted with the "force" parameter.

Index :
      A segment's indices are rebuilt after it is purged and only by the instance doing the purging.
      A purging axsys rebuilds indices in the default locations.
      A segment with no changes will not be re-indexed unless forced.
      If there may be changes throughout a VLT, consider dropping indices before purging. That will speed the purge and will permit tighter error management. Re-indexing afterwards will be far faster and safer than allowing the purge to do it.

Work Areas :
      Multiple copies of table segments are maintainted in the temporary work area by each working instance during a purge. Each instance engages in protracted storage input-output in the work area. The assignment of local temp work areas to axsys nodes in their configurations will avoid tremendous contention.

When selecting dbtemp locations, insure that the media can support them. AxleBase sometimes creates work files of gigabytes and some disk types cannot handle files of that size.

Note the exclusions above. If the DBA wants an entire axsys to do a general purge of all tables, then the asterisk should be used in the node spec. In that case, all nodes will participate and each will check its segment range for each table. Nodes that have no segment range for a table will skip the table.

Despite the provision of VLDB extensions, a purge should be used with caution in a VLDB. The DBA staff should monitor resource utilization during the process and perform a detailed evaluation afterwards. The fact that it is designed to fail graciously should not be construed to mean that a VLDB would not be at risk from the enormous system load. The greater the degree of table segmentation, the greater the danger. A VLDB should be locked, cleared, and sealed before a purge if at all possible.

Locks :
      Due to the organizational complexity of distributed operations, a lock is not required for an axsys. A lock is applied to each segment as it is encountered and then removed when the operation is complete for that segment. Thus, a VLT will never be entirely locked.

Errors :
      Some errors in a distributed database manager will, themselves, be erroneous. See the Axsys section of the VLDB chapter for discussion.
      Nodes may be expected to entirely fail during a purge in a large axsys due to equipment failure. The Axsys section of the VLDB chapter has suggestions for handling node failures.
      If a node returns an error, the error should be evaluated for its impact. If it applies only to that node or its target, then only that node's operation must be re-run.

System :
      An axsys is not permitted to purge system files.

Completion :
      AxleBase does not signal completion of operations and nodes may complete at various times. The Axsys section of the VLDB chapter has guidance for operation state determination.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ReloadNode



( The axsys is operational, but it is still under construction and is subject to dramatic changes.)

Syntax:
oManagerObject . ReloadNode [ , ComputerId [ , LoginId ]]

This command tells the local AxleBase instance to reload its axsys configuration from storage and then reconfigure itself accordingly. Whereas the AlterAxsysRunningNode command directly changes the node configuration in the running instance, this tells the instance to reload from the stored configurations.

Identity :
      If the optional identity parameters are not used, it will reload its own node cofiguration.
      The optional identity parameters allow the local node to provide failover coverage by loading the specified node's axsys parameters. It will configure itself as the specifed node.
      To accomplish the failover reconfiguration, the waiting node must first be connected to the same database.
      An error will be raised if the specified node configuration is not found on file.

Return :
      A return is provided for dispatch to the axsys controller or other interested systems. Its purpose is to provide a trigger for addtional events if any are desired.
      The string has no spaces and is :
      reloadnode;datetime; nodename=sname; cell=cellid; tocomputer=computername; tologin=operatorid; fromcomputer=computername; fromlogin=operatorid; netcomputer=computername; netport=portnumber:
      Where datetime is a standard datetime string.

(See the VLDB chapter for extensive discussion of the use and control of the axsys object which is an extended and distributed database manager.)

See also: ShowAxsysNode, AlterAxsys, ShowAxsys, AlterAxsysRunningNode, VLDB chapter.

Return expected:   Reload string.
Return on error :   Error message.

Example:
sReturn = oMgr . ReloadNode

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
RestoreBackup



Syntax:
oManagerObject . RestoreBackup backupLocation [ , object ]

Performs a restoration of a table, database, or domain from the specified location. All of the data in the object will be replaced by the archived data. All changes and object creations since the backup will be lost.

A dropped table will not be recognized as a valid table and cannot be restored. Re-create the table, ignoring indexing, and it can then be restored from the archive.

BackupLocation :
      This is the complete path to the backup including the final database or domain directory name. The required location may not be the location to which you made the backup. For example, a generational backup inserts a time-stamped directory into the path.

Domain :
      Caution! Before attempting to restore a domain, insure that no database was created or dropped since the last backup. If a database was created after the last backup, a domain restore will render it inaccessible. If a database was dropped after the last backup, a domain restore will render the domain inconsistent.

Object :
      Object is optional.
      It may be blank, "database", "domain", or a table name.
      Blank or "database" will restore the entire database.
      The keyword "domain" will restore a domain backup.
      A table name will restore only that table from the backup.

Lock Requirement :
      If the object is a domain, then the domain must be locked exclusively. Other objects require an exclusive database lock. (See LockObject command.) Before setting the lock, insure that the lock timeout will allow enough time for you to start the operation. The database lock is required even for a single table since the system cannot know the use or importance of that table to local operations.
      The lock will be removed by the disconnect. See below.

Disconnect :
      After restoration, the system will close the database connection to insure re-initialization of all objects and values. If the object is a domain, then it, too, will be initialized.

Archive Validity :
      AxleBase cannot recognize the validity state of an archive. He performs superficial checks before beginning, but it is possible to wipe out a table or database by restoring from a corrupted backup.

Restart :
      Do not interrupt a restore.
      Interruption of a restore will result in a corrupted object.
      If a connection can be made after an interruption, there is a possibility that a restore restart may succeed.
      If the interrupted restore cannot be consumated, then the object was corrupted by the interruption and the restore must be done by manually copying the files.

See also: Backup;

Return expected:   Nothing.
Return on error :   Error message.

Example restoring a database:
sReturn = oMgr . RestoreBackup "c:\backup_demo_seg\demo_seg\"

Example uses sReturn to catch error returns.

Example restoring a domain:
sReturn = oMgr . RestoreBackup "c:\backup\demodom\ , domain "

Example uses sReturn to catch error returns.

Example restoring a single table named t_log:
sReturn = oMgr . RestoreBackup "c:\backup\demo_seg\ , t_log "

Example uses sReturn to catch error returns.

VLDB Addendum To Backup

The following comments and instructions do not apply to normal databases.

Although the Backup command provides the ability to address requirements of a distributed database, the RestoreBackup does not. That increases the solidity for distributed operations by insuring the backup of the primary files. Distributed table segments must be copied manually.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
Revoke



Syntax:
oManagerObject . REVOKE accessType
ON objectType objectName
FROM userName

The Revoke command revokes the ability to access or perform operations on specified objects.

AccessType :
      Any combination of the keywords ALL, SELECT, DELETE, INSERT, UPDATE, or EXECUTE. If the keyword ALL or an asterisk is used, then it revokes all of the access priviledges.

ObjectType :
      Any combination of the keywords DOMAIN, DATABASE, TABLE, or JOB. The keyword all and the asterisk will be applied only to objects in the database and not to domains and not to databases.

The keyword ALL or an asterisk may be used in the FROM clause. When used there, the revoke is applied to all entities.

The object name:
      Required. The keyword ALL may be used for the object name. If the keyword ALL is used, then the command is applied to all objects of the specified type.

This is a security component. As discussed in the Security section of the Embedding And Running AxleBase chapter, this feature is effective only when the host is a server such as a web server or an odbc server which limits activity to remote connections.

Of significance is the fact that AxleBase requires no access security until security is turned on.

AxleBase deviates from the standard to allow the command to cover domains and databases as well as tables.

See also: Grant, ShowPermissions.

See also Turning On Security in the Embedding And Running AxleBase chapter.

Return expected:   Nothing.
Return on error :   Error message.

Example:
sReturn = oMgr . Revoke ( " insert on domain demodom from allen " )

Example uses sReturn to catch error returns.

Example that revokes all of Mary's access within a database:
sReturn = oMgr . Revoke ( " all on all all from Mary " )

Example uses sReturn to catch error returns.

Example locking Mary out of every database:
sReturn = oMgr . Revoke ( " all on database all from Mary " )

Example uses sReturn to catch error returns.

Example clearing all rights within a database:
sReturn = oMgr . Revoke ( " all on all all from all " )

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShareDatabase



Syntax:
oManagerObject . ShareDatabase DatabasePath , DomainPath [, IndexPath [, LogPath [, SegmentPointerPath [, TempDbPath ]]]]

For those who are unable to build a database server host, this command allows a database to be shared across a network after it is created. The domain must also be shared before database shares become effective.

The database must be open when the command is issued to help you insure that you are updating the correct database. Therefore, its name is not required.

Valid and complete paths are required for all of the parameters. Connections will fail if any path cannot be used from a remote workstation. Therefore, all of the parameters must be shared paths. For example, the database may exist on the local drive in the path, c:\db\data\, and the share parameter may be a share name such as \\server\db\data\ .

This command will not relocate objects. It updates parameters that allow remote access.

DomainPath is the location of the domain which controls the database.

This command may be re-issued at any time to update shared locations.

Optional parameters :
      All or any of the optional parameters may be omitted with their separators. If an optional parameter is used, then any preceeding optional parameters must be entered. If the preceeding optional parameters are not needed, then just enter their comma separators as place holders.

Defaults :
      If the optional parameters are not entered, then the standard database locations will be used.

Security :
      If security has been activated, then this command will require update clearance at the domain and the database levels. Subsequent remote access will also be subject to security screening. (See the discussion of security. If the host has no database server, then security is ineffective.)

CAUTION :
      Check parameters before entering. The parameters are checked by the system, but it is possible to submit a valid path which is not valid for the intended object. If, for example, the entered index path is for a different database, the system cannot know that. Such an error can produce extremely interesting and unwelcome events, and can be fixed only by a manual edit of the system files in a text editor.

See also: ShareDomain

Return expected:   None.
Return on error :   Error message.

Example:
sReturn = oMgr . ShareDatabase ( "\\server1\db\ , \\server1\domain\ , \\server1\indexsite\ , \\server1\logpath\")

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShareDomain



Syntax:
oManagerObject . ShareDomain DomainPath [ , LogPath [ , TempDbPath ]]

For those who are unable to build a database server into their host, this command allows a domain to be shared across a network after it is created. To share each of the databases in the domain, the ShareDatabase command will be used.

The domain must be opened before issuing the command.

Valid paths are required for all of the parameters. Connections will fail if any path cannot be used from a remote workstation. Therefore, all of the parameters must be shared paths. For example, the domain may exist on the local drive in the path, c:\db\domain\, and the share parameter may be a share name such as \\server\db\domain\ .

This command may be re-issued at any time to update shared locations.

Optional parameters :
      All or any of the optional parameters may be omitted with their separators. If an optional parameter is used, then any preceeding optional parameters must be entered. If the preceeding optional parameters are not needed, then just enter their comma separators as place holders.

Defaults :
      If the optional parameters are not entered, then the standard domain locations will be used.

Security :
      If security has been activated, then this command will require update clearance at the domain level. Subsequent remote access will also be subject to security screening. (See the discussion of security. If the host has no database server, then security is ineffective.)

CAUTION :
      Check parameters before entering. The parameters are checked by the system, but it is possible to submit a valid path which is not valid for the intended object. If, for example, the entered index path is for a different database, the system cannot know that. Such an error can produce extremely interesting and unwelcome events, and can be fixed only by a manual edit of the system files in a text editor.

See also: ShareDatabase

Return expected:   None.
Return on error :   Error message.

Example:
sReturn = oMgr . ShareDomain ( "\\server1\domain\ , \\server1\logsite\, \\server1\tempdb\")

Example uses sReturn to catch error returns.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShowAxsys



( The axsys object is operational, but it is still under construction and is subject to dramatic changes.)

Syntax:
oManagerObject . ShowAxsys [ option ]

Returns the entire axsys configuration for the currently open database. The report is formatted for readability.

The axsys configuration can be considered part of the database attributes, but its size can become very large, so it has its own report.

Option :
      Option is an optional parameter. If its value is "pinglist", then only a ping list will be returned for use by the host. Its usage is discussed in the VLDB Operations chapter, Axsys section, Axsys State Assessment sub-section.

See also: AlterAxsys, AlterAxsysRunningNode, ReloadNode, ShowDatabaseAttributes and the VLDB chapter.

Return expected:   Axsys configuration.
Return on error :   Error message.

Example:
sReturn = oMgr . ShowAxsys

sReturn will contain the report or error return.

Example: sReturn contained the following report.
Axsys Configuration Report
Report ID: 2TXASB2KSGJMJNiS00DOOPZpVT1
DateTime: 2008111411153682
database: demo
database ID: wYYNe2JKSGJJUJ3d00EHQxkyJhg
      [[ node=computer3me ]]
Node: id=uLbdKeTnSGIIMRXz01DGFSShxLc, computer=computer3me, login=, name=name3, status=a, type=q, class=a, axsys=, cell=, fromcomputer=, fromlogin=, tocomputer=, tologin=, interval=, dataprotocol=, location=, port=, sendpause=, buffer=, burst=, frequency=, hop=, description=,
Segment: computer=computer3me, login=, table=t_log, start=4, count=1
Temp: computer=computer3me, login=, location=c:\_temp\
      [[ node=computer9 ]]
Node: id=ulbdketnsgiimrxz01dgfsshxlc, computer=computer9, login=, name=testname, status=i, type=q, class=a, axsys=, cell=0, fromcomputer=, fromlogin=, tocomputer=, tologin=, interval=0, dataprotocol=standard, location=, port=0, sendpause=0, buffer=0, burst=0, frequency=0, hop=0, description=this is a test for nine,
Map: computer=computer9, login=, table=t_log, alias=t_confuse
Row: computer=computer9, login=, table=t_activity, start=4, count=1
Row: computer=computer9, login=, table=t_log, start=1, count=4
Segment: computer=computer9, login=, table=t_log, start=1, count=1
Segment: computer=computer9, login=, table=t_activity, 4, count=1
Temp: computer=computer9, login=, location=c:\_temp\
      [[ node=computer4 ]]
Node: id=lirpcplzsgiikqk200ex3joykcz, computer=computer4, login=, name=, status=a, type=q, class=a, axsys=, cell=, fromcomputer=, fromlogin=, tocomputer=, tologin=, interval=, dataprotocol=standard, location=, port=, sendpause=, buffer=, burst=, frequency=, hop=, description=,
Map: computer=computer4, login=, table=t_log, alias=t_confuse
Row: computer=computer4, login=, table=t_log, start=2, count=5
Row: computer=computer4, login=, table=t_activity, start=40, count=2000000
Segment: computer=computer4, login=, table=t_log, start=1, count=4
Segment: computer=computer4, login=, table=t_activity, start=1, count=200
Temp: computer=computer4, login=, location=c:\_temp\
End of Axsys Configuration Report 2TXASB2KSGJMJNiS00DOOPZpVT1

Example will return a ping list:
sReturn = oMgr . ShowAxsys( "pinglist" )

sReturn will contain the report or error return.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShowAxsysNode



Syntax:
oManagerObject . ShowAxsysNode

Return the current node configuration if one was loaded.

(See the VLDB chapter for extensive discussion of the use and control of the axsys object which is an extended and distributed database manager.)

See also: ReloadNode, ShowAxsys, AlterAxsys AlterAxsysRunningNode,.

Return expected:   Current configuration.
Return on error :   Error message.

Example:
sReturn = oMgr . ShowAxsysNode

sReturn will contain the configuration or an error.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShowCopyright



Syntax:
oManagerObject . ShowCopyright

Returns the legal copyright.

Any attempt to mask, bypass, alter, alias, camouflage, or qualify either this command or its return legally revokes the right of the individual and/or organization to use AxleBase and its supporting software and may precipitate legal consequences.

Return expected:   Copyright notice.
Return on error :   Error message.

Example:
sReturn = oMgr . ShowCopyright

sReturn will contain the copyright.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShowDatabase



Syntax:
oManagerObject . ShowDatabase

This report shows the structure of the currently open database by returning its SQL construct. The SQL construct is the series of SQL statements that would be used to create the database.

Each element of the report is prefixed by an end-of-line. That includes the first one to bypass the zerothe element when arrayed. The structure elements begin with the "create" keyword.

Header, footer, and comments are encapsulated by SQL comment characters.

See also: ShowDatabaseCatalogue, ShowDatabaseAttributes, ShowTable, ShowTables.

Return expected:   A string of multiple SQL statements.
Return on error :   Error message.

Example:
sReturn = oMgr . ShowDatabase





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShowDatabaseAttributes



Syntax:
oManagerObject . ShowDatabaseAttributes

Returns the characteristics of the currently open database.

Return Structure :
      The report has a header and a footer.
      The body is a sequence of attribute groups.
      Each group is prefixed by an end of line.
      (First prefix skips the zeroth group when arrayed.)
      Attribute elements are :
            attribute name
            space
            equal sign
            space
            value
      Values may be empty.
      Values may reference the higher domain authority.
      A line break value is represented by the string 'eol'.

Since the return consists of the characteristics of the currently open database, if no database is open, the return is simply blank; it is not an error.

Toggle values in the return may be true, false, yes, no, t, f, y, or n, depending on the development stage of the system.

Storage Architecture Model :
      The SAM version number may or may not be the same as the version number that is returned by the ShowVersion command. The ShowDatabaseAttributes command returns the SAM version number currently being used, which is not the version of any software, whereas the ShowVersion command returns the version number of the currently running AxleBase.

Release Number :
      The release number may or may not be the same as the release number that is returned by the ShowRelease command. The ShowDatabaseAttributes command returns the release number of the system that created the row, whereas the ShowRelease command returns the release number of the currently running AxleBase.

The return includes the connectionId, which is the same as the ID number of the Manager object which created the connection.

location The path to the database.
lock The type of lock if any.
lockproc The name of the process holding the lock, if any.
nullToken The null token.
maxconnections Maximum allowed concurrent connections.
currconnectionsCurrent number of open connections.
tableLocks Toggle permits table locks.
rowLocks Toggle permits row locks.
SAMversion The storage architecture model version currently in use.
dbmsRelease Release number of AxleBase that created the database.

See also: ShowDatabaseCatalogue, ShowDomainAttributes, ShowInstanceAttributes, ShowTableAttributes, ShowAxsys.

Return expected:   Current database characteristics.
Return on error :   Error message.

Example with return from the AxHandle demo database:
sReturn = oMgr . ShowDatabaseAttributes

The host converted the separators to commas in this example:
name = demo, domain = c:\AxHandle\db\demodom\, location = c:\AxHandle\db\demo\, instanceComputer = server4, instanceDBA = me, instanceId = SFFaOxXy5dCK9lgU, dbConnectionId = SFFaOxXAKApsBUKc, domainConnId = SFFaOxXy5x3jV3ZJ, SAMversion = 61201, SAMrelease = 70701, security = off, sysOs = Windows 98, sysOsBuild = 67766222, sysCpuType = Intel Pentium, sysCpuQty = 1, sysRamTotal = 133,713,920, sysRamAvail = 133,713,920, sysVirtMemTotal = 133,713,920, sysVirtMemAvail = 2,072,641,536, columnSeparator = , columnType = , connectionsCurr = 0, connectionsMax = 0, dbtmpLocation = c:\AxHandle\db\demo\dbtmp\, deferReturns = no, description = This is a demonstration and test database., encrypt = , encryptDataReturn = , failOpen = yes, indexLocation = c:\AxHandle\db\demo\dbndx\, localDbtmp = , lock = , lockTime = , lockTimeoutDatabase = 30, lockTimeoutTable = 10, logToggle = no, logAutoTruncate = yes, logMaxSize = 10000, logLocation = c:\AxHandle\db\demo\dbsys\, nullToken = , maintainStats = no, password = , permitRowLocks = no, permitTableLocks = no, pointerLoadLimit = 0, rowTerminator = , returnProtocol = standard, returnQuantityChanged = , segmentPointerLocation = c:\AxHandle\db\demo\dbseg\, timeoutTemp = 86400, typeOfDatabase = primary,





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShowDatabaseCatalogue



( Replaces the ShowDatabases command. )

Syntax:
oManagerObject . ShowDatabaseCatalogue [( attributeName , [ databaseName])]

Returns a list of the specified attributes for databases in the current domain. A line break precedes each item in the list. That includes the first one to skip the zerothe element.

There are times when a database name may be part of the name of another; e.g. parts and parts_auto. In that case, added programming would be required to find both. Therefore, an end of line is added to the last row so the host system can search for database name and eol.

AttributeName :
      Attribute name is optional.
      If no attribute name is specified, all are returned.
      Following are the available attribute names :
            ID
            name
            type
            location
            description

Database Name :
      Database name may be blank which will return the attribute for all databases.

If no domain is open, a trappable error message is returned.

If there are no databases in the catalogue, an empty string is returned.

See also: ShowDatabaseAttributes.

Return expected:   Database list.
Return on error :   Error message.

Example:
sReturn = oMgr . ShowDatabaseCatalogue ( , )

sReturn will contain either a database list or an error message.

Example:
sReturn = oMgr . ShowDatabaseCatalogue ( name, )

sReturn will contain either a database list or an error message.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShowDbColumns



Syntax:
sReturn = oManagerObject . ShowDbColumns [ tableName ]

Returns descriptions of all columns in the database.

TableName :
      The optional tableName parameter will limit the return to those columns that are in that table.

Return Structure :
      This report has header and footer lines.
      A header line describes the elements listed below.
      The body consists of column descriptions.
      Each description is prefixed by an end of line.
      (First prefix skips the zeroth element when arrayed.)
      Each description consists of elements.
      Elements are separated by a comma and a space.
      The elements are :
            tableName
            columnName
            columnDataType
            ordinality
            start
            width
            default
            lock
            lockProc
            nullable

Before the command is issued, the domain must be active and the database must be open; i.e., a connection must be made.

See also: ShowTable, ShowTableColumns.

Return expected:   Character string.
Return on error :   Error message.

Example:
sReturn = oMgr . ShowDbColumns

sReturn will contain either the columns or an error message.





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShowDomainAttributes



Syntax:
oManagerObject . ShowDomainAttributes

Returns a string containing the identification and attributes of the currently open database domain.

Return Structure :
      This report has header and footer lines.
      The body is a sequence of attribute groups.
      Each group is prefixed by an end of line.
      (First prefix skips the zeroth group when arrayed.)
      Attribute elements are :
            attribute name
            space
            equal sign
            space
            value
      A line break value is represented by the string 'eol'.

If a domain has not been opened by the current database manager object, a trappable error message is returned. This provides a way of insuring that an open command succeeded.

See also: ShowDatabaseAttributes, ShowInstanceAttributes, ShowTableAttributes.

Return expected:   Character string.
Return on error :   Error message.

Example from AxHandle's demo. In this case, the host converted each line break to a comma and a space:
sReturn = oMgr . ShowDomainAttributes

sReturn contains the following:
domainName = demodom, domainDatabaseLocation = c:\db\demodom\, dbmsRelease = 70701, instanceComputer = server4, instanceDBA = me, instanceId = SFFaOxXy5dCK9lgU, domainConnectionId = SFFaOxXy5x3jV3ZJ, currentDbName = demo, currentDbConnId = SFFaOxXAKApsBUKc, SAMversion = 61201, SAMrelease = 50422, security = off, sysOs = Windows 98, sysOsBuild = 67766222, sysCpuType = Intel Pentium, sysCpuQty = 1, sysRamTotal = 133,713,920, sysRamAvail = 33,713,920, sysVirtMemTotal = 133,713,920, sysVirtMemAvail = 2,072,641,536, apostropheEscape = , bufferSize = 35000000, columnSeparator = -*ssep*-, columnType = f, connectTimeout = 15, dbtmpLocation = c:\db\demoDom\dbtmp\, defaultDatabase = , encrypt = , lock = , logAutoTruncate = yes, logLocation = c:\db\demoDom\dbsys\, logSizeMax = 10000, logToggle = no, nullToken = , password = , pointerLoadLimit = 100, queryTimeout = 15, rowTerminator = eol, returnProtocol = standard, returnQuantityChanged = no, segmentSize = 2000000000, spinLock = 15, variableDelimiter = ', wildCardCharacterMult = *, wildCardCharacterSingle = ?, yieldProcessor = yes,





API Lexicon And Syntactical Reference
The Manager Object Interface
Sub-Section
ShowErrorList



Syntax:
oManagerObject . ShowErrorList [ errorNumber ]

Returns the entire list of standard errors. If an error number is entered, only that error is returned.

Return Structure :
      The elements of the list are the errors.
      Each element is prefixed by an end of line.
      (First prefix skips the zeroth element