static STATUS qrdefcolret( QRIOB * qriob, i4 i, bool * flushed, bool firstcol ) { /* init dbv with column attributes */ qriob->dbv.db_length = qriob->qrb->rd->RD_DBVS_MACRO(i).db_length; qriob->dbv.db_datatype = qriob->qrb->rd->RD_DBVS_MACRO(i).db_datatype; qriob->dbv.db_prec = qriob->qrb->rd->RD_DBVS_MACRO(i).db_prec; /* pick up fixed length column value */ IIretdom( 1, DB_DBV_TYPE, 0, &(qriob->dbv) ); if (IIerrtest() != 0) return( FAIL ); /* error, fake end-data to caller */ printatt( qriob->qrb, &(qriob->dbv), firstcol ); *flushed = FALSE; return( OK ); }
STATUS qrrowdesc( QRB * qrb ) { IIretinit( (char *)0, 0 ); if ( IIerrtest() != 0 ) return ( FAIL ); IItm_retdesc( &qrb->rd ); return( OK ); }
/* ** IIerrtest ** - Generated as test in retrieve loop */ i4 IIERRTEST() { return IIerrtest(); }
static VOID qrubdhdlr( QRIOB * qriob ) { i4 seglen = 0; i4 data_end = 0; i4 count = 0; /* check for NULL data somewhere here and take appropriate action if ** found (will data_end be 1 in this case?) */ if ( qriob->qrb->tm ) { qrputc( qriob->qrb, DRCH_V ); /* begin with a | */ while ( data_end != 1 ) /* get and put to user 2k or less segs */ { qriob->dbv.db_length = QR_DRBSZ; IILQlgd_LoGetData((i4)(II_DATLEN|II_DATSEG), DB_DBV_TYPE, QR_DRBSZ, &(qriob->dbv), QR_DRBSZ, &seglen, &data_end ); if (IIerrtest() != 0) { IILQled_LoEndData(); return; } count++; /* blob col names are formatted into GL_MAXNAME size boxes. /* if entire blob is shorter than column header size, set ** db_length to column header size (GL_MAXNAME) so that printatt ** will blank pad correctly. */ if (count == 1 && data_end == 1 && seglen < qriob->qrb->col_maxname) qriob->dbv.db_length = qriob->qrb->col_maxname; else qriob->dbv.db_length = seglen; printatt( qriob->qrb, &(qriob->dbv), TRUE ); (*(qriob->qrb->putfunc))(qriob->qrb); } } else /* don't output the blobs, this is not 'tm'. token only. */ { /* don't need to go through printatt in this case, ** no translation or conversion is necessary */ IILQled_LoEndData(); /* first time through, retrieve the token from er file */ if ( blob_token == NULL ) blob_token = ERget(F_QR011E_Unbounded_data); qrputc(qriob->qrb, DRCH_V); qradd(qriob->qrb, blob_token, seglen = STlength( blob_token )); /* blob col names are formatted into ** DB_MAXNAME size boxes. the token ** must be padded or truncated to fit. ** data_end is not mnemonic here!! */ for( data_end = ( qriob->qrb->col_maxname - seglen ); data_end > 0; data_end -- ) qrputc(qriob->qrb, ' '); } return; }
i4 IIperrtest(void) { return IIerrtest(); }