SOLID Server

SOLID API Function Reference

Welcome


This Guide

This SA Function Reference contains information about using SA Interface. The SA Interface is a direct database engine API for applications that require extremely high throughput. The performance benefit is gained by avoiding the SQL Parsing and Optimization phase and by allowing the application to group several table-level operations into one network message.

Currently, this manual contains only the function reference part, describing the operation and parameters of each SA function.

Audience

This manual assumes:

• A working knowledge of the C programming language.

• General DBMS knowledge.

Document Conventions

Function call parameters are categorized as one of three types:

Format

Used for

in

input parameter for function

out

return parameter from function

use

parameter object that is manipulated by the function

In addition, there may be the following qualifiers for the input parameter:

Qualifier

Used for

hold

the pointer is a pointer, the value of which will be stored by SA Interface and used later. Therefore, the object referred to by the pointer may not be prematurely freed.

Take

the parameter is a pointer to an object that ceases to exist as the result of the function call and cannot be used thereafter.


Other Solid Documentation

SOLID Server documentation is distributed both as printed material and as Windows Help or HTML files. Solid Online Services on our Web server offer the latest product and technical information free of charge. The service is located at:
http://www.solidtech.com/

Printed Manuals

• SOLID Server Administrator's Guide describes the administrative procedures and gives information about SOLID SQL functionality.

• SOLID Server Programmer’s Guide and Reference contains basic information about using the SOLID SQL API directly, e.g., from C language, and how to exploit the advanced features of SOLID Server. It also provides the SOLID SQL API function reference.

Electronic Documentation

• Read Me contains installation instructions and additional information about the specific product version. This readme.txt file is typically on the first SOLID Server diskette.

• Release Notes contains additional information about the specific product version. This relnotes.txt file is typically on the SOLID Server diskettes and will be copied onto your system when you install the software.

• SOLID Remote ControlTM Help tells you how to use the SOLID Remote Control administration program to perform the easy steps to manage your SOLID Servers.

• SOLID SQL EditorTM Help tells you how to use the SOLID SQL Editor, a tool for executing SQL queries and commands.

• SOLID Server Administrator's Guide is available electronically in either Windows Help or HTML format.

• SOLID Server Programmer’s Guide and Reference is available electronically in either Windows Help and HTML format.

Where to Find Additional Information

There is an example program, called saexampl.c, in the SA Interface package. It shows typical function call patterns.

Function Reference


SaArrayFlush

Syntax

SaRetT SA_EXPORT_C SaArrayFlush(SaConnectT* scon, SaRetT* rctab)

Description

Flushes array operation buffer. This function does the actual array operations by sending them to the server.

Parameters

scon    use

Connection pointer.

rctab    use

Array of return codes for each array operation. If this parameter is non-NULL, return code of each array operation is returned in rctab[i], where i is the order number of array operation since last SaArrayFlush.

Return value

SA_RC_SUCC or error code of first failed array operation.

Comments

See also


SaArrayInsert

Syntax

SaRetT SA_EXPORT_C SaArrayInsert(SaCursorT* scur)

Description

Function to insert an array of values on one network message. This function places the inserted value to the array insert buffer. The buffer can flushed using function SaArrayFlush.

Parameters

scur    use

Cursor pointer.

Return value

SA_RC_SUCC or error code

Comments

See also


SaColSearchCreate

Syntax

SaColSearchT* SA_EXPORT_C SaColSearchCreate(SaConnectT* scon, char* tablename)

Description

Starts a column info search for a specified table.

Parameters

scon    in

Pointer to connection object.

tablename    in

Table name.

Return value

Pointer to the column search object, or NULL if table does not exist.

Comments

See also


SaColSearchFree

Syntax

void SA_EXPORT_C SaColSearchFree(SaColSearchT* colsearch)

Description

Releases a column search object.

Parameters

colsearch    in, take

Column search pointer.

Return value

Comments

See also


SaColSearchNext

Syntax

int SA_EXPORT_C SaColSearchNext(SaColSearchT* colsearch, char** p_colname,SaDataTypeT* p_coltype)

Description

Returns information of the next column in the table.

Parameters

colsearch    in, take

Column search pointer.

p_colname    out, ref

Pointer to the local copy of the column name is stored into *p_colname.

p_coltype    out

Type of column is stored into *p_coltype.

Return value

TRUE Next column found, parameters updated.

FALSE No more columns, parameters not updated.

Comments

See also


SaConnect

Syntax

SaConnectT* SA_EXPORT_C SaConnect(char* servername, char* username, char* password)

Description

Creates connection to the SOLID Server. Empty servername connects to the default server. Several connections can be active at the same time, but operations in different connections are executed in separate transactions.

Parameters

servername    in

Server name.

username    in

User name.

password    in

Password.

Return value

Connect pointer or NULL, if connection failed.

Comments


SaCursorAscending

Syntax

SaRetT SA_EXPORT_C SaCursorAscending(SaCursorT* scur, char* colname)

Description

Specifies ascending ordering criterium for a column. If a proper key does not exist, the rows are sorted locally. If several criteria are given, they are solved in the given order.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

Return value

SA_RC_SUCC or error code

Comments

See also


SaCursorAtleast

Syntax

SaRetT SA_EXPORT_C SaCursorAtleast(SaCursorT* scur, char* colname)

Description

Species atleast criterium for a column. Atleast criterium means that the column value must be greater that or equal to the atleast value.

The atleast value is taken from the user variable bind to the column.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

Return value

SA_RC_SUCC or error code

Comments

See also


SaCursorAtmost

Syntax

SaRetT SA_EXPORT_C SaCursorAtmost(SaCursorT* scur, char* colname)

Description

Species atmost criterium for a column. Atmost criterium means that the column value must be less that or equal to the atleast value.

The atleast value is taken from the user variable bind to the column.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

Return value

SA_RC_SUCC or error code

Comments

See also


SaCursorBegin

Syntax

SaRetT SA_EXPORT_C SaCursorBegin(SaCursorT* scur)

Description

Positions the cursor to the beginning of the set. Following next call returns the first row.

Parameters

scur    use

Cursor pointer

Return value

SA_RC_SUCC or error code

Comments

See also


SaCursorColData

Syntax

SaRetT SA_EXPORT_C SaCursorColData(SaCursorT* scur, char* colname,char** dataptr, unsigned* lenptr)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

In search operations the value stored to the user variable is a pointer to a local copy of the column data. The data pointer is valid until the next SaCursorOpen or SaCursorFree call, after which the pointer should not be referenced.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

dataptr    in, hold

Pointer to the user variable.

lenptr    in, hold

Pointer to variable used to hold length of data.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorColDate

Syntax

SaRetT SA_EXPORT_C SaCursorColDate(SaCursorT* scur, char* colname, SaDateT* dateptr)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

dateptr    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorColDateFormat

Syntax

SaRetT SA_EXPORT_C SaCursorColDateFormat(SaCursorT* scur, char* colname, char* dtformat)

Description

Binds date format string to a database column. Depending on the column data type, the format string should be data, time or timestamp format.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

dtformat    in

Date/time/timestamp format string.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorColDfloat

Syntax

SaRetT SA_EXPORT_C SaCursorColDfloat(SaCursorT* scur, char* colname, SaDfloatT* dfloatptr)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

dfloatptr    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorColDouble

Syntax

SaRetT SA_EXPORT_C SaCursorColDouble(SaCursorT* scur, char* colname, double* doubleptr)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

doubleptr    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorColDynData

Syntax

SaRetT SA_EXPORT_C SaCursorColDynData(SaCursorT* scur, char* colname, SaDynDataT* dd)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

In search operations the column data is stored to the SaDynDataT variable using function SaDynDataMove, which overwrites the old data. The user is responsible for releasing the SaDynDataT variable after the search ends using function SaDynDataFree.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

dd    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorColDynStr

Syntax

SaRetT SA_EXPORT_C SaCursorColDynStr(SaCursorT* scur, char* colname, SaDynStrT* ds)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

In search operations the column data is stored to the SaDynStrT variable using function SaDynStrMove, which overwrites the old data. The user is responsible for releasing the SaDynStrT variable after the search ends using function SaDynStrFree.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

ds    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorColFixstr

Syntax

SaRetT SA_EXPORT_C SaCursorColFixstr(SaCursorT* scur, char* colname, char* fixstr, unsigned size)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

A fixstr is a data type which always has a fixed length. If the given data area for fixstr is longer than column data, the end is padded with spaces. If the data area is shorter than column data, the column data is truncated. In insert and update trailing space characters are not stored to the database.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

fixstr   in, hold

Pointer to the user variable.

len    in

Length of data area pointer by fixstr.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorColFloat

Syntax

SaRetT SA_EXPORT_C SaCursorColFloat(SaCursorT* scur, char* colname, float* floatptr)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

floatptr    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorColInt

Syntax

SaRetT SA_EXPORT_C SaCursorColInt(SaCursorT* scur, char* colname, int* intptr)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

intptr    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments


SaCursorColLong

Syntax

SaRetT SA_EXPORT_C SaCursorColLong(SaCursorT* scur, char* colname, long* longptr)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

longptr    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments


SaCursorColNullFlag

Syntax

SaRetT SA_EXPORT_C SaCursorColNullFlag(SaCursorT* scur, char* colname, int* p_isnullflag)

Description

Binds a NULL value flag to a column. If the column value is NULL, *p_isnullflag has a value 1, otherwise the value is 0. The *p_isnullflag value is updated automatically during fetch operations. During insert and update, a NULL value is inserted to the database if *p_isnullflag is not zero.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

p_isnullflag    in, hold

Pointer to an integer variable into where the NULL status is stored during fetch operations, and from where the NULL status is taken during insert and update operations.

Return value

SA_RC_SUCC or error code.

Comments


SaCursorColStr

Syntax

SaRetT SA_EXPORT_C SaCursorColStr(SaCursorT* scur, char* colname, char** strptr)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

In search operations the value stored to the user variable is a pointer to a local copy of the column data. The data pointer is valid until the next SaCursorOpen or SaCursorFree call, after which the pointer should not be referenced.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

strptr    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments


SaCursorColTime

Syntax

SaRetT SA_EXPORT_C SaCursorColTime(SaCursorT* scur, char* colname, SaDateT* timeptr)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

timeptr    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorColTimestamp

Syntax

SaRetT SA_EXPORT_C SaCursorColTimestamp(SaCursorT* scur, char* colname, SaDateT* timestampptr)

Description

Binds user variable to a database column. In search operations the user variable is updated to contain the value of the current row. In insert and update operations the new value for the column is taken from the user variable.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

timestampptr    in, hold

Pointer to the user variable.

Return value

SA_RC_SUCC or error code.

Comments

See also


SaCursorCreate

Syntax

SaCursorT* SA_EXPORT_C SaCursorCreate(SaConnectT* scon, char* tablename)

Description

Creates a cursor to a table specified by relname. Operation fails if table does not exist.

Parameters

scon    use

Connect pointer.

tablename    in

Table name.

Return value

Pointer to the cursor object, or NULL if table does not exists.

Comments


SaCursorDelete

Syntax

SaRetT SA_EXPORT_C SaCursorDelete(SaCursorT* scur)

Description

Deletes the current row in a cursor from the database. The cursor must be positioned to a row.

Parameters

scur    use

Cursor pointer.

Return value

SA_RC_SUCC or error code

Comments


SaCursorDescending

Syntax

SaRetT SA_EXPORT_C SaCursorDescending(SaCursorT* scur, char* colname)

Description

Specifies descending ordering criterium for a column. If a proper key does not exist, the rows are sorted locally. If several criteria are given, they are solved in the given order.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

Return value

SA_RC_SUCC or error code

Comments

See also


SaCursorEnd

Syntax

SaRetT SA_EXPORT_C SaCursorEnd(SaCursorT* scur)

Description

Positions the cursor to the end of the set. Following prev call returns the last row.

Parameters

scur    use

Cursor pointer

Return value

SA_RC_SUCC or error code

Comments

See also


SaCursorEqual

Syntax

SaRetT SA_EXPORT_C SaCursorEqual(SaCursorT* scur, char* colname)

Description

Specifies an equal criterium for a column.

The equal value is taken from the user variable bind to the column.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

Return value

SA_RC_SUCC or error code

Comments

See also


SaCursorErrorInfo

Syntax

bool SA_EXPORT_C SaCursorErrorInfo(SaCursorT* scur, char** errstr, int* errcode)

Description

Returns error info from the last operation in cursor.

Parameters

scur    use

Cursor pointer.

errstr    out, ref

If non-NULL, pointer to a local copy of an error string is stored into *errstr.

errcode    out

If non-NULL, error code is stored into *errcode.

Return value

TRUE There was and error, errstr and errcode updated.

FALSE No errors, errstr and errcode not updated.

Comments


SaCursorFree

Syntax

void SA_EXPORT_C SaCursorFree(SaCursorT* scur)

Description

Releases a cursor. After this call the cursor pointer is invalid.

Parameters

scur    in, take

Cursor pointer.

Return value

Comments


SaCursorInsert

Syntax

SaRetT SA_EXPORT_C SaCursorInsert(SaCursorT* scur)

Description

Inserts a new row to the database. Column values for the new row are taken from the user variables bind to columns. The cursor must be opened before new rows can be inserted.

Parameters

scur    use

Cursor pointer.

Return value

SA_RC_SUCC or error code

Comments


SaCursorLike

Syntax

SaRetT SA_EXPORT_C SaCursorLike(SaCursorT* scur, char* colname, int likelen)

Description

Specifies a like criterium for a column. The value cannot contain any wild card characters like '_' or '%' in SQL. If such characters exist in the column value, they are quoted with escape characters by the system. Thus, the like value is effective the same as the SQL like with no wild card characters ending with a '%' character.

The like value is taken from the user variable bind to the column.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

likelen    in

Length of like part.

Return value

SA_RC_SUCC or error code

Comments

See also


SaCursorNext

Syntax

SaRetT SA_EXPORT_C SaCursorNext(SaCursorT* scur)

Description

Fetches next row from the database. All user variables bind to columns are updated.

Parameters

scur    use

Cursor pointer.

Return value

SA_RC_SUCC Next row found

SA_RC_END End of search

Comments


SaCursorOpen

Syntax

SaRetT SA_EXPORT_C SaCursorOpen(SaCursorT* scur)

Description

Opens a cursor. All SaCursorColXXX operations must be done before the cursor is opened. When cursor is opened, possible existing search is terminated. Also all criteria specified for the cursor are cleared.

After the cursor is opened, user can insert new rows to the cursor or specify search criteria. Cursor must be opened before a search can be started.

Parameters

scur    use

Cursor pointer.

Return value

SA_RC_SUCC or error code

Comments


SaCursorOrderby

Syntax

SaRetT SA_EXPORT_C SaCursorOrderby(SaCursorT* scur, char* colname)

Description

Sets an ordering criterium for a column. There must a proper key for the ordering. Several ordering criteria can be set, they are solved in the given order. There is no initial value for the ordering column.

Parameters

scur    use

Cursor pointer.

colname    in

Column name.

Return value

SA_RC_SUCC or error code

Comments

See also


SaCursorPrev

Syntax

SaRetT SA_EXPORT_C SaCursorPrev(SaCursorT* scur)

Description

Fetches previous row from the database. All user variables bind to columns are updated.

Parameters

scur    use

Cursor pointer.

Return value

SA_RC_SUCC Previous row found

SA_RC_END Beginning of search

Comments


SaCursorReSearch

Syntax

SaRetT SA_EXPORT_C SaCursorReSearch(SaCursorT* scur)

Description

Starts a new search using old search criteria.

Parameters

scur    use

Cursor pointer.

Return value

SA_RC_SUCC, SA_RC_END or error code

Comments


SaCursorSearch

Syntax

SaRetT SA_EXPORT_C SaCursorSearch(SaCursorT* scur)

Description

Starts a search in a cursor. After the search is started, the user can fetch rows from the database.

Every search is executed as a separate transaction and it does not see any changes made by the current user or any other user after the search is started.

Parameters

scur    use

Cursor pointer.

Return value

SA_RC_SUCC SA_RC_END or error code

Comments


SaCursorSearchByRowid

Syntax

SaRetT SA_EXPORT_C SaCursorSearchByRowid(SaCursorT* scur, void* rowid, int rowidlen)

Description

Starts a new search where row specified by rowid belongs to the search set. Previous search constraints are not removed, and they become effective in the next SaCursorReSearch call.

Parameters

scur    use

Cursor pointer.

rowid    in

Pointer to a data area containing rowid.

rowidlen    in

Length of data pointed by rowid.

Return value

SA_RC_SUCC SA_RC_END or error code

Comments

See also


SaCursorSetLockMode

Syntax

SaRetT SA_EXPORT_C SaCursorSetLockMode(SaCursorT* scur, sa_lockmode_t lockmode)

Description

Sets the cursor search mode. This setting affects the possible locking modes in the server. If a search is already active, the setting will affect only in the next search done in the same cursor. By default the search mode is SA_LOCK_SHARE.

Parameters

scur    use

Cursor pointer.

mode    in

Search mode, one of SA_LOCK_SHARE, SA_LOCK_FORUPDATE or SA_LOCK_EXCLUSIVE.

Return value

SA_RC_SUCC

SA_ERR_ILLENUMVAL

Comments

See also


SaCursorSetPosition

Syntax

SaRetT SA_EXPORT_C SaCursorSetPosition(SaCursorT* scur)

Description

Positions the cursor to a row specified by a key value. The key value is taken from user bound column variables which has a constraint specification.

Parameters

scur    use

Cursor pointer.

Return value

SA_RC_SUCC or error code

Comments

See also


SaCursorSetRowsPerMessage

Syntax

SaRetT SA_EXPORT_C SaCursorSetRowsPerMessage(SaCursorT* scur, int rows_per_message)

Description

Sets the number of rows to be sent in one network message from the server to the client. Note that the setting has no effect after the search has been started by function SaCursorSearch.

Parameters

scur    use

Cursor pointer.

rows_per_message    in

Number of rows to send in one network message.

Return value

SA_RC_SUCC Success

SA_ERR_FAILED Error, rows_per_message < 1

Comments

See also


SaCursorUpdate

Syntax

SaRetT SA_EXPORT_C SaCursorUpdate(SaCursorT* scur)

Description

Updated the current row in a cursor in the database. The cursor must be positioned to a row. Column values for the new row are taken from the user variables bound to columns.

Parameters

scur    use

Cursor pointer.

Return value

SA_RC_SUCC or error code

Comments


SaDateCreate

Syntax

SaDateT* SA_EXPORT_C SaDateCreate(void)

Description

Creates a new data object. The date stored in the data object is undefined.

Parameters

Return value

give

A new date object.

Comments

See also


SaDateFree

Syntax

void SA_EXPORT_C SaDateFree(SaDateT* date)

Description

Releases a date object. After this call the date object is invalid and cannot be used.

Parameters

date    in, take

Date object.

Return value

Comments

See also


SaDateSetAsciiz

Syntax

SaRetT SA_EXPORT_C SaDateSetAsciiz(SaDateT* date, char* format, char* asciiz)

Description

Sets ascii zero string date to a date object.

The following special characters are recognized in the format string:

YYYY - year including century
YY - year with default century 1900
MM - month
M - month
DD - day of month
D - day of month
HH - hours
H - hours
NN - minutes
N - minutes
SS - seconds
S - seconds
FFF - fractions of a second, 1/1000 seconds

All fields are optional. The fields are scanned from the format string, and when a match is found, the field is replaced with the proper value. All other characters in the format are treated literally.

Below are examples of the usage of date formats:

SaDateSetAsciiz(date, "YY-MM-DD", "94-09-13"); SaDateSetAsciiz(date, "MM/DD/YY HH.NN", "09/13/94 19.20");

The default date format is YYYY-MM-DD HH:NN:SS, where time fields are optional.

Parameters

date    use

Date object.

format    in

Format of date in asciiz buffer, or NULL if default format is used.

asciiz    in

Buffer containing the data in a ascii zero string format.

Return value

SA_RC_SUCC

SA_ERR_FAILED

Comments

See also


SaDateSetTimet

Syntax

SaRetT SA_EXPORT_C SaDateSetTimet(SaDateT* date, long timet)

Description

Sets time_t date to a date object. The time_t date is the same value as returned by C-library function time().

Parameters

date    use

Date object.

timet    in

New date value in time_t format.

Return value

SA_RC_SUCC

SA_ERR_FAILED

Comments

See also


SaDateToAsciiz

Syntax

SaRetT SA_EXPORT_C SaDateToAsciiz(SaDateT* date, char* format, char* asciiz)

Description

Stores the date in an ascii zero string format. For explanation of different formats, see function SaDateSetAsciiz.

Parameters

date    in

Date object.

format    in

Format of date that is stored into buffer asciiz, or NULL if default format is used.

asciiz    out

Buffer where date is stored.

Return value

SA_RC_SUCC

SA_ERR_FAILED

Comments

See also


SaDateToTimet

Syntax

SaRetT SA_EXPORT_C SaDateToTimet(SaDateT* date, long* p_timet)

Description

Stores the date in a time_t format. The time_t date is the same value as returned by C-library function time().

Parameters

date    in

Date object.

p_timet    out

Pointer to a long variable into where the date is stored in time_t format.

Return value

SA_RC_SUCC

SA_ERR_FAILED

Comments

See also


SaDefineChSet

Syntax

SaRetT SA_EXPORT_C SaDefineChSet(SaConnectT* scon, SaChSetT chset)

Description

Defines client character set.

Parameters

scon    in out, use

pointer to connection object

chset    in

enumerated charset specification. One of the following:

SA_CHSET_DEFAULT - Default character set,

SA_CHSET_NOCNV - No conversion,

SA_CHSET_ANSI - ISO Latin 1, e.g. MS Windows,

SA_CHSET_PCOEM - IBM PC, e.g. MS-DOS,

SA_CHSET_7BITSCAND - e.g. Unix

Return value

SA_RC_SUCC when OK or

SA_ERR_CHSETUNSUPP when specified character set is not supported

Comments

See also


SaDfloatCmp

Syntax

int SA_EXPORT_C SaDfloatCmp(SaDfloatT* p_dfl1, SaDfloatT* p_dfl2)

Description

Compares two dfloat values.

Parameters

p_dfl1    in

Pointer to dfloat variable.

p_dfl2    in

Pointer to dfloat variable.

Return value

< 0 - dfl1 < dfl2

= 0 - dfl1 = dfl2

> 0 - dfl1 > dfl2

Comments

See also


SaDfloatDiff

Syntax

SaRetT SA_EXPORT_C SaDfloatDiff(SaDfloatT* p_result_dfl, SaDfloatT* p_dfl1, SaDfloatT* p_dfl2)

Description

Calculates the difference of two dfloat values. The result is stored into *p_result_dfl.

Parameters

p_result_dfl    out

Pointer to dfloat variable where the result is stored.

p_dfl1    in

Pointer to dfloat variable.

p_dfl2    in

Pointer to dfloat variable.

Return value

Comments

See also


SaDfloatOverflow

Syntax

int SA_EXPORT_C SaDfloatOverflow(SaDfloatT* p_dfl)

Description

Checks if the dfloat contains as overflow value.

Parameters

p_dfl    in

Pointer to dfloat variable.

Return value

1 dfloat value is an overflow value

0 not an overflow value

Comments

See also


SaDfloatProd

Syntax

SaRetT SA_EXPORT_C SaDfloatProd(SaDfloatT* p_result_dfl, SaDfloatT* p_dfl1, SaDfloatT* p_dfl2)

Description

Calculates the producr of two dfloat values. The result is stored into *p_result_dfl.

Parameters

p_result_dfl    out

Pointer to dfloat variable where the result is stored.

p_dfl1    in

Pointer to dfloat variable.

p_dfl2    in

Pointer to dfloat variable.

Return value

Comments

See also


SaDfloatQuot

Syntax

SaRetT SA_EXPORT_C SaDfloatQuot(SaDfloatT* p_result_dfl, SaDfloatT* p_dfl1, SaDfloatT* p_dfl2)

Description

Calculates the quotient of two dfloat values. The result is stored into *p_result_dfl.

Parameters

p_result_dfl    out

Pointer to dfloat variable where the result is stored.

p_dfl1    in

Pointer to dfloat variable.

p_dfl2    in

Pointer to dfloat variable.

Return value

Comments

See also


SaDfloatSetAsciiz

Syntax

SaRetT SA_EXPORT_C SaDfloatSetAsciiz(SaDfloatT* p_dfl, char* asciiz)

Description

Sets the value of the dfloat from as ascii zero string.

Parameters

p_dfl    out

Pointer to the dfloat variable.

asciiz    in

Buffer where the dfloat value is read as an asciiz zero srting.

Return value

SA_RC_SUCC

SA_ERR_FAILED

Comments

See also


SaDfloatSum

Syntax

SaRetT SA_EXPORT_C SaDfloatSum(SaDfloatT* p_result_dfl, SaDfloatT* p_dfl1, SaDfloatT* p_dfl2)

Description

Calculates the sum of two dfloat values. The result is stored into *p_result_dfl.

Parameters

p_result_dfl    out

Pointer to dfloat variable where the result is stored.

p_dfl1    in

Pointer to dfloat variable.

p_dfl2    in

Pointer to dfloat variable.

Return value

Comments

See also


SaDfloatToAsciiz

Syntax

SaRetT SA_EXPORT_C SaDfloatToAsciiz(SaDfloatT* p_dfl, char* asciiz)

Description

Stores the dfloat value as an ascii zero string.

Parameters

p_dfl1    in

Pointer to dfloat variable.

asciiz    out

Buffer where the dfloat is stored in asciiz zero string format.

Return value

SA_RC_SUCC

SA_ERR_FAILED

Comments

See also


SaDfloatUnderflow

Syntax

int SA_EXPORT_C SaDfloatUnderflow(SaDfloatT* p_dfl)

Description

Checks if the dfloat contains as underflow value.

Parameters

p_dfl    in

Pointer to dfloat variable.

Return value

1 dfloat value is an underflow value

0 not an underflow value

Comments

See also


SaDisconnect

Syntax

void SA_EXPORT_C SaDisconnect(SaConnectT* scon)

Description

Disconnects user from the SOLID Server.

Parameters

scon    in, take

Connect pointer.

Return value

Comments


SaDynDataAppend

Syntax

void SA_EXPORT_C SaDynDataAppend(SaDynDataT* dd, char* data, unsigned len)

Description

Appends data to the dynamic data object.

Parameters

dd    use

Pointer to a dynamic data object.

data    in

Data that is appended to the dd.

len    in

Length of data.

Return value

Comments

See also


SaDynDataChLen

Syntax

void SA_EXPORT_C SaDynDataChLen(SaDynDataT* dd, unsigned len)

Description

Changes the data area length of dynamic data object. If new length is smaller than current length, the data area is truncated. If new length is greater than current length, the new data area content is initialized with space characters.

Parameters

dd    use

Pointer to a dynamic data object.

len    in

New data area length of dynamic data object.

Return value

Comments

See also


SaDynDataClear

Syntax

void SA_EXPORT_C SaDynDataClear(SaDynDataT* dd)

Description

Clears all allocations from a DynData object.

Parameters

dd    use

Pointer to a dynamic data object.

Return value

Comments

See also


SaDynDataCreate

Syntax

SaDynDataT* SA_EXPORT_C SaDynDataCreate(void)

Description

Creates a new dynamic data object.

Parameters

Return value

Pointer to a new empty dynamic data object.

Comments

See also


SaDynDataFree

Syntax

void SA_EXPORT_C SaDynDataFree(SaDynDataT* dd)

Description

Realeases a dynamic data object. Aftre this call the dynamic data object pointer is invalid and cannot be used.

Parameters

dd    in, take

Pointer to a dynamic data object that is released.

Return value

Comments

See also


SaDynDataGetData

Syntax

char* SA_EXPORT_C SaDynDataGetData(SaDynDataT* dd)

Description

Returns pointer to the data area of dynamic data object.

Parameters

dd    in

Pointer to a dynamic data object.

Return value

Reference to the local data area of dynamic data object.

Comments

See also


SaDynDataGetLen

Syntax

unsigned SA_EXPORT_C SaDynDataGetLen(SaDynDataT* dd)

Description

Returns the length of the data area of dynamic data object.

Parameters

dd   in

Pointer to a dynamic data object.

Return value

Data area length.

Comments

See also


SaDynDataMove

Syntax

void SA_EXPORT_C SaDynDataMove(SaDynDataT* dd, char* data, unsigned len)

Description

Moves data to the dynamic data object. This function overrides possible existing data.

Parameters

dd    use

Pointer to a dynamic data object.

data    in

New data.

len    in

Length of data.

Return value

Comments

See also


SaDynDataMoveRef

Syntax

void SA_EXPORT_C SaDynDataMoveRef(SaDynDataT* dd, char* data, unsigned len)

Description

Moves data reference to a dynamic data object. The caller should guarantee that input data is alive as long as the reference in the dynamic data object.

Parameters

dd    use

Pointer to a dynamic data object.

data    in, hold

Pointer to the new data content of the dynamic data object.

len    in

The length of the new data content.

Return value

Comments

See also


SaDynStrAppend

Syntax

void SA_EXPORT_C SaDynStrAppend(SaDynStrT* p_ds, char* str)

Description

Appends another string at the end of dynamic string.

Parameters

p_ds    use

Pointer to dynamic string variable.

str    in

String that is appended to p_ds.

Return value

Comments

See also


SaDynStrCreate

Syntax

SaDynStrT SA_EXPORT_C SaDynStrCreate(void)

Description

Creates and initializes a new dynamic string object.

Parameters

Return value

Pointer to dynamic string variable, initialized with empty data.

Comments

See also


SaDynStrFree

Syntax

void SA_EXPORT_C SaDynStrFree(SaDynStrT* p_ds)

Description

Realeases a dynamic string object. After this call the dynamic string object pointer is invalid and cannot be used.

Parameters

p_ds   in, take

Pointer to dynamic string variable.

Return value

Comments

See also


SaDynStrMove

Syntax

void SA_EXPORT_C SaDynStrMove(SaDynStrT* p_ds, char* str)

Description

This routine sets the value of a SaDynStrT. The SaDynStrT must have been initialized with SaDynStrCreate before setting it with SaDynStrMove.

ATTENTION! Do never copy a SaDynStrT to another SaDynStrT for example with memcpy. This would result into two SaDynStrT pointers pointing at the same allocated area.

Parameters

p_ds    use

Pointer to dynamic string variable.

str    in

New value of dynamic string.

Return value

Comments

See also


SaErrorInfo

Syntax

bool SA_EXPORT_C SaErrorInfo(SaConnectT* scon, char** errstr, int* errcode)

Description

Returns error info from the last operation in server connection. Cursor errors cannot be checked with this function, instead function SaCursorErrorInfo must be used.

Parameters

scon    use

Connect pointer.

errstr    out, ref

If non-NULL, pointer to a local copy of an error string is stored into *errstr.

errcode    out

If non-NULL, error code is stored into *errcode.

Return value

TRUE There was and error, errstr and errcode updated.

FALSE No errors, errstr and errcode not updated.

Comments


SaGlobalInit

Syntax

void SA_EXPORT_C SaGlobalInit(void)

Description

Does some global initializations in the SA system. This function should be called when other SA functions are called before SaConnect function.

Parameters

Return value

Comments

See also


SaSetDateFormat

Syntax

SaRetT SA_EXPORT_C SaSetDateFormat(SaConnectT* scon, char* dateformat)

Description

Defines default date format. For explanation of possible date formats see documentation of function SaDateSetAsciiz.

Parameters

scon    in out, use

pointer to connection object

dateformat    in

Default date format for connection.

Return value

SA_RC_SUCC

Comments

See also


SaSetSortBufSize

Syntax

SaRetT SA_EXPORT_C SaSetSortBufSize(SaConnectT* scon, unsigned long size)

Description

Sets amount of memory that a connection uses for local sorts.

Parameters

scon    in out, use

pointer to connection object

size    in

memory buffer size in bytes

Return value

SA_RC_SUCC when OK or

SA_ERR_FAILED when specified memory size was too small (< 10KB)

Comments

See also


SaSetSortMaxFiles

Syntax

SaRetT SA_EXPORT_C SaSetSortMaxFiles(SaConnectT* scon, unsigned int nfiles)

Description

Sets maximum number of files that the connection uses for local sorts

Parameters

scon    in out, use

pointer to connection object

nfiles    in

max number of files

Return value

SA_RC_SUCC when OK or

SA_ERR_FAILED when specified number of files is was too small (< 3)

Comments

See also


SaSQLExecDirect

Syntax

SaRetT SA_EXPORT_C SaSQLExecDirect(SaConnectT* scon, char* sqlstr)

Description

Passes an SQL string to server for immediate execution. Does not allow returning any data. Typically this is used for passing administration statements, data definition language statements and statements affecting several rows at once, like "DELETE FROM mytable WHERE ...";

The passed statement is treated as one transaction that is committed immediately after successfull execution.

Parameters

scon    in out, use

Pointer to connection object

sqlstr   in

SQL statement to be executed

Return value

SA_RC_SUCC when OK or errorcode.

Comments

See also


SaSetTimeFormat

Syntax

SaRetT SA_EXPORT_C SaSetTimeFormat(SaConnectT* scon, char* timeformat)

Description

Defines default time format. For explanation of possible date formats see documentation of function SaDateSetAsciiz.

Parameters

scon    in out, use

Pointer to connection object

timeformat    in

Default time format for connection

Return value

SA_RC_SUCC

Comments

See also


SaSetTimestampFormat

Syntax

SaRetT SA_EXPORT_C SaSetTimestampFormat(SaConnectT* scon, char* timestampformat)

Description

Defines default timestamp format. For explanation of possible date formats see documentation of function SaDateSetAsciiz.

Parameters

scon    in out, use

pointer to connection object

timestampformat    in

Default timestamp format for connection.

Return value

SA_RC_SUCC

Comments

See also


SaTransBegin

Syntax

void SA_EXPORT_C SaTransBegin(SaConnectT* scon)

Description

Starts a new transaction. By default each insert, update and delete operations are executed in separate transactions. After this call all insert, update and delete operations are executed in the same transaction, and the changes are not visible in the database until SaTransCommit is called.

The transaction is run in a mode where write operations are validated for lost updates and unique errors.

Parameters

scon    use

Pointer to connection object.

Return value

Comments

See also


SaTransCommit

Syntax

SaRetT SA_EXPORT_C SaTransCommit(SaConnectT* scon)

Description

Commits the current transaction started by SaTransBegin. After this call all changes are made persistent in the database. Following insert, update and delete operations are run in autocommit mode until SaTransBegin is called.

Parameters

scon    use

Pointer to connection object.

Return value

SA_RC_SUCC or error code

Comments


SaTransRollback

Syntax

SaRetT SA_EXPORT_C SaTransRollback(SaConnectT* scon)

Description

Rolls back the current transaction started by SaTransBegin. No changes are made to the database. Following insert, update and delete operations are run in autocommit mode until SaTransBegin is called.

Parameters

scon    use

Pointer to connection object.

Return value

SA_RC_SUCC or error code

Comments