Re: How to get UDT via EXEC SQL GET DESCRIPTOR ?
Posted in 2003
Hi all. Hi all. I can get using GET DESCRIPTOR as bellow. Here is changed my source. % diff -c repro164802.ec.org repro164802.ec *** repro164802.ec.org Thu Nov 13 16:37:11 2003 --- repro164802.ec Thu Nov 13 16:37:51 2003 *************** *** 15,20 **** --- 15,24 ---- EXEC SQL define NODATA 100; EXEC SQL define RTERROR -1; + EXEC SQL BEGIN DECLARE SECTION; + lvarchar 'html' *html; + EXEC SQL END DECLARE SECTION; + #define BUFFSZ 256 main(argc, argv) *************** *** 86,91 **** --- 90,104 ---- for(i = 1; i <= sel_cnt; i++) { + EXEC SQL get descriptor 'selcat' VALUE :i + :type = TYPE; + if(type == SQLUDTVAR) + { + ifx_var_flag(&html, 1); + EXEC SQL set descriptor 'selcat' VALUE :i + TYPE = 124, + DATA = :html; + } while(ret = getrow("selcat")) /* fetch a row */ { data_found = 1; *************** *** 135,141 **** short char_len, type, ind; int extypeid; int extypelength; - lvarchar 'html' *html; char extypename[128]; EXEC SQL END DECLARE SECTION; --- 148,153 ---- *************** *** 158,164 **** :type = TYPE; switch(type) { ! case SQLUDTVAR: rtn = ifx_var_flag(&html, 1); EXEC SQL get descriptor :sysdesc VALUE :i :extypeid = EXTYPEID, --- 170,176 ---- :type = TYPE; switch(type) { ! case CLVCHARPTRTYPE: rtn = ifx_var_flag(&html, 1); EXEC SQL get descriptor :sysdesc VALUE :i :extypeid = EXTYPEID, *************** *** 171,177 **** if(ind == -1) { printf("\\n%.20s: NULL", name); } else { ! amount = ifx_var_getlen(&html); if(char_data = (char *)(malloc(amount + 1))) { memcpy(char_data, ifx_var_getdata(&html), amount); *(char_data+amount) = 0; --- 183,189 ---- if(ind == -1) { printf("\\n%.20s: NULL", name); } else { ! amount = char_len -1; if(char_data = (char *)(malloc(amount + 1))) { memcpy(char_data, ifx_var_getdata(&html), amount); *(char_data+amount) = 0; Regards. -- Tsutomu Ogiwara from Japan.