-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem about OCI_ElemInit() #2
Labels
Comments
Hi, Thanks again. I've committed a new fix for it. |
By the way, i see that you're coding in C++. Here is your sample function rewritten using the OCILIB C++ API: Environment::Initialize();
Connection cn("db12c", "usr", "pwd");
Statement st(cn);
Collection<double> coll(TypeInfo(cn, "MDSYS.SDO_ORDINATE_ARRAY", TypeInfo::Type));
for (int i = 0; i < 4; i++)
{
coll.Append((double)i + 0.123456);
coll.Append((double)i + 0.789000);
}
for (unsigned int i = 1, n = coll.GetSize(); i <= n; i++)
{
cout << "The " << i << " Elem is " << static_cast<double>(coll[i]) << endl;
} Much simpler and more compact :) |
Thanks! I'll try to use the C++ API. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,vrogier
IN the lastest version , OCI_IterFree() now works well, and the memory retention problem has been resolved, thanks for your excellent work!
But now, I have anothoer problem. I use OCI_ElemSetDouble() function,and then I use OCI_CollGetElem() and OCI_ElemGetDouble() to get the value of element, the result is wrong.
My test code like this:
void testocilib(std::string dburl, std::string username, std::string password, std::string tablename)
{
OCI_Connection *cn;
OCI_Statement *st;
OCI_Coll *coll_ord;
OCI_Elem *elem_ord;
OCI_TypeInfo *tif_ord;
int i;
int elemnum = 4;
}
the output is : all elements are zero!
My platform is VS2010, Oracle 11g, OCI_CHARSET_ANSI.
I check the element.c file , I found that : In the lastest release version, in element.c file, OCI_ElemInit has been modified, the code
case OCI_CDT_NUMERIC:
{
if (!elem->handle)
{
elem->handle = (OCINumber *) OCI_MemAlloc(OCI_IPC_VOID, sizeof(OCINumber), 1, TRUE);
}
break;
}
has been commented out,
and in OCI_ElemFree():
has also been commented out.
I add the two section of codes in the element.c again, and now the result is correct.
So , I think these two sections of code should not been commented out.
Would you check the element.c again? Thanks!
The text was updated successfully, but these errors were encountered: