ESQL/C dynamic SQL and BLOBS
Posted in 1995
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I am writing a fairly general database interface, which leads to using dynamic SQL. Since we also use BLOBS, this means that I need to dynamically allocate and deallocate loc_t structures (no problem so far). When fetching data I want ISQL to allocate memory for me, still no problem, i set: p->loc_loctype = LOCMEMORY; p->loc_bufsize = -1; according to the manual, ISQL will allocate the buffer for mw using GlobalAlloc(), and grow it as needed. Now, when I want to free everything allocated I have a problem. Since the buffer was allocated by GlobalAlloc(), I guess it should be freed by GlobalFree(). However GlobalFree() doesn't take a pointer to the memry area to be freed , instead it takes some kind of windows handle, which I don't have... Has anyone else done this??? (Come o think of it, the problem would be the same without dynamic SQL, except smaller, since we usually don't have that many locators total in a program).