DISC

Contents | What's New | Quick Links

 

SET Options

Introduction

Software Installation

Concepts and Design

Designing Applications

Omnidex Environments

SQL Reference

Omnidex API's

Utilities

Interfaces

Performance Guide

Troubleshooting Guide

Appendix

 

 

CHAR

 

CHAR [AUTO | n]

Converts binary data to character format, where n is the length of the converted character data. The default is AUTO.

CHAR can also be set in:

SET

ODXSQL SET

If the CHAR option is passed to oaexecsql in the options parameter, it is passed to the underlying OmniAccess function. For example:

oaexecsql (cursor, "CHAR=AUTO", status, "SELECT * FROM ORDERS WHERE STATUS='BACK'")

In this example, the CHAR=AUTO option is passed to oaselect where the select statement will actually be processed.

CHAR=AUTO - returns all data back in CHARACTER datatype, however it sets the size on a per-column basis to the smallest size that can safely return all possible values.

CHAR=n - returns all data back in CHARACTER datatype and sets the buffer size to length n.

The CHAR option automatically converts between alphanumeric and numeric data, thus eliminating any concern for byte-ordering and integer conversion across hardware platforms.

For example, when a client application on a PC requests numeric data using the CHAR, OmniAccess automatically converts the data from its numeric format to character data.

Conversely, when a client application sends information to a server, the character representation of the number is converted to a numeric type and byte order appropriate for the server operating system.

When using the CHAR option, the buffer must reflect the length of the ASCII character representation, not its binary storage format, and should be padded with blanks up to length n.

The CHAR option supports ASCII representations of numeric values that contain a leading + or -. It also supports exponential values, like 6.02e23, for numeric columns defined as TYPE FLOAT.

Character representations of floating point data may lose precision.

top

 

Examples

CHAR can be passed in a SQL SET statement, in the options parameter of an OAAPI function, or in a WITH options clause in a SQL statment.

ODXSQL

>connect orders.env
>SET CHAR 32

or

>SELECT * FROM ORDERS WHERE STATUS='BACK' WITH CHAR=32

oaexecsql

oaexecsql (cursor, ";", status, "SET CHAR AUTO")

or

oaexecsql (cursor, "CHAR AUTO", status, "SELECT * FROM ORDERS WHERE STATUS='BACK'")

or

oaexecsql (cursor, ";", status, "SELECT * FROM ORDERS WHERE STATUS='BACK' WITH CHAR=AUTO")

JDBC

Statement stmt = connection.createStatement();
String sql = "SET CHAR AUTO";
stmt.execute(sql);

or

Statement stmt = connection.createStatement();
String sql = "SELECT * FROM ORDERS WHERE STATUS='BACK' WITH CHAR=AUTO";
ResultSet rs = stmt.executeQuery(sql);

top

Dynamic Information Systems Corporation - Omnidex Version 3.8 Build 6 J15.03-Copyright © 2003

DISC | Documentation Home