1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
CString sMask, strTmp;
const SIZE_T MAXSIZE = 65535;
wchar_t wstrQuery[MAXSIZE];
CDBSql Sql;
OCI_Lob *pQueryLob = OCI_LobCreate(GLOBAL::g_Database->GetConnection(), OCI_CLOB);
OCI_Lob *lob_array[11];
for (auto i = 0; i < 11; i++)
lob_array[i] = OCI_LobCreate(GLOBAL::g_Database->GetConnection(), OCI_CLOB);
// pack para listar os atributos personalizados
sMask.Format(L"begin \
packutil.prInfoAtributoPersonalizadoCnf('%s', 'TCE_QUALIDADE', %d, :lista_atributos, :lista_descricao); \
end;",
GetCodContrato(),
m_tceq_id);
OCI_Statement *pStmt = Sql.GetStatement();
OCI_Prepare(pStmt, sMask);
OCI_BindArraySetSize(pStmt, 11);
OCI_BindLob(pStmt, L":lista_atributos", pQueryLob);
BOOL bRet = OCI_BindArrayOfLobs(pStmt, L":lista_descricao", lob_array, OCI_CLOB, 0);
BOOL bSuccess = CHelper::ExecuteStatement(pStmt);
if(bSuccess)
{
const size_t nLidos = OCI_LobRead(pQueryLob, &wstrQuery, sizeof(wstrQuery));
if(nLidos >= 0) wstrQuery[nLidos] = '\0';
OCI_LobFree(pQueryLob);
for (auto i = 0; i < 11; i++)
OCI_LobFree(lob_array[i]);
}
|