ajsql.c
Datatypes: none AjPSqlconnection AjESqlconnectionClient AjPSqlstatement AjISqlrow AjPSqlrow AjPVoid
Internals
Sections: initialization exiting
Functions: ajSqlInit
Initialises implementation-specific SQL client libraries.
Synopsis
Prototype
AjBool ajSqlInit (
void
);
Type | Name | Read/Write | Description |
AjBool | | RETURN | ajTrue 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
Functions: ajSqlExit
Finalises implementation-specific SQL client libraries.
Synopsis
Prototype
void ajSqlExit (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Finalises implementation-specific SQL client libraries.
See Also
See other functions in this section
Availability
In release 6.4.0
SQL Connection
Sections: constructors destructors Cast debugging
Functions for constructing AJAX SQL Connection objects.
Functions: ajSqlconnectionNewData ajSqlconnectionNewRef
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
);
Type | Name | Read/Write | Description |
AjESqlconnectionClient | client | Modify | SQL client |
const AjPStr | user | Input | SQL account user name |
const AjPStr | password | Input | SQL account password |
const AjPStr | host | Input | SQL server hostname or IP address |
const AjPStr | port | Input | SQL server port number |
const AjPStr | 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 |
const AjPStr | database | Input | SQL database name |
AjPSqlconnection | | RETURN | AJAX 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
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
);
Type | Name | Read/Write | Description |
AjPSqlconnection | sqlc | Modify | AJAX SQL Connection |
AjPSqlconnection | | RETURN | AJAX 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
Functions for destruction of AJAX SQL Connection objects.
Functions: 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
);
Type | Name | Read/Write | Description |
AjPSqlconnection* | Psqlc | Delete | AJAX SQL Connection address |
void | | RETURN | |
Output
Psqlc: | (Delete) | AJAX SQL Connection address |
Returns
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
Functions for returning elements of an AJAX SQL Connection object.
Functions: ajSqlconnectionEscapeC ajSqlconnectionEscapeS ajSqlconnectionGetClient ajSqlconnectionGetUse
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
);
Type | Name | Read/Write | Description |
const AjPSqlconnection | sqlc | Input | AJAX SQL Connection |
char** | Ptxt | Output | Address of the (new) SQL-escaped C-type string |
const AjPStr | str | Input | AJAX String to be escaped |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
const AjPSqlconnection | sqlc | Input | AJAX SQL Connection |
AjPStr* | Pstr | Output | Address of the (new) SQL-escaped AJAX String |
const AjPStr | str | Input | AJAX String to be escaped |
AjBool | | RETURN | ajTrue 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
Get the client element of an AJAX SQL Connection.
Synopsis
Prototype
AjESqlconnectionClient ajSqlconnectionGetClient (
const AjPSqlconnection sqlc
);
Type | Name | Read/Write | Description |
const AjPSqlconnection | sqlc | Input | AJAX SQL Connection |
AjESqlconnectionClient | | RETURN | AJAX 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
Get the use counter element of an AJAX SQL Connection.
Synopsis
Prototype
ajuint ajSqlconnectionGetUse (
const AjPSqlconnection sqlc
);
Type | Name | Read/Write | Description |
const AjPSqlconnection | sqlc | Input | AJAX SQL Connection |
ajuint | | RETURN | Use counter |
Input
sqlc: | (Input) | AJAX SQL Connection |
Returns
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
Functions for reporting of an AJAX SQL Connection object.
Functions: ajSqlconnectionTrace
Trace an AJAX SQL Connection.
Synopsis
Prototype
AjBool ajSqlconnectionTrace (
const AjPSqlconnection sqlc,
ajuint level
);
Type | Name | Read/Write | Description |
const AjPSqlconnection | sqlc | Input | AJAX SQL Connection |
ajuint | level | Input | Indentation level |
AjBool | | RETURN | ajTrue 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
SQL Connection Client
Sections: Misc Cast
Functions for returning a AJAX SQL Connection Client enumeration
Functions: ajSqlconnectionClientFromStr
Convert an AJAX String into an AJAX SQL Connection client element.
Synopsis
Prototype
AjESqlconnectionClient ajSqlconnectionClientFromStr (
const AjPStr client
);
Type | Name | Read/Write | Description |
const AjPStr | client | Input | Client string |
AjESqlconnectionClient | | RETURN | AJAX 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
Functions for returning attributes of an AJAX SQL Connection client
enumeration
Functions: ajSqlconnectionClientToChar
Convert an AJAX SQL Connection client element into a C-type (char*) string.
Synopsis
Prototype
const char* ajSqlconnectionClientToChar (
AjESqlconnectionClient client
);
Type | Name | Read/Write | Description |
AjESqlconnectionClient | client | Modify | SQL Connection client |
const char* | | RETURN | SQL 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
AJAX SQL Statement
Sections: constructors destructors cast
Functions for constructing AJAX SQL Statement objects.
Functions: ajSqlstatementNewRef ajSqlstatementNewRun
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
);
Type | Name | Read/Write | Description |
AjPSqlstatement | sqls | Modify | AJAX SQL Statement |
AjPSqlstatement | | RETURN | AJAX 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
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
);
Type | Name | Read/Write | Description |
AjPSqlconnection | sqlc | Modify | AJAX SQL Connection |
const AjPStr | statement | Input | SQL statement |
AjPSqlstatement | | RETURN | AJAX 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
Functions for destruction of AJAX SQL Statement objects.
Functions: ajSqlstatementDel
Default AJAX SQL Statement destructor, which also destroys the SQL client
library-specific result object.
Synopsis
Prototype
void ajSqlstatementDel (
AjPSqlstatement* Psqls
);
Type | Name | Read/Write | Description |
AjPSqlstatement* | Psqls | Delete | AJAX SQL Statement address |
void | | RETURN | |
Output
Psqls: | (Delete) | AJAX SQL Statement address |
Returns
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
Functions: ajSqlstatementGetAffectedrows ajSqlstatementGetColumns ajSqlstatementGetIdentifier ajSqlstatementGetSelectedrows
Get the number of rows affected by a non-SELECT SQL statement.
Synopsis
Prototype
ajulong ajSqlstatementGetAffectedrows (
const AjPSqlstatement sqls
);
Type | Name | Read/Write | Description |
const AjPSqlstatement | sqls | Input | AJAX SQL Statement |
ajulong | | RETURN | Number 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
Get the number of columns returned by a SELECT-like SQL statement.
Synopsis
Prototype
ajuint ajSqlstatementGetColumns (
const AjPSqlstatement sqls
);
Type | Name | Read/Write | Description |
const AjPSqlstatement | sqls | Input | AJAX SQL Statement |
ajuint | | RETURN | Number 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
Get the identifier of a row inserted by the last INSERT-like SQL statement.
Synopsis
Prototype
ajuint ajSqlstatementGetIdentifier (
const AjPSqlstatement sqls
);
Type | Name | Read/Write | Description |
const AjPSqlstatement | sqls | Input | AJAX SQL Statement |
ajuint | | RETURN | Identifier 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
Get the number of rows selected by a SELECT-like SQL statement.
Synopsis
Prototype
ajulong ajSqlstatementGetSelectedrows (
const AjPSqlstatement sqls
);
Type | Name | Read/Write | Description |
const AjPSqlstatement | sqls | Input | AJAX SQL Statement |
ajulong | | RETURN | Number 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
AJAX SQL Row Iterator
Sections: constructors destructors tests stepping modifiers
Functions for constructing AJAX SQL Row Iterator objects.
Functions: ajSqlrowiterNew
Default AJAX SQL Row Iterator constructor.
Synopsis
Prototype
AjISqlrow ajSqlrowiterNew (
AjPSqlstatement sqls
);
Type | Name | Read/Write | Description |
AjPSqlstatement | sqls | Modify | AJAX SQL Statement |
AjISqlrow | | RETURN | AJAX 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
Functions for destruction of AJAX SQL Row Iterator objects.
Functions: ajSqlrowiterDel
Default AJAX SQL Row Iterator destructor.
Synopsis
Prototype
void ajSqlrowiterDel (
AjISqlrow* Psqli
);
Type | Name | Read/Write | Description |
AjISqlrow* | Psqli | Delete | AJAX SQL Row Iterator address |
void | | RETURN | |
Output
Psqli: | (Delete) | AJAX SQL Row Iterator address |
Returns
Description
Default AJAX SQL Row Iterator destructor.
See Also
See other functions in this section
Availability
In release 6.4.0
Functions: ajSqlrowiterDone
Tests whether an AJAX SQL Row Iterator has completed yet.
Synopsis
Prototype
AjBool ajSqlrowiterDone (
const AjISqlrow sqli
);
Type | Name | Read/Write | Description |
const AjISqlrow | sqli | Input | AJAX SQL Row Iterator |
AjBool | | RETURN | ajTrue 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
Functions: ajSqlrowiterGet
Returns the next AJAX SQL Row using the iterator, or steps off the end.
Synopsis
Prototype
AjPSqlrow ajSqlrowiterGet (
AjISqlrow sqli
);
Type | Name | Read/Write | Description |
AjISqlrow | sqli | Modify | AJAX SQL Row Iterator |
AjPSqlrow | | RETURN | AJAX 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
Functions: ajSqlrowiterRewind
Rewind an AJAX SQL Row Iterator to the start position.
Synopsis
Prototype
AjBool ajSqlrowiterRewind (
AjISqlrow sqli
);
Type | Name | Read/Write | Description |
AjISqlrow | sqli | Modify | AJAX SQL Row Iterator |
AjBool | | RETURN | ajTrue 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
AJAX SQL Row
Sections: constructors destructors element retrieval
Functions for constructing AJAX SQL Row objects.
Functions: ajSqlrowNew
Default AJAX SQL Row constructor.
Synopsis
Prototype
AjPSqlrow ajSqlrowNew (
ajuint columns
);
Type | Name | Read/Write | Description |
ajuint | columns | Input | Number of columns per AJAX SQL Row |
AjPSqlrow | | RETURN | AJAX SQL Row |
Input
columns: | (Input) | Number of columns per AJAX SQL Row |
Returns
Description
Default AJAX SQL Row constructor.
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for destruction of AJAX SQL Row objects.
Functions: ajSqlrowDel
Default AJAX SQL Row destructor.
Synopsis
Prototype
void ajSqlrowDel (
AjPSqlrow* Psqlr
);
Type | Name | Read/Write | Description |
AjPSqlrow* | Psqlr | Delete | AJAX SQL Row address |
void | | RETURN | |
Output
Psqlr: | (Delete) | AJAX SQL Row address |
Returns
Description
Default AJAX SQL Row destructor.
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for returning elements of an AJAX SQL Row object.
Functions: ajSqlrowGetColumns ajSqlrowGetCurrent ajSqlrowGetLengths ajSqlrowGetValues
Get the number of columns in an AJAX SQL Row.
Synopsis
Prototype
ajuint ajSqlrowGetColumns (
const AjPSqlrow sqlr
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | | RETURN | Number of columns in an AJAX SQL Row |
Input
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
Get the number of the current column in column iterations of an
AJAX SQL Row.
Synopsis
Prototype
ajuint ajSqlrowGetCurrent (
const AjPSqlrow sqlr
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | | RETURN | Number of current column of an AJAX SQL Row |
Input
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
Get the AJAX Long Integer Array of column value lengths in an AJAX SQL Row.
Synopsis
Prototype
AjPLong ajSqlrowGetLengths (
const AjPSqlrow sqlr
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
AjPLong | | RETURN | AJAX Long Integer Array |
Input
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
Get the AJAX Void Pointer Array of column values in an AJAX SQL Row.
Synopsis
Prototype
AjPVoid ajSqlrowGetValues (
const AjPSqlrow sqlr
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
AjPVoid | | RETURN | AJAX Void Pointer Array |
Input
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
Functions: ajSqlcolumnRewind
Rewind an AJAX SQL Column Iterator to the start position.
Synopsis
Prototype
AjBool ajSqlcolumnRewind (
AjPSqlrow sqlr
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
AjBool | | RETURN | ajTrue 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
Functions: 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
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
void** | Pvalue | Modify | Value address |
ajulong* | Plength | Modify | Value length address |
AjBool | | RETURN | ajTrue 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
Functions for converting SQL Column values to other datatypes.
Functions: ajSqlcolumnToBool ajSqlcolumnToDouble ajSqlcolumnToFloat ajSqlcolumnToInt ajSqlcolumnToLong ajSqlcolumnToStr ajSqlcolumnToTime ajSqlcolumnToUint ajSqlcolumnToUlong
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
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
AjBool* | Pvalue | Output | AJAX Boolean address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
double* | Pvalue | Output | C-type double address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
float* | Pvalue | Output | C-type float address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
ajint* | Pvalue | Output | AJAX Integer address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
ajlong* | Pvalue | Output | AJAX Long Integer address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
AjPStr* | Pvalue | Output | AJAX String address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
AjPTime* | Pvalue | Output | AJAX Time address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
ajuint* | Pvalue | Output | AJAX Unsigned Integer address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
AjPSqlrow | sqlr | Modify | AJAX SQL Row |
ajulong* | Pvalue | Output | AJAX Unsigned Long Integer address |
AjBool | | RETURN | ajTrue 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
Functions: 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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
void** | Pvalue | Modify | Value address |
ajulong* | Plength | Modify | Value length address |
AjBool | | RETURN | ajTrue 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
Functions for converting SQL Column values to other datatypes.
Functions: ajSqlcolumnNumberToBool ajSqlcolumnNumberToDouble ajSqlcolumnNumberToFloat ajSqlcolumnNumberToInt ajSqlcolumnNumberToLong ajSqlcolumnNumberToStr ajSqlcolumnNumberToTime ajSqlcolumnNumberToUint ajSqlcolumnNumberToUlong
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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
AjBool* | Pvalue | Output | AJAX Boolean address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
double* | Pvalue | Output | C-type double address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
float* | Pvalue | Output | C-type float address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
ajint* | Pvalue | Output | AJAX Integer address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
ajlong* | Pvalue | Output | AJAX Long Integer address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
AjPStr* | Pvalue | Output | AJAX String address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
AjPTime* | Pvalue | Output | AJAX Time address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
ajuint* | Pvalue | Output | AJAX Unsigned Integer address |
AjBool | | RETURN | ajTrue 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
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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
ajulong* | Pvalue | Output | AJAX Unsigned Long Integer address |
AjBool | | RETURN | ajTrue 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
Functions: 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
);
Type | Name | Read/Write | Description |
const AjPSqlrow | sqlr | Input | AJAX SQL Row |
ajuint | column | Input | Column number |
AjBool | | RETURN | ajTrue 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
Void pointer
Sections: constructors destructors Cast modifiers
Functions: ajVoidNew ajVoidNewRes
Default constructor for empty AJAX Void Pointer Arrays.
Synopsis
Prototype
AjPVoid ajVoidNew (
void
);
Type | Name | Read/Write | Description |
AjPVoid | | RETURN | Pointer 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
Constructor given an initial reserved size.
Synopsis
Prototype
AjPVoid ajVoidNewRes (
ajuint size
);
Type | Name | Read/Write | Description |
ajuint | size | Input | Reserved size |
AjPVoid | | RETURN | Pointer 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
Functions for destruction of void pointer arrays.
Functions: ajVoidDel
Default destructor for AJAX Pointer arrays.
If the given array is a NULL pointer, simply returns.
Synopsis
Prototype
void ajVoidDel (
AjPVoid* thys
);
Type | Name | Read/Write | Description |
AjPVoid* | thys | Delete | Pointer 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
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
Functions for returning elements of an AJAX SQL Connection object.
Functions: ajVoidGet ajVoidLen
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
);
Type | Name | Read/Write | Description |
const AjPVoid | thys | Input | Pointer to the Pointer array |
ajuint | elem | Input | array element |
void* | | RETURN | contents 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
Get length of dynamic 1d AJAX Pointer Array.
Synopsis
Prototype
ajuint ajVoidLen (
const AjPVoid thys
);
Type | Name | Read/Write | Description |
const AjPVoid | thys | Input | AJAX Pointer Array |
ajuint | | RETURN | length |
Input
thys: | (Input) | AJAX Pointer Array |
Returns
Description
Get length of dynamic 1d AJAX Pointer Array.
See Also
See other functions in this section
Availability
In release 6.4.0
Functions: 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
);
Type | Name | Read/Write | Description |
AjPVoid* | thys | Output | Pointer to the void pointer array |
ajuint | elem | Input | array element |
void* | v | Input | value to load |
AjBool | | RETURN | true 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