Subject | paramdsc use in udfs |
---|---|
Author | Jonathan M. Freedman |
Post date | 2002-10-10T00:03:11Z |
I am seeking more information on this struct in order to use it in UDFs. It
is from ibase.h.
/********************************************************************/
/* CVC: Public descriptor interface held in dsc.h. */
/* We need it documented to be able to recognize NULL in UDFs. */
/* Being its original name "dsc", I renamed it paramdsc here. */
/* Notice that I adjust to the original definition: contrary to */
/* other cases, the typedef is the same struct not the pointer. */
/* I included the enumeration of dsc_dtype possible values. */
/* Ultimately, dsc.h should be part of the public interface. */
/********************************************************************/
#if !defined(_JRD_DSC_H_)
/* This is the famous internal descriptor that UDFs can use, too. */
typedef struct paramdsc {
unsigned char dsc_dtype;
signed char dsc_scale;
ISC_USHORT dsc_length;
short dsc_sub_type;
ISC_USHORT dsc_flags;
unsigned char *dsc_address;
} PARAMDSC;
These are defines for dsc_flags
/* values for dsc_flags */
/* Note: DSC_null is only reliably set for local variables
(blr_variable) */
#define DSC_null 1
#define DSC_no_subtype 2 /* dsc has no sub type specified */
#define DSC_nullable 4 /* not stored. instead, is derived
from metadata primarily to flag
SQLDA (in DSQL) */
These are defines for dsc_sub_type
/* Overload text typing information into the dsc_sub_type field.
See intl.h for definitions of text types */
#ifndef dsc_ttype
#define dsc_ttype dsc_sub_type
#endif
I can't find intl.h, so it is not a big help.
This define is for the dsc_dtype
* Note that dtype_null actually means that we do not yet know the
dtype for this descriptor. A nice cleanup item would be to globally
change it to dtype_unknown. --chrisj 1999-02-17 */
#define dtype_null 0
#define dtype_text 1
#define dtype_cstring 2
#define dtype_varying 3
#define dtype_packed 6
#define dtype_byte 7
#define dtype_short 8
#define dtype_long 9
#define dtype_quad 10
#define dtype_real 11
#define dtype_double 12
#define dtype_d_float 13
#define dtype_sql_date 14
#define dtype_sql_time 15
#define dtype_timestamp 16
#define dtype_blob 17
#define dtype_array 18
#define dtype_int64 19
#define DTYPE_TYPE_MAX 20
#endif /* !defined(_JRD_DSC_H_) */
signed char dsc_scale probably refers to the number of decimal places,
please inform me if i am wrong.
ISC_USHORT dsc_length probably refers to the length of the non-fractional
component
unsigned char* dsc_address probably points to a char array with the numbers
in it
i am going to spend the next several hours trying to dump this struct into a
file thru a dll to determine what exactly is going on...i'll print my
results in a followup...however, i'm sure others have done this before me
and can refer me to documentation that explains the use of this struct
further in udf development
TIA, sorry for the length of this, but it may be a resource for others in
the future..
is from ibase.h.
/********************************************************************/
/* CVC: Public descriptor interface held in dsc.h. */
/* We need it documented to be able to recognize NULL in UDFs. */
/* Being its original name "dsc", I renamed it paramdsc here. */
/* Notice that I adjust to the original definition: contrary to */
/* other cases, the typedef is the same struct not the pointer. */
/* I included the enumeration of dsc_dtype possible values. */
/* Ultimately, dsc.h should be part of the public interface. */
/********************************************************************/
#if !defined(_JRD_DSC_H_)
/* This is the famous internal descriptor that UDFs can use, too. */
typedef struct paramdsc {
unsigned char dsc_dtype;
signed char dsc_scale;
ISC_USHORT dsc_length;
short dsc_sub_type;
ISC_USHORT dsc_flags;
unsigned char *dsc_address;
} PARAMDSC;
These are defines for dsc_flags
/* values for dsc_flags */
/* Note: DSC_null is only reliably set for local variables
(blr_variable) */
#define DSC_null 1
#define DSC_no_subtype 2 /* dsc has no sub type specified */
#define DSC_nullable 4 /* not stored. instead, is derived
from metadata primarily to flag
SQLDA (in DSQL) */
These are defines for dsc_sub_type
/* Overload text typing information into the dsc_sub_type field.
See intl.h for definitions of text types */
#ifndef dsc_ttype
#define dsc_ttype dsc_sub_type
#endif
I can't find intl.h, so it is not a big help.
This define is for the dsc_dtype
* Note that dtype_null actually means that we do not yet know the
dtype for this descriptor. A nice cleanup item would be to globally
change it to dtype_unknown. --chrisj 1999-02-17 */
#define dtype_null 0
#define dtype_text 1
#define dtype_cstring 2
#define dtype_varying 3
#define dtype_packed 6
#define dtype_byte 7
#define dtype_short 8
#define dtype_long 9
#define dtype_quad 10
#define dtype_real 11
#define dtype_double 12
#define dtype_d_float 13
#define dtype_sql_date 14
#define dtype_sql_time 15
#define dtype_timestamp 16
#define dtype_blob 17
#define dtype_array 18
#define dtype_int64 19
#define DTYPE_TYPE_MAX 20
#endif /* !defined(_JRD_DSC_H_) */
signed char dsc_scale probably refers to the number of decimal places,
please inform me if i am wrong.
ISC_USHORT dsc_length probably refers to the length of the non-fractional
component
unsigned char* dsc_address probably points to a char array with the numbers
in it
i am going to spend the next several hours trying to dump this struct into a
file thru a dll to determine what exactly is going on...i'll print my
results in a followup...however, i'm sure others have done this before me
and can refer me to documentation that explains the use of this struct
further in udf development
TIA, sorry for the length of this, but it may be a resource for others in
the future..