HyperSQL Utilities Guide

HyperSQL Utilities Guide

Edited by , Blaine Simpson, and Fred Toussi

HyperSQL Utilities Guide

by , Blaine Simpson, and Fred Toussi $Revision: 6753 $

Publication date 2024-06-01

Copyright 2002-2024 Blaine Simpson, Fred Toussi and The HSQL Development Group. Permission is granted to distribute this document without any alteration under the terms of the HSQLDB license. You are not allowed to distribute or display this document on the web in an altered form.

Table of Contents

Preface ......................................................................................................................................... vii Available formats for this document .......................................................................................... vii

1. SqlTool ....................................................................................................................................... 1 Try It ..................................................................................................................................... 1 Purpose, Coverage, Recent Changes in Behavior ............................................................................ 1 Platforms and SqlTool versions covered ............................................................................... 2 Recent Functional Changes ................................................................................................ 3 New Features .................................................................................................................. 3 The Bare Minimum .................................................................................................................. 3 Quotes and Spaces ................................................................................................................... 6 Embedding .............................................................................................................................. 6 Non-displayable Types .............................................................................................................. 6 Compound commands or commands with semi-colons .................................................................... 7 Desktop shortcuts ..................................................................................................................... 7 Loading sample data ................................................................................................................. 8 Satisfying SqlTool's CLASSPATH Requirements ........................................................................... 8 Accessing older HSQLDB Databases with SqlTool ................................................................ 8 App-specific Classes, Embedding, and non-HyperSQL Databases .............................................. 9 Distributing SqlTool with your Apps ................................................................................... 9 SqlTool Client PCs ........................................................................................................... 9 RC File Authentication Setup ..................................................................................................... 9 Switching Data Sources ........................................................................................................... 15 Using Inline RC Authentication ................................................................................................ 15 Logging ................................................................................................................................ 15 Interactive Usage .................................................................................................................... 16 SqlTool Command-Line Editing ........................................................................................ 16 Command Types ............................................................................................................ 17 Emulating Non-Interactive mode ....................................................................................... 17 Command Types .................................................................................................................... 17 Special Commands ................................................................................................................. 18 Edit Buffer / History Commands ............................................................................................... 21 Command History .......................................................................................................... 24 PL Commands ....................................................................................................................... 24 Non-Interactive ...................................................................................................................... 25 Giving SQL on the Command Line ................................................................................... 26 SQL Files ..................................................................................................................... 27 Piping and shell scripting ................................................................................................. 30 Automation ................................................................................................................... 30 Optimally Compatible SQL Files ....................................................................................... 31 Comments ..................................................................................................................... 31 Special Commands and Edit Buffer Commands in SQL Files .................................................. 31 Getting Interactive Functionality with SQL Files .................................................................. 33 Character Encoding ......................................................................................................... 33 Generating Text or HTML Reports ............................................................................................ 34 Storing and Retrieving Binary Files ........................................................................................... 37 SqlTool Procedural Language ................................................................................................... 37 Nulls and Empty Strings .................................................................................................. 38 Variables ....................................................................................................................... 39 Macros ......................................................................................................................... 43 SqlTool Functions .......................................................................................................... 44 PL Sample .................................................................................................................... 45

iii

HyperSQL Utilities Guide

Logical Expressions ........................................................................................................ 45 Mathematical Assignments ............................................................................................... 47 Flow Control ................................................................................................................. 48 PL Example .................................................................................................................. 48 Chunking .............................................................................................................................. 50 Why? ........................................................................................................................... 50 How? ........................................................................................................................... 50 Raw Mode ............................................................................................................................ 51 SQL/PSM, SQL/JRT, and PL/SQL ............................................................................................ 51 Delimiter-Separated-Value Imports and Exports ........................................................................... 53 Simple DSV exports and imports using default settings ......................................................... 55 Specifying queries and options .......................................................................................... 56 CSV Imports and Exports ........................................................................................................ 58 Unit Testing SqlTool ............................................................................................................... 60 2. Hsqldb Test Utility ..................................................................................................................... 61 3. Database Manager ....................................................................................................................... 63 Brief Introduction ................................................................................................................... 63 Auto tree-update ..................................................................................................................... 63 Automatic Connection ............................................................................................................. 64 RC File ................................................................................................................................ 64 Using the current DatabaseManagers with an older HSQLDB distribution. ......................................... 64 DatabaseManagerSwing as an Applet ......................................................................................... 65 4. Transfer Tool ............................................................................................................................. 67 Brief Introduction ................................................................................................................... 67 A. SqlTool System PL Variables ....................................................................................................... 68 B. HyperSQL File Links .................................................................................................................. 71

iv

List of Tables

1. Available formats of this document ................................................................................................ vii

v

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download