.
contact contact

DBDELETE/DBPUT use different record number

 
.
 

Title: DBDELETE/DBPUT use different record number
Document: 939070424
Author: Michael Marxmeier (mike@msede.com)
Keywords: A0600,DBPUT,DBDELETE,record number


> I have a programm where
> the variable Num_rif must be equal to the record position ( S(4) )
>
> This is the routine that create the record.
>
> 2680 Put:DBLOCK (Dbm$,1,1,S(*))
> 2700     Num_rif=0
> 2710     DBPUT (Dbm$,"MAG",1,S(*),"@",Buf$)
> 2720     Record=S(4)
> 2730     IF S(1) THEN Db_err
> 2740     DBDELETE (Dbm$,"MAG",1,S(*))
> 2750     IF S(1) THEN Db_err
> 2760     Num_rif=Record
> 2770     DBPUT (Dbm$,"MAG",1,S(*),"@",Buf$)
> 2780     IF S(1) THEN Db_err
> 2781     Fm_nomi$=Desart$
> 2790     DBPUT (Dbm$,"PARTI",1,S(*),"@",Buf$)
> 2800     IF S(1) THEN Db_err
> 2810     DBPUT (Dbm$,"VALORI",1,S(*),"@",Buf$)
> 2820     IF S(1) THEN Db_err
> 2840     DBUNLOCK (Dbm$,1,1,S(*))
>
> With Eloquence 5.12 for HP-UX it is correct but on Eloquence 6.20
> under Linux after then DBDELETE then next DBPUT is not in the same
> position of the first one ( S(4) <> Num_rif).
This program is wrong and no longer works with Eloquence A.06.xx. There is no guarantee that DBPUT uses the same record number as DBDELETE and with A.06.20 is almost never does. This aproach also has the problem that whenever you need to reload the database (dbexport/dbimport) your program no longer works.

With A.06.20 you can use DBUPDATE mode 2 to replace the DEBELETE and DBPUT of the dataset "MAG".

 
 
.
 
 
  Privacy | Webmaster | Terms of use | Impressum Revision:   
  Copyright © 1995-2002 Marxmeier Software AG