WebSiphon 2 Guide: ODBC Functions
contents prev next

Communicate with ODBC database servers using the ODBCLib library of functions. For further information on using these accessors see the WebSiphon Enterprise documentation.

odbcAddRecord
odbcConnect
odbcCountFields
odbcCountMatching
odbcCountRecords
odbcDisconnect
odbcGetFieldInfo
odbcGetFields
odbcGetTables
odbcRemove
odbcRetrieve
odbcUpdate
odbcAddRecord( odbc-link, db-table, field-values [, return-fields ])
Returns: null or list Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name
db-table name of database table
field-values list of field/value pairs
[return-fields] list of column references to return [optional]

When given a valid odbc-link, adds a new row to the db-table record set. The field-values parameter may be used to set the field values of the new record, rather than using an additional function call. To retrieve default field values set by the DBMS specify column references in the optional return-fields parameter.

See Also:

odbcConnect( database, db-user [, db-pass, connection-alias, pool-count ])
Returns: integer or list Location: ODBCLib
Parameter Description
database name of a configured ODBC database connection
db-user DBMS account username
[db-pass] DBMS account password [optional]
[connection-alias] connection reference alias name [optional]
[pool-count] number of round-robin connections in pool[optional]

Opens a connection to a database. The opened connection can be used by reference in other calls simply by passing the connection information. You must always close connections you open with a call to odbcDisconnect() with the name of the connection/pool. If there are pending calls to odbcRetrieve(), this function will fail.

See Also:

odbcCountFields( odbc-link, db-table )
Returns: integer Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name
db-table name of the database table

Counts the number of defined fields in table and returns the count as an integer.

See Also:

odbcCountMatching( odbc-link, db-table [, query-list ])
Returns: integer Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name
db-table name of the database table
[query-list] structured search criterea as a query list [optional]

Returns the total number of records in db-table that match the query specified using query-list. This function is helpful when used in conjunction with the start-with and max-hits parameters in odbcRetrieve() allowing you to retrieve matching records in smaller chunks.

See Also:

odbcCountRecords( odbc-link, db-table )
Returns: integer Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name
db-table name of the database table

Returns the total number of records in table. Use odbcCountMatching() to find the number of records in one or more tables that match a certain criteria.

odbcDisconnect( odbc-link )
Returns: integer Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name

Closes all links to the specified ODBC database connection. Any pending operations will cause this function to fail.

See Also:

odbcGetFieldInfo( odbc-link , db-table, column-reference )
Returns: list Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name
db-table name of database table
field-reference name or numerical index of column in table

Returns a structured list describing the column-reference field contained in db-table.

See Also:

odbcGetFields( odbc-link , db-table )
Returns: list Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name
db-table name of database table

Returns a list of structured lists describing all columns contained in db-table.

See Also:

odbcGetTables( odbc-link )
Returns: list Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name

Returns a list of tables available from the specific connection. This list will reflect the tables available from the database specified in the ODBC Setup control panel.

odbcRemove( odbc-link, db-table [, query-list ])
Returns: integer Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name
db-table name of the database table
[query-list] structured search criterea as a query list [optional]

Permanently deletes all records in db-table that match the query specified using query-list. If no query-list is provided, this function will delete all records in the entire database table!

Warning: This operation is not reversable! Take care in your code to check that a null value is not passed to query-list in error.

odbcRetrieve( odbc-link, db-table [, query-list, return-fields, sort-by, start-with, max-hits ])
Returns: list Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name
db-table name of the database table
[query-list] structured search criterea as a query list [optional]
[return-fields] list of column references to return [optional]
[sort-by] list of sort-by column references [optional]
[start-with] start with hit number [optional]
[max-hits] maximum rows to return in list [optional]

Returns record data in db-table that matches the query specified using query-list.

See Also:

odbcUpdate( odbc-link, db-table, field-values [, query-list ])
Returns: null or list Location: ODBCLib
Parameter Description
odbc-link ODBC server connection reference or alias name
db-table name of database table
field-values list of field/value pairs
[query-list] structured search criterea as a query list [optional]

Used to change one or more values, query-list, of one or more records of the specified table.

See Also:

contents prev next

Copyright (c)1996-2003 Purity Software