Difference between revisions of "OpenDBX/C API/odbx column name"

From Linuxnetworks
< OpenDBX‎ | C API
Jump to: navigation, search
(header)
(enhanced article)
Line 9: Line 9:
 
= Description: =
 
= Description: =
  
Returns the name of the column specified by "pos" in the current result set returned by [[OpenDBX_result|odbx_result()]]. The value of "pos" must be in the range from 0 to [[OpenDBX_column_count|odbx_column_count()]]-1.
+
'''odbx_column_name()''' returns the name of the column specified by '''pos''' in the current result set returned by [[OpenDBX result|odbx_result()]]. The column names will not change within the result set with the exception described in [[OpenDBX column_count|odbx_column_count()]].
  
= Parameters: =
+
The '''result''' parameter required by this function must be a valid result set returned by [[OpenDBX result|odbx_result()]] and must not have been feed to [[OpenDBX result_free|odbx_result_free()]] before.
  
* result: Pointer to object created by [[OpenDBX_result|odbx_result()]]
+
Valid column indices for the requested column provided by '''pos''' start with zero and end with the value returned by [[OpenDBX column_count|odbx_column_count()]] minus one.
* pos: Column number within the current result set
+
  
= Return values: =
+
= Return values =
  
* Name of the column on success
+
The return value of '''odbx_column_name()''' is a pointer to a zero terminated string which consists of the name of the requested column. This pointer is allocated by the database client library and must not be freed by the application. The content of the string will be overwritten by the next call to '''odbx_column_name()'''.
* NULL if handle is invalid or pos is out of range
+
  
= Errors: =
+
= Errors =
  
* None
+
Errors can occur if the given '''result''' parameter is NULL or invalid or if the value of '''pos''' is out of range, i.e. more than [[OpenDBX column_count|odbx_column_count()]] minus one.
  
= See also: =
+
= See also =
  
* [[OpenDBX_column_count]]
+
* [[OpenDBX column_count|odbx_column_count()]]
* [[OpenDBX_column_type]]
+
* [[OpenDBX column_type|odbx_column_type()]]
  
  
 
----
 
----
 
Back to [[OpenDBX API|Overview]]
 
Back to [[OpenDBX API|Overview]]

Revision as of 21:46, 24 April 2007


#include <odbx.h>

char* odbx_column_name(
   odbx_result_t* result,
   unsigned long pos )

Description:

odbx_column_name() returns the name of the column specified by pos in the current result set returned by odbx_result(). The column names will not change within the result set with the exception described in odbx_column_count().

The result parameter required by this function must be a valid result set returned by odbx_result() and must not have been feed to odbx_result_free() before.

Valid column indices for the requested column provided by pos start with zero and end with the value returned by odbx_column_count() minus one.

Return values

The return value of odbx_column_name() is a pointer to a zero terminated string which consists of the name of the requested column. This pointer is allocated by the database client library and must not be freed by the application. The content of the string will be overwritten by the next call to odbx_column_name().

Errors

Errors can occur if the given result parameter is NULL or invalid or if the value of pos is out of range, i.e. more than odbx_column_count() minus one.

See also



Back to Overview