4 Replies Latest reply on Jul 24, 2013 9:19 AM by 1025093

    questions about flags(DB_DBT_MALLOC or 0) in DBT




      I have several questions about DBT flag, who could help clarify them?

      I am clear about flag DB_DBT_MALLOC/DB_DBT_USERMEM, but when I use get without cursors, what the memory to which the pointer stored into the DBT refers if I use flag 0? Do I need to free the memory?

      If use cursor get, I see examples in the manual seem always use flag 0. What the memory refers? Is it safe to change the data it refers then put the new data? Do I need to free the memory? Can I use DB_DBT_MALLOC/DB_DBT_USERMEM when use cursor get? Is it ok to use cursor get one record first, then use put to replace this record's data without cursor?

      Can you give suggestion when to use flag 0?


      Thanks in advance!