OCIParam *mypard;
ub4 counter;
ub2 dtype,deptlen;
text *col_name;
ub4 col_name_len;
sb4 parm_status;
/* Request a parameter descriptor for position 1 in the select-list */
counter = 1;
parm_status = OCIParamGet(stmthp, OCI_HTYPE_STMT, errhp, (dvoid **)&mypard,
counter);
/* Loop only if a descriptor was successfully retrieved for
current position, starting at 1 */
while (parm_status==OCI_SUCCESS) {
/* Retrieve the data type attribute */
error_proc(errhp, OCIAttrGet((dvoid*) mypard, (ub4) OCI_DTYPE_PARAM,
(dvoid*) &dtype,(ub4 *) 0, (ub4) OCI_ATTR_DATA_TYPE,
(OCIError *) errhp ));
/* Retrieve the column name attribute */
error_proc(errhp, OCIAttrGet((dvoid*) mypard, (ub4) OCI_DTYPE_PARAM,
(dvoid**) &col_name,(ub4 *) &col_name_len, (ub4) OCI_ATTR_NAME,
(OCIError *) errhp ));
/* Retrieve the column data size */
error_proc(errhp, OCIAttrGet((dvoid*) mypard, (ub4) OCI_DTYPE_PARAM,
(dvoid*) &deptlen, (ub4 *) 0, (ub4) OCI_ATTR_DATA_SIZE,
(OCIError *) errhp ));
printf("column=%s datatype=%d datasez=%d/n/n", col_name, dtype,deptlen);
fflush(stdout);
/* increment counter and get next descriptor, if there is one */
counter++;
parm_status = OCIParamGet(stmthp, OCI_HTYPE_STMT, errhp, (dvoid **)&mypard, counter);
}