OCILIB - crash using the library

hi,


first of all, i do not know if it is the place for this topic. Any problem, please! contact me ;-)


Problem:

I am using the library OCILIB on the work. That lib, if you do not know, is used to access the DB Oracle in C++ (VS).

So, the code below is used to read the output of a procedure.

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]);

}



When i execute the statement (CHelper::ExecuteStatement(pStmt)), i got crash.

Could any one help me here????????

TIP: the definition of procedure is
packutil.prInfoAtributoPersonalizadoCnf(String, String, Number, clob, clob_table)


Regards, Emanuel
Last edited on
Topic archived. No new replies allowed.