This discussion is archived
4 Replies Latest reply: Jul 24, 2013 2:19 AM by 4246bac3-3a09-4031-8891-51bb8a451ffc RSS

questions about flags(DB_DBT_MALLOC or 0) in DBT

4246bac3-3a09-4031-8891-51bb8a451ffc Newbie
Currently Being Moderated

Hi,

 

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!

Min

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points