HPlogo ALLBASE/SQL C Application Programming Guide: HP 3000 MPE/iX Computer Systems

Chapter 10 Programming with LONG Columns

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Table of Contents

General Concepts
Restrictions
Defining LONG Columns with a CREATE TABLE or ALTER TABLE Command
Defining Input and Output with the LONG Column I/O String
Putting Data into a LONG Column with a [BULK] INSERT Command
Insert Using Host Variables for LONG Column I/O Strings
Bulk Insert Using Host Variables for LONG Column I/O Strings
Retrieving LONG Column Data with a [BULK] SELECT, FETCH, or REFETCH Command
Using the LONG Column Descriptor
Using LONG Columns with a BULK SELECT Command
Using LONG Columns with a Dynamic FETCH Command
Changing a LONG Column with an UPDATE [WHERE CURRENT] Command
Removing LONG Column Data with a DELETE [WHERE CURRENT] Command
Coding Considerations
File versus Random Heap Space
File Naming Conventions
Considering Multiple Users
Deciding How Much Space to Allocate and Where

LONG columns in ALLBASE/SQL enable you to store a very large amount of binary data in your database, referencing that data via a table column name. You might use LONG columns to store text files, software application code, voice data, graphics data, facsimile data, or test vectors. You can easily SELECT or FETCH this data, and you have the advantages of ALLBASE/SQL's recoverability, concurrency control, locking strategies, and indexes on related columns.

You can use LONG columns in an application program to be preprocessed or with ISQL. This discussion focuses on application programming concerns. As you will see, great flexibility is provided so that you can custom design your application.

The chapter highlights methods of implementing LONG columns in your database as follows:

  • General Concepts.

  • Restrictions.

  • Defining LONG Columns with CREATE TABLE or ALTER TABLE.

  • Defining Input and Output with the LONG Column I/O String.

  • Putting Data into a LONG Column with [BULK] INSERT.

  • Changing a LONG Column with UPDATE [WHERE CURRENT].

  • Retrieving LONG Column Data with [BULK] SELECT, FETCH, or REFETCH.

  • Using the LONG Column Descriptor.

  • Removing LONG Column Data with DELETE or DELETE WHERE CURRENT.

  • Coding Considerations.

For every DDL and DML command that can be used with LONG columns, examples are included with discussion of related considerations. These examples pertain to the same logical table (PartsTable) and set of columns. In contrast to other examples in this document, PartsTable is a hypothetical table created and altered in this chapter. Refer to the ALLBASE/SQL Reference Manual which contains complete syntax specifications for using long columns.

Table 10-1 Commands You Can Use with LONG Columns

 DDL Operations DML Operations
 ALTER TABLE [BULK] INSERT
 CREATE TABLE UPDATE [WHERE CURRENT]
   [BULK] SELECT
   FETCH
   REFETCH
   DELETE [WHERE CURRENT]

 

Feedback to webmaster