dbdata() call's memory management 
Author Message
 dbdata() call's memory management

I had a simple question on the dbdata() call.
        This call returns the pointer to a selected column.
        This is typically used for extracting image data types from tables.

        My question is if I do:

                 dbfcmd(dbproc,  "select img from table");
                [...]
                (DBBINARY *)ptr = dbdata(dbproc, 1);"...

        'ptr' points to the image data from table.
        BUT dbdata() must allocate the memory needed by image data somewhere.
        Is there a way to free it? or dbdata() manages it itself.

        I am just concerned that there may be a memory leak after multiple
        invokations of dbdata(). I could not see any dbdatafree calls
        in the manual. [My image data is rather large].

        Thanks for any info.

        LakshmiN



Mon, 02 Mar 1998 03:00:00 GMT
 dbdata() call's memory management

Quote:
> I had a simple question on the dbdata() call.
>       This call returns the pointer to a selected column.
>       This is typically used for extracting image data types from
tables.

>       My question is if I do:

>                dbfcmd(dbproc,  "select img from table");
>               [...]
>               (DBBINARY *)ptr = dbdata(dbproc, 1);"...

>       'ptr' points to the image data from table.
>       BUT dbdata() must allocate the memory needed by image data
somewhere.
>       Is there a way to free it? or dbdata() manages it itself.

>       I am just concerned that there may be a memory leak after multiple
>       invokations of dbdata(). I could not see any dbdatafree calls
>       in the manual. [My image data is rather large].

>       Thanks for any info.

>       LakshmiN

dbdata() merely points at the data already retrieved by db-lib to the
client - you don't have to worry about memory management.  Of course,
this data only exists until dbnextrow() is called again, so if you want
to keep it you have to copy it to your own memory structures or out to a
file.  

simon walker
The SQL Workshop
Milton Keynes, UK



Sat, 07 Mar 1998 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Help: DBLIB dbdata doesn't work

2. Datablade memory management ?'s

3. FINAL CALL on EXTENDED DEADLINE: WORKSHOP ON SPATIO-TEMPORAL DATABASE MANAGEMENT (follows VLDB'99)

4. SRF memory mgmt patch (was [HACKERS] Concern about memory management with SRFs)

5. SRF memory mgmt patch (was [HACKERS] Concern about memory management

6. SQL*Loader missing defaults when called from Unix's system call

7. Equivalent of dbdata() in Syb 10?

8. endian-ness, dbdata() vs. dbbind()

9. Name Calling Conflict - Don't Call Me That (VCX)

10. 'Efficient' database management system

11. 'Inconcert' document management database

12. CFP: WORKSHOP ON SPATIO-TEMPORAL DATABASE MANAGEMENT STDBM'99 (co-located with VLDB'99)


 
Powered by phpBB® Forum Software