ajsql.c

Datatypes: none AjPSqlconnection AjESqlconnectionClient AjPSqlstatement AjISqlrow AjPSqlrow AjPVoid


Datatype: none

Internals

Sections: initialization exiting


Section: initialization

Functions: ajSqlInit


Function ajSqlInit

Initialises implementation-specific SQL client libraries.

Synopsis

Prototype
AjBool ajSqlInit (
      void
);

TypeNameRead/WriteDescription
AjBool RETURNajTrue if the initialisation was successful.

Returns
AjBool:ajTrue if the initialisation was successful.

Description

Initialises implementation-specific SQL client libraries.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: exiting

Functions: ajSqlExit


Function ajSqlExit

Finalises implementation-specific SQL client libraries.

Synopsis

Prototype
void ajSqlExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

Returns
void:No return value

Description

Finalises implementation-specific SQL client libraries.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPSqlconnection

SQL Connection

Sections: constructors destructors Cast debugging


Section: constructors

Functions for constructing AJAX SQL Connection objects.

Functions: ajSqlconnectionNewData ajSqlconnectionNewRef


Function ajSqlconnectionNewData

Default AJAX SQL Connection constructor, which also allocates a client library-specific connection object.

A connection to an SQL server is established.

For MySQL clients options will be read from the [client] and [EMBOSS] groups of the default my.cnf options file.

Synopsis

Prototype
AjPSqlconnection ajSqlconnectionNewData (
      AjESqlconnectionClient client,
      const AjPStr user,
      const AjPStr password,
      const AjPStr host,
      const AjPStr port,
      const AjPStr socketfile,
      const AjPStr database
);

TypeNameRead/WriteDescription
AjESqlconnectionClientclientModifySQL client
const AjPStruserInputSQL account user name
const AjPStrpasswordInputSQL account password
const AjPStrhostInputSQL server hostname or IP address
const AjPStrportInputSQL server port number
const AjPStrsocketfileInputSQL server UNIX socket file MySQL: Absolute path to the socket file. PostgreSQL: Absolute path to the socket directory only. Socket file names are then generated from this directory information and the port number above. See "%s/.s.PGSQL.%d" in macro UNIXSOCK_PATH in source file pgsql/src/include/libpq/pqcomm.h
const AjPStrdatabaseInputSQL database name
AjPSqlconnection RETURNAJAX SQL Connection or NULL

Input
user:(Input)SQL account user name
password:(Input)SQL account password
host:(Input)SQL server hostname or IP address
port:(Input)SQL server port number
socketfile:(Input)SQL server UNIX socket file MySQL: Absolute path to the socket file. PostgreSQL: Absolute path to the socket directory only. Socket file names are then generated from this directory information and the port number above. See "%s/.s.PGSQL.%d" in macro UNIXSOCK_PATH in source file pgsql/src/include/libpq/pqcomm.h
database:(Input)SQL database name
Input & Output
client:(Modify)SQL client
Returns
AjPSqlconnection:AJAX SQL Connection or NULL

Description

Default AJAX SQL Connection constructor, which also allocates a client library-specific connection object.

A connection to an SQL server is established.

For MySQL clients options will be read from the [client] and [EMBOSS] groups of the default my.cnf options file.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlconnectionNewRef

Ensembl Object referencing function, which returns a pointer to the Ensembl Object passed in and increases its reference count.

Synopsis

Prototype
AjPSqlconnection ajSqlconnectionNewRef (
      AjPSqlconnection sqlc
);

TypeNameRead/WriteDescription
AjPSqlconnectionsqlcModifyAJAX SQL Connection
AjPSqlconnection RETURNAJAX SQL Connection or NULL

Input & Output
sqlc:(Modify)AJAX SQL Connection
Returns
AjPSqlconnection:AJAX SQL Connection or NULL

Description

Ensembl Object referencing function, which returns a pointer to the Ensembl Object passed in and increases its reference count.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: destructors

Functions for destruction of AJAX SQL Connection objects.

Functions: ajSqlconnectionDel


Function ajSqlconnectionDel

Default AJAX SQL Connection destructor, which disconnects from the SQL server first, frees the client library-specific connection object and finally the AJAX SQL Connection object.

Synopsis

Prototype
void ajSqlconnectionDel (
      AjPSqlconnection* Psqlc
);

TypeNameRead/WriteDescription
AjPSqlconnection*PsqlcDeleteAJAX SQL Connection address
void RETURN

Output
Psqlc:(Delete)AJAX SQL Connection address
Returns
void:No return value

Description

Default AJAX SQL Connection destructor, which disconnects from the SQL server first, frees the client library-specific connection object and finally the AJAX SQL Connection object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Cast

Functions for returning elements of an AJAX SQL Connection object.

Functions: ajSqlconnectionEscapeC ajSqlconnectionEscapeS ajSqlconnectionGetClient ajSqlconnectionGetUse


Function ajSqlconnectionEscapeC

Escape special characters in an AJAX String for use in an SQL statement, taking into account the current character set of the AJAX SQL Connection and return a C-type character string.

The caller is responsible for deleting the escaped C-type character string.

Synopsis

Prototype
AjBool ajSqlconnectionEscapeC (
      const AjPSqlconnection sqlc,
      char** Ptxt,
      const AjPStr str
);

TypeNameRead/WriteDescription
const AjPSqlconnectionsqlcInputAJAX SQL Connection
char**PtxtOutputAddress of the (new) SQL-escaped C-type string
const AjPStrstrInputAJAX String to be escaped
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlc:(Input)AJAX SQL Connection
str:(Input)AJAX String to be escaped
Output
Ptxt:(Output)Address of the (new) SQL-escaped C-type string
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Escape special characters in an AJAX String for use in an SQL statement, taking into account the current character set of the AJAX SQL Connection and return a C-type character string.

The caller is responsible for deleting the escaped C-type character string.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlconnectionEscapeS

Escape special characters in an AJAX String for use in an SQL statement, taking into account the current character set of the AJAX SQL Connection and return an AJAX String.

The caller is responsible for deleting the escaped AJAX String.

Synopsis

Prototype
AjBool ajSqlconnectionEscapeS (
      const AjPSqlconnection sqlc,
      AjPStr* Pstr,
      const AjPStr str
);

TypeNameRead/WriteDescription
const AjPSqlconnectionsqlcInputAJAX SQL Connection
AjPStr*PstrOutputAddress of the (new) SQL-escaped AJAX String
const AjPStrstrInputAJAX String to be escaped
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlc:(Input)AJAX SQL Connection
str:(Input)AJAX String to be escaped
Output
Pstr:(Output)Address of the (new) SQL-escaped AJAX String
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Escape special characters in an AJAX String for use in an SQL statement, taking into account the current character set of the AJAX SQL Connection and return an AJAX String.

The caller is responsible for deleting the escaped AJAX String.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlconnectionGetClient

Get the client element of an AJAX SQL Connection.

Synopsis

Prototype
AjESqlconnectionClient ajSqlconnectionGetClient (
      const AjPSqlconnection sqlc
);

TypeNameRead/WriteDescription
const AjPSqlconnectionsqlcInputAJAX SQL Connection
AjESqlconnectionClient RETURNAJAX SQL Connection client or ajESqlconnectionClientNULL

Input
sqlc:(Input)AJAX SQL Connection
Returns
AjESqlconnectionClient:AJAX SQL Connection client or ajESqlconnectionClientNULL

Description

Get the client element of an AJAX SQL Connection.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlconnectionGetUse

Get the use counter element of an AJAX SQL Connection.

Synopsis

Prototype
ajuint ajSqlconnectionGetUse (
      const AjPSqlconnection sqlc
);

TypeNameRead/WriteDescription
const AjPSqlconnectionsqlcInputAJAX SQL Connection
ajuint RETURNUse counter

Input
sqlc:(Input)AJAX SQL Connection
Returns
ajuint:Use counter

Description

Get the use counter element of an AJAX SQL Connection.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: debugging

Functions for reporting of an AJAX SQL Connection object.

Functions: ajSqlconnectionTrace


Function ajSqlconnectionTrace

Trace an AJAX SQL Connection.

Synopsis

Prototype
AjBool ajSqlconnectionTrace (
      const AjPSqlconnection sqlc,
      ajuint level
);

TypeNameRead/WriteDescription
const AjPSqlconnectionsqlcInputAJAX SQL Connection
ajuintlevelInputIndentation level
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlc:(Input)AJAX SQL Connection
level:(Input)Indentation level
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Trace an AJAX SQL Connection.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjESqlconnectionClient

SQL Connection Client

Sections: Misc Cast


Section: Misc

Functions for returning a AJAX SQL Connection Client enumeration

Functions: ajSqlconnectionClientFromStr


Function ajSqlconnectionClientFromStr

Convert an AJAX String into an AJAX SQL Connection client element.

Synopsis

Prototype
AjESqlconnectionClient ajSqlconnectionClientFromStr (
      const AjPStr client
);

TypeNameRead/WriteDescription
const AjPStrclientInputClient string
AjESqlconnectionClient RETURNAJAX SQL Connection client or ajESqlconnectionClientNULL

Input
client:(Input)Client string
Returns
AjESqlconnectionClient:AJAX SQL Connection client or ajESqlconnectionClientNULL

Description

Convert an AJAX String into an AJAX SQL Connection client element.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Cast

Functions for returning attributes of an AJAX SQL Connection client enumeration

Functions: ajSqlconnectionClientToChar


Function ajSqlconnectionClientToChar

Convert an AJAX SQL Connection client element into a C-type (char*) string.

Synopsis

Prototype
const char* ajSqlconnectionClientToChar (
      AjESqlconnectionClient client
);

TypeNameRead/WriteDescription
AjESqlconnectionClientclientModifySQL Connection client
const char* RETURNSQL Connection client C-type (char*) string

Input & Output
client:(Modify)SQL Connection client
Returns
const char*:SQL Connection client C-type (char*) string

Description

Convert an AJAX SQL Connection client element into a C-type (char*) string.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPSqlstatement

AJAX SQL Statement

Sections: constructors destructors cast


Section: constructors

Functions for constructing AJAX SQL Statement objects.

Functions: ajSqlstatementNewRef ajSqlstatementNewRun


Function ajSqlstatementNewRef

Ensembl Object referencing function, which returns a pointer to the Ensembl Object passed in and increases its reference count.

Synopsis

Prototype
AjPSqlstatement ajSqlstatementNewRef (
      AjPSqlstatement sqls
);

TypeNameRead/WriteDescription
AjPSqlstatementsqlsModifyAJAX SQL Statement
AjPSqlstatement RETURNAJAX SQL Statement or NULL

Input & Output
sqls:(Modify)AJAX SQL Statement
Returns
AjPSqlstatement:AJAX SQL Statement or NULL

Description

Ensembl Object referencing function, which returns a pointer to the Ensembl Object passed in and increases its reference count.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlstatementNewRun

Default AJAX SQL Statement constructor. Upon construction the SQL Statement is run against the SQL server specified in the AJAX SQL Connection. Eventual results of the SQL Statement are then stored inside this object.

Synopsis

Prototype
AjPSqlstatement ajSqlstatementNewRun (
      AjPSqlconnection sqlc,
      const AjPStr statement
);

TypeNameRead/WriteDescription
AjPSqlconnectionsqlcModifyAJAX SQL Connection
const AjPStrstatementInputSQL statement
AjPSqlstatement RETURNAJAX SQL Statement or NULL

Input
statement:(Input)SQL statement
Input & Output
sqlc:(Modify)AJAX SQL Connection
Returns
AjPSqlstatement:AJAX SQL Statement or NULL

Description

Default AJAX SQL Statement constructor. Upon construction the SQL Statement is run against the SQL server specified in the AJAX SQL Connection. Eventual results of the SQL Statement are then stored inside this object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: destructors

Functions for destruction of AJAX SQL Statement objects.

Functions: ajSqlstatementDel


Function ajSqlstatementDel

Default AJAX SQL Statement destructor, which also destroys the SQL client library-specific result object.

Synopsis

Prototype
void ajSqlstatementDel (
      AjPSqlstatement* Psqls
);

TypeNameRead/WriteDescription
AjPSqlstatement*PsqlsDeleteAJAX SQL Statement address
void RETURN

Output
Psqls:(Delete)AJAX SQL Statement address
Returns
void:No return value

Description

Default AJAX SQL Statement destructor, which also destroys the SQL client library-specific result object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: cast

Functions: ajSqlstatementGetAffectedrows ajSqlstatementGetColumns ajSqlstatementGetIdentifier ajSqlstatementGetSelectedrows


Function ajSqlstatementGetAffectedrows

Get the number of rows affected by a non-SELECT SQL statement.

Synopsis

Prototype
ajulong ajSqlstatementGetAffectedrows (
      const AjPSqlstatement sqls
);

TypeNameRead/WriteDescription
const AjPSqlstatementsqlsInputAJAX SQL Statement
ajulong RETURNNumber of affected rows

Input
sqls:(Input)AJAX SQL Statement
Returns
ajulong:Number of affected rows

Description

Get the number of rows affected by a non-SELECT SQL statement.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlstatementGetColumns

Get the number of columns returned by a SELECT-like SQL statement.

Synopsis

Prototype
ajuint ajSqlstatementGetColumns (
      const AjPSqlstatement sqls
);

TypeNameRead/WriteDescription
const AjPSqlstatementsqlsInputAJAX SQL Statement
ajuint RETURNNumber of selected columns

Input
sqls:(Input)AJAX SQL Statement
Returns
ajuint:Number of selected columns

Description

Get the number of columns returned by a SELECT-like SQL statement.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlstatementGetIdentifier

Get the identifier of a row inserted by the last INSERT-like SQL statement.

Synopsis

Prototype
ajuint ajSqlstatementGetIdentifier (
      const AjPSqlstatement sqls
);

TypeNameRead/WriteDescription
const AjPSqlstatementsqlsInputAJAX SQL Statement
ajuint RETURNIdentifier of last inserted row

Input
sqls:(Input)AJAX SQL Statement
Returns
ajuint:Identifier of last inserted row

Description

Get the identifier of a row inserted by the last INSERT-like SQL statement.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlstatementGetSelectedrows

Get the number of rows selected by a SELECT-like SQL statement.

Synopsis

Prototype
ajulong ajSqlstatementGetSelectedrows (
      const AjPSqlstatement sqls
);

TypeNameRead/WriteDescription
const AjPSqlstatementsqlsInputAJAX SQL Statement
ajulong RETURNNumber of selected rows

Input
sqls:(Input)AJAX SQL Statement
Returns
ajulong:Number of selected rows

Description

Get the number of rows selected by a SELECT-like SQL statement.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjISqlrow

AJAX SQL Row Iterator

Sections: constructors destructors tests stepping modifiers


Section: constructors

Functions for constructing AJAX SQL Row Iterator objects.

Functions: ajSqlrowiterNew


Function ajSqlrowiterNew

Default AJAX SQL Row Iterator constructor.

Synopsis

Prototype
AjISqlrow ajSqlrowiterNew (
      AjPSqlstatement sqls
);

TypeNameRead/WriteDescription
AjPSqlstatementsqlsModifyAJAX SQL Statement
AjISqlrow RETURNAJAX SQL Row Iterator or NULL if the AJAX SQL Statement did not return rows and columns

Input & Output
sqls:(Modify)AJAX SQL Statement
Returns
AjISqlrow:AJAX SQL Row Iterator or NULL if the AJAX SQL Statement did not return rows and columns

Description

Default AJAX SQL Row Iterator constructor.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: destructors

Functions for destruction of AJAX SQL Row Iterator objects.

Functions: ajSqlrowiterDel


Function ajSqlrowiterDel

Default AJAX SQL Row Iterator destructor.

Synopsis

Prototype
void ajSqlrowiterDel (
      AjISqlrow* Psqli
);

TypeNameRead/WriteDescription
AjISqlrow*PsqliDeleteAJAX SQL Row Iterator address
void RETURN

Output
Psqli:(Delete)AJAX SQL Row Iterator address
Returns
void:No return value

Description

Default AJAX SQL Row Iterator destructor.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: tests

Functions: ajSqlrowiterDone


Function ajSqlrowiterDone

Tests whether an AJAX SQL Row Iterator has completed yet.

Synopsis

Prototype
AjBool ajSqlrowiterDone (
      const AjISqlrow sqli
);

TypeNameRead/WriteDescription
const AjISqlrowsqliInputAJAX SQL Row Iterator
AjBool RETURNajTrue if the iterator is exhausted

Input
sqli:(Input)AJAX SQL Row Iterator
Returns
AjBool:ajTrue if the iterator is exhausted

Description

Tests whether an AJAX SQL Row Iterator has completed yet.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: stepping

Functions: ajSqlrowiterGet


Function ajSqlrowiterGet

Returns the next AJAX SQL Row using the iterator, or steps off the end.

Synopsis

Prototype
AjPSqlrow ajSqlrowiterGet (
      AjISqlrow sqli
);

TypeNameRead/WriteDescription
AjISqlrowsqliModifyAJAX SQL Row Iterator
AjPSqlrow RETURNAJAX SQL Row or NULL

Input & Output
sqli:(Modify)AJAX SQL Row Iterator
Returns
AjPSqlrow:AJAX SQL Row or NULL

Description

Returns the next AJAX SQL Row using the iterator, or steps off the end.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: modifiers

Functions: ajSqlrowiterRewind


Function ajSqlrowiterRewind

Rewind an AJAX SQL Row Iterator to the start position.

Synopsis

Prototype
AjBool ajSqlrowiterRewind (
      AjISqlrow sqli
);

TypeNameRead/WriteDescription
AjISqlrowsqliModifyAJAX SQL Row Iterator
AjBool RETURNajTrue upon success, ajFalse otherwise

Input & Output
sqli:(Modify)AJAX SQL Row Iterator
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Rewind an AJAX SQL Row Iterator to the start position.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPSqlrow

AJAX SQL Row

Sections: constructors destructors element retrieval


Section: constructors

Functions for constructing AJAX SQL Row objects.

Functions: ajSqlrowNew


Function ajSqlrowNew

Default AJAX SQL Row constructor.

Synopsis

Prototype
AjPSqlrow ajSqlrowNew (
      ajuint columns
);

TypeNameRead/WriteDescription
ajuintcolumnsInputNumber of columns per AJAX SQL Row
AjPSqlrow RETURNAJAX SQL Row

Input
columns:(Input)Number of columns per AJAX SQL Row
Returns
AjPSqlrow:AJAX SQL Row

Description

Default AJAX SQL Row constructor.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: destructors

Functions for destruction of AJAX SQL Row objects.

Functions: ajSqlrowDel


Function ajSqlrowDel

Default AJAX SQL Row destructor.

Synopsis

Prototype
void ajSqlrowDel (
      AjPSqlrow* Psqlr
);

TypeNameRead/WriteDescription
AjPSqlrow*PsqlrDeleteAJAX SQL Row address
void RETURN

Output
Psqlr:(Delete)AJAX SQL Row address
Returns
void:No return value

Description

Default AJAX SQL Row destructor.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: element retrieval

Functions for returning elements of an AJAX SQL Row object.

Functions: ajSqlrowGetColumns ajSqlrowGetCurrent ajSqlrowGetLengths ajSqlrowGetValues


Function ajSqlrowGetColumns

Get the number of columns in an AJAX SQL Row.

Synopsis

Prototype
ajuint ajSqlrowGetColumns (
      const AjPSqlrow sqlr
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuint RETURNNumber of columns in an AJAX SQL Row

Input
sqlr:(Input)AJAX SQL Row
Returns
ajuint:Number of columns in an AJAX SQL Row

Description

Get the number of columns in an AJAX SQL Row.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlrowGetCurrent

Get the number of the current column in column iterations of an AJAX SQL Row.

Synopsis

Prototype
ajuint ajSqlrowGetCurrent (
      const AjPSqlrow sqlr
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuint RETURNNumber of current column of an AJAX SQL Row

Input
sqlr:(Input)AJAX SQL Row
Returns
ajuint:Number of current column of an AJAX SQL Row

Description

Get the number of the current column in column iterations of an AJAX SQL Row.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlrowGetLengths

Get the AJAX Long Integer Array of column value lengths in an AJAX SQL Row.

Synopsis

Prototype
AjPLong ajSqlrowGetLengths (
      const AjPSqlrow sqlr
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
AjPLong RETURNAJAX Long Integer Array

Input
sqlr:(Input)AJAX SQL Row
Returns
AjPLong:AJAX Long Integer Array

Description

Get the AJAX Long Integer Array of column value lengths in an AJAX SQL Row.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlrowGetValues

Get the AJAX Void Pointer Array of column values in an AJAX SQL Row.

Synopsis

Prototype
AjPVoid ajSqlrowGetValues (
      const AjPSqlrow sqlr
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
AjPVoid RETURNAJAX Void Pointer Array

Input
sqlr:(Input)AJAX SQL Row
Returns
AjPVoid:AJAX Void Pointer Array

Description

Get the AJAX Void Pointer Array of column values in an AJAX SQL Row.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: column modifiers

Functions: ajSqlcolumnRewind


Function ajSqlcolumnRewind

Rewind an AJAX SQL Column Iterator to the start position.

Synopsis

Prototype
AjBool ajSqlcolumnRewind (
      AjPSqlrow sqlr
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
AjBool RETURNajTrue upon success, ajFalse otherwise

Input & Output
sqlr:(Modify)AJAX SQL Row
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Rewind an AJAX SQL Column Iterator to the start position.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: column retrieval

Functions: ajSqlcolumnGetValue


Function ajSqlcolumnGetValue

Get the value of the next column of an AJAX SQL Row. Calling this function also advances the column iterator.

Synopsis

Prototype
AjBool ajSqlcolumnGetValue (
      AjPSqlrow sqlr,
      void** Pvalue,
      ajulong* Plength
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
void**PvalueModifyValue address
ajulong*PlengthModifyValue length address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input & Output
sqlr:(Modify)AJAX SQL Row
Pvalue:(Modify)Value address
Plength:(Modify)Value length address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Get the value of the next column of an AJAX SQL Row. Calling this function also advances the column iterator.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: column to datatype conversion functions

Functions for converting SQL Column values to other datatypes.

Functions: ajSqlcolumnToBool ajSqlcolumnToDouble ajSqlcolumnToFloat ajSqlcolumnToInt ajSqlcolumnToLong ajSqlcolumnToStr ajSqlcolumnToTime ajSqlcolumnToUint ajSqlcolumnToUlong


Function ajSqlcolumnToBool

Converts the value in the next column of an AJAX SQL Row into an AJAX Boolean value.

This function uses ajStrToBool to convert the AJAX String representing the column value into an AJAX boolean value. The function converts 'yes' and 'true', as well as 'no' and 'false' into its corresponding AJAX Bool values. It also assumes any numeric value as true and 0 as false.

Synopsis

Prototype
AjBool ajSqlcolumnToBool (
      AjPSqlrow sqlr,
      AjBool* Pvalue
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
AjBool*PvalueOutputAJAX Boolean address
AjBool RETURNajTrue upon success, ajFalse otherwise

Output
Pvalue:(Output)AJAX Boolean address
Input & Output
sqlr:(Modify)AJAX SQL Row
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in the next column of an AJAX SQL Row into an AJAX Boolean value.

This function uses ajStrToBool to convert the AJAX String representing the column value into an AJAX boolean value. The function converts 'yes' and 'true', as well as 'no' and 'false' into its corresponding AJAX Bool values. It also assumes any numeric value as true and 0 as false.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnToDouble

Converts the value in the next column of an AJAX SQL Row into a C-type double value.

Synopsis

Prototype
AjBool ajSqlcolumnToDouble (
      AjPSqlrow sqlr,
      double* Pvalue
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
double*PvalueOutputC-type double address
AjBool RETURNajTrue upon success, ajFalse otherwise

Output
Pvalue:(Output)C-type double address
Input & Output
sqlr:(Modify)AJAX SQL Row
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in the next column of an AJAX SQL Row into a C-type double value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnToFloat

Converts the value in the next column of an AJAX SQL Row into a C-type float value.

Synopsis

Prototype
AjBool ajSqlcolumnToFloat (
      AjPSqlrow sqlr,
      float* Pvalue
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
float*PvalueOutputC-type float address
AjBool RETURNajTrue upon success, ajFalse otherwise

Output
Pvalue:(Output)C-type float address
Input & Output
sqlr:(Modify)AJAX SQL Row
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in the next column of an AJAX SQL Row into a C-type float value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnToInt

Converts the value in the next column of an AJAX SQL Row into an AJAX Integer value.

Synopsis

Prototype
AjBool ajSqlcolumnToInt (
      AjPSqlrow sqlr,
      ajint* Pvalue
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
ajint*PvalueOutputAJAX Integer address
AjBool RETURNajTrue upon success, ajFalse otherwise

Output
Pvalue:(Output)AJAX Integer address
Input & Output
sqlr:(Modify)AJAX SQL Row
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in the next column of an AJAX SQL Row into an AJAX Integer value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnToLong

Converts the value in the next column of an AJAX SQL Row into an AJAX Long Integer value.

Synopsis

Prototype
AjBool ajSqlcolumnToLong (
      AjPSqlrow sqlr,
      ajlong* Pvalue
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
ajlong*PvalueOutputAJAX Long Integer address
AjBool RETURNajTrue upon success, ajFalse otherwise

Output
Pvalue:(Output)AJAX Long Integer address
Input & Output
sqlr:(Modify)AJAX SQL Row
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in the next column of an AJAX SQL Row into an AJAX Long Integer value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnToStr

Converts the value of the next column of an AJAX SQL Row into an AJAX String value.

Synopsis

Prototype
AjBool ajSqlcolumnToStr (
      AjPSqlrow sqlr,
      AjPStr* Pvalue
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
AjPStr*PvalueOutputAJAX String address
AjBool RETURNajTrue upon success, ajFalse otherwise

Output
Pvalue:(Output)AJAX String address
Input & Output
sqlr:(Modify)AJAX SQL Row
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value of the next column of an AJAX SQL Row into an AJAX String value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnToTime

Converts the value in the next column of an AJAX SQL Row into an AJAX Time value.

Synopsis

Prototype
AjBool ajSqlcolumnToTime (
      AjPSqlrow sqlr,
      AjPTime* Pvalue
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
AjPTime*PvalueOutputAJAX Time address
AjBool RETURNajTrue upon success, ajFalse otherwise

Output
Pvalue:(Output)AJAX Time address
Input & Output
sqlr:(Modify)AJAX SQL Row
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in the next column of an AJAX SQL Row into an AJAX Time value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnToUint

Converts the value in the next column of an AJAX SQL Row into an AJAX Unsigned Integer value.

Synopsis

Prototype
AjBool ajSqlcolumnToUint (
      AjPSqlrow sqlr,
      ajuint* Pvalue
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
ajuint*PvalueOutputAJAX Unsigned Integer address
AjBool RETURNajTrue upon success, ajFalse otherwise

Output
Pvalue:(Output)AJAX Unsigned Integer address
Input & Output
sqlr:(Modify)AJAX SQL Row
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in the next column of an AJAX SQL Row into an AJAX Unsigned Integer value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnToUlong

Converts the value in the next column of an AJAX SQL Row into an AJAX Unsigned Long Integer value.

Synopsis

Prototype
AjBool ajSqlcolumnToUlong (
      AjPSqlrow sqlr,
      ajulong* Pvalue
);

TypeNameRead/WriteDescription
AjPSqlrowsqlrModifyAJAX SQL Row
ajulong*PvalueOutputAJAX Unsigned Long Integer address
AjBool RETURNajTrue upon success, ajFalse otherwise

Output
Pvalue:(Output)AJAX Unsigned Long Integer address
Input & Output
sqlr:(Modify)AJAX SQL Row
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in the next column of an AJAX SQL Row into an AJAX Unsigned Long Integer value.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: column retrieval

Functions: ajSqlcolumnNumberGetValue


Function ajSqlcolumnNumberGetValue

Get the value of a particular column of an AJAX SQL Row.

Synopsis

Prototype
AjBool ajSqlcolumnNumberGetValue (
      const AjPSqlrow sqlr,
      ajuint column,
      void** Pvalue,
      ajulong* Plength
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
void**PvalueModifyValue address
ajulong*PlengthModifyValue length address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Input & Output
Pvalue:(Modify)Value address
Plength:(Modify)Value length address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Get the value of a particular column of an AJAX SQL Row.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: column to datatype conversion functions

Functions for converting SQL Column values to other datatypes.

Functions: ajSqlcolumnNumberToBool ajSqlcolumnNumberToDouble ajSqlcolumnNumberToFloat ajSqlcolumnNumberToInt ajSqlcolumnNumberToLong ajSqlcolumnNumberToStr ajSqlcolumnNumberToTime ajSqlcolumnNumberToUint ajSqlcolumnNumberToUlong


Function ajSqlcolumnNumberToBool

Converts the value in a particular column of an AJAX SQL Row into an AJAX Boolean value.

This function uses ajStrToBool to convert the AJAX String representing the column value into an AJAX boolean value. The function converts 'yes' and 'true', as well as 'no' and 'false' into its corresponding AJAX Bool values. It also assumes any numeric value as true and 0 as false.

Synopsis

Prototype
AjBool ajSqlcolumnNumberToBool (
      const AjPSqlrow sqlr,
      ajuint column,
      AjBool* Pvalue
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
AjBool*PvalueOutputAJAX Boolean address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Output
Pvalue:(Output)AJAX Boolean address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in a particular column of an AJAX SQL Row into an AJAX Boolean value.

This function uses ajStrToBool to convert the AJAX String representing the column value into an AJAX boolean value. The function converts 'yes' and 'true', as well as 'no' and 'false' into its corresponding AJAX Bool values. It also assumes any numeric value as true and 0 as false.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnNumberToDouble

Converts the value in a particular column of an AJAX SQL Row into a C-type double value.

Synopsis

Prototype
AjBool ajSqlcolumnNumberToDouble (
      const AjPSqlrow sqlr,
      ajuint column,
      double* Pvalue
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
double*PvalueOutputC-type double address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Output
Pvalue:(Output)C-type double address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in a particular column of an AJAX SQL Row into a C-type double value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnNumberToFloat

Converts the value in a particular column of an AJAX SQL Row into a C-type float value.

Synopsis

Prototype
AjBool ajSqlcolumnNumberToFloat (
      const AjPSqlrow sqlr,
      ajuint column,
      float* Pvalue
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
float*PvalueOutputC-type float address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Output
Pvalue:(Output)C-type float address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in a particular column of an AJAX SQL Row into a C-type float value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnNumberToInt

Converts the value in a particular column of an AJAX SQL Row into an AJAX Integer value.

Synopsis

Prototype
AjBool ajSqlcolumnNumberToInt (
      const AjPSqlrow sqlr,
      ajuint column,
      ajint* Pvalue
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
ajint*PvalueOutputAJAX Integer address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Output
Pvalue:(Output)AJAX Integer address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in a particular column of an AJAX SQL Row into an AJAX Integer value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnNumberToLong

Converts the value in a particular column of an AJAX SQL Row into an AJAX Long Integer value.

Synopsis

Prototype
AjBool ajSqlcolumnNumberToLong (
      const AjPSqlrow sqlr,
      ajuint column,
      ajlong* Pvalue
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
ajlong*PvalueOutputAJAX Long Integer address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Output
Pvalue:(Output)AJAX Long Integer address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in a particular column of an AJAX SQL Row into an AJAX Long Integer value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnNumberToStr

Converts the value in a particular column of an AJAX SQL Row into an AJAX String value.

Synopsis

Prototype
AjBool ajSqlcolumnNumberToStr (
      const AjPSqlrow sqlr,
      ajuint column,
      AjPStr* Pvalue
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
AjPStr*PvalueOutputAJAX String address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Output
Pvalue:(Output)AJAX String address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in a particular column of an AJAX SQL Row into an AJAX String value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnNumberToTime

Converts the value in a particular column of an AJAX SQL Row into an AJAX Time value.

Synopsis

Prototype
AjBool ajSqlcolumnNumberToTime (
      const AjPSqlrow sqlr,
      ajuint column,
      AjPTime* Pvalue
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
AjPTime*PvalueOutputAJAX Time address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Output
Pvalue:(Output)AJAX Time address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in a particular column of an AJAX SQL Row into an AJAX Time value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnNumberToUint

Converts the value in a particular column of an AJAX SQL Row into an AJAX Unsigned Integer value.

Synopsis

Prototype
AjBool ajSqlcolumnNumberToUint (
      const AjPSqlrow sqlr,
      ajuint column,
      ajuint* Pvalue
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
ajuint*PvalueOutputAJAX Unsigned Integer address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Output
Pvalue:(Output)AJAX Unsigned Integer address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in a particular column of an AJAX SQL Row into an AJAX Unsigned Integer value.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajSqlcolumnNumberToUlong

Converts the value in a particular column of an AJAX SQL Row into an AJAX Unsigned Long Integer value.

Synopsis

Prototype
AjBool ajSqlcolumnNumberToUlong (
      const AjPSqlrow sqlr,
      ajuint column,
      ajulong* Pvalue
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
ajulong*PvalueOutputAJAX Unsigned Long Integer address
AjBool RETURNajTrue upon success, ajFalse otherwise

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Output
Pvalue:(Output)AJAX Unsigned Long Integer address
Returns
AjBool:ajTrue upon success, ajFalse otherwise

Description

Converts the value in a particular column of an AJAX SQL Row into an AJAX Unsigned Long Integer value.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: tests

Functions: ajSqlcolumnNumberIsDefined


Function ajSqlcolumnNumberIsDefined

Test if the value in a particular column of an AJAX SQL Row is defined.

Synopsis

Prototype
AjBool ajSqlcolumnNumberIsDefined (
      const AjPSqlrow sqlr,
      ajuint column
);

TypeNameRead/WriteDescription
const AjPSqlrowsqlrInputAJAX SQL Row
ajuintcolumnInputColumn number
AjBool RETURNajTrue if the value is defined, ajFalse if the value is undefined (\N)

Input
sqlr:(Input)AJAX SQL Row
column:(Input)Column number
Returns
AjBool:ajTrue if the value is defined, ajFalse if the value is undefined (\N)

Description

Test if the value in a particular column of an AJAX SQL Row is defined.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPVoid

Void pointer

Sections: constructors destructors Cast modifiers


Section: constructors

Functions: ajVoidNew ajVoidNewRes


Function ajVoidNew

Default constructor for empty AJAX Void Pointer Arrays.

Synopsis

Prototype
AjPVoid ajVoidNew (
      void
);

TypeNameRead/WriteDescription
AjPVoid RETURNPointer to an empty Pointer Array structure

Returns
AjPVoid:Pointer to an empty Pointer Array structure

Description

Default constructor for empty AJAX Void Pointer Arrays.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajVoidNewRes

Constructor given an initial reserved size.

Synopsis

Prototype
AjPVoid ajVoidNewRes (
      ajuint size
);

TypeNameRead/WriteDescription
ajuintsizeInputReserved size
AjPVoid RETURNPointer to an empty Pointer Array struct of specified size

Input
size:(Input)Reserved size
Returns
AjPVoid:Pointer to an empty Pointer Array struct of specified size

Description

Constructor given an initial reserved size.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: destructors

Functions for destruction of void pointer arrays.

Functions: ajVoidDel


Function ajVoidDel

Default destructor for AJAX Pointer arrays.

If the given array is a NULL pointer, simply returns.

Synopsis

Prototype
void ajVoidDel (
      AjPVoid* thys
);

TypeNameRead/WriteDescription
AjPVoid*thysDeletePointer to the Pointer Array to be deleted. The pointer is always deleted.
void RETURN

Output
thys:(Delete)Pointer to the Pointer Array to be deleted. The pointer is always deleted.
Returns
void:No return value

Description

Default destructor for AJAX Pointer arrays.

If the given array is a NULL pointer, simply returns.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Cast

Functions for returning elements of an AJAX SQL Connection object.

Functions: ajVoidGet ajVoidLen


Function ajVoidGet

Retrieve an element from an AJAX Pointer Array.

If the given array is a NULL pointer, simply returns.

Synopsis

Prototype
void* ajVoidGet (
      const AjPVoid thys,
      ajuint elem
);

TypeNameRead/WriteDescription
const AjPVoidthysInputPointer to the Pointer array
ajuintelemInputarray element
void* RETURNcontents of array element

Input
thys:(Input)Pointer to the Pointer array
elem:(Input)array element
Returns
void*:contents of array element

Description

Retrieve an element from an AJAX Pointer Array.

If the given array is a NULL pointer, simply returns.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajVoidLen

Get length of dynamic 1d AJAX Pointer Array.

Synopsis

Prototype
ajuint ajVoidLen (
      const AjPVoid thys
);

TypeNameRead/WriteDescription
const AjPVoidthysInputAJAX Pointer Array
ajuint RETURNlength

Input
thys:(Input)AJAX Pointer Array
Returns
ajuint:length

Description

Get length of dynamic 1d AJAX Pointer Array.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: modifiers

Functions: ajVoidPut


Function ajVoidPut

Load a void pointer array element.

If the given array is a NULL pointer an error is generated. If the array is of insufficient size then the array is extended. Negative indices generate an error.

Synopsis

Prototype
AjBool ajVoidPut (
      AjPVoid* thys,
      ajuint elem,
      void* v
);

TypeNameRead/WriteDescription
AjPVoid*thysOutputPointer to the void pointer array
ajuintelemInputarray element
void*vInputvalue to load
AjBool RETURNtrue if the array was extended

Input
elem:(Input)array element
v:(Input)value to load
Output
thys:(Output)Pointer to the void pointer array
Returns
AjBool:true if the array was extended

Description

Load a void pointer array element.

If the given array is a NULL pointer an error is generated. If the array is of insufficient size then the array is extended. Negative indices generate an error.

See Also

See other functions in this section

Availability

In release 6.4.0