Trouble with smart large object
Posted in 1999
Hello. I have a problem with creating smart large object using CLI. When I get the size of smart large object, allocate the buffer to hold the structure and create a default smart large object specification structure using ifx_lo_def_create_spec(?), I try to initialise the smart large object specification structure with values for database column, where the smart large object is being inserted (see code below). rc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, (UDWORD)colname_size, 0, colname, 0, &colname_size); // here rc = SQL_SUCCESS lospec_valsize = lospec_size; rc = SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT_OUTPUT, SQL_C_LONG, SQL_INFX_UDT_FIXED, (UDWORD)lospec_size, 0, lospec_buffer, lospec_size, &lospec_valsize); // here rc = SQL_SUCCESS rc = SQLExecDirect (hstmt, "{call ifx_lo_col_info(?,?)}", SQL_NTS); // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // rc = SQL_ERROR and SQLSTATE = 07006 "Restricted data type attribute violation" rc = SQLFreeStmt (hstmt, SQL_RESET_PARAMS); In comments I have written values of rc. In Informix Error Messages document it writes: __________________________________________________________ -11013 Restricted data type attribute violation. A data value could not be converted to the C data type specified by the fCType argument of the SQLBindCol function. This error occurs when you try to retrieve data types that are unsupported by the CLI driver or the value in the fCType argument is not recognized. Confirm that the data type you are requesting is supported by the database server and confirm that the value you are supplying for the fCType argument is valid. ___________________________________________________________ I think such error appears because of using SQL_INFX_UDT_FIXED in second SQLBindParameter(), but I dont know how to correct the code. I have Informix Dynamyc Server 7.3 under Solaris and INFORMIX-CLI. Can anyone help to solv the problem?