dbTalk Databases Forums  

DB_SECONDARY_BAD error while deleting the record

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss DB_SECONDARY_BAD error while deleting the record in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pai
 
Posts: n/a

Default DB_SECONDARY_BAD error while deleting the record - 11-23-2006 , 11:50 PM






Hi,

my structure is ,
typedef struct _Hdr_S
{
pwchar pwcLine1[MAXSTRINGLENGTH];
puint32 uiMsgId ;
}Hdr_S;

secondary key generation funtions are,
pint32 get_SecKeyForLine1( DB *psDb, const DBT *pkey, const DBT *pdata,
DBT *skey)
{

Hdr_S *pstDetail = (Hdr_S*)pdata->data;
memset(skey, 0, sizeof(DBT));
skey->data = pstDetail ->pwcLine1;
(pvoid)PBase_UString_length( pstDetail , &(skey->size));
skey->size = skey->size + 1;
return 0;
}

/* PBase_UString_length return the length of wide string */

When an item is added to db using db->put, the item is added
successfully and also the item can be deleted using db->del

Now once I close the program and again start it then I can iterate
through all the items in Db, but I get DB_SECONDARY_BAD when I try to
delete an item

what can be the reason for above problem?

Whether my key generation algoritm is incorrect?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.