Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append new record
Message
De
27/06/2005 02:36:59
 
 
À
27/06/2005 02:07:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01026609
Message ID:
01026615
Vues:
18
hi,
thank you very much,it works
another thing
i need to insert data at this new records as under
USE curbilldata

DO WHILE NOT EOF() 
     m.divi = curbilldata.divi
     DO WHILE m.divi = curbilldata.divi AND NOT EOF()
          SKIP
     ENDDO
     IF NOT EOF()
          

             INSERT BEFORE BLANK
SUM VAL(LEFT(tot_m,8))*3600 + ;
	VAL(SUBSTR(tot_m,6,3))*30 + ;
	VAL(RIGHT(tot_m,6)) TO lnSec for m.divi = curbilldata.divi

m.dae= PADL(INT(lnSec/3600), 6, "0") + ":" + ;
				PADL(INT((lnSec%3600)/60),2, "0") 
             replace m1_m WITH m.dae
          SKIP &&& i get error 
     ENDIF
ENDDO
thanks.
>APPEND BLANK puts a new blank record at the end of the table and therefore does not put a blank record where you seem to be expecting it.
>
>There is an old INSERT command which is sill supported in VFP 6 for backwards compatability. I don't know if it has been kept in any of the later versions. So the code you want is
>
>
>USE table1
>DO WHILE NOT EOF()
>     m.divi = table1.divi
>     DO WHILE m.divi = table1.divi AND NOT EOF()
>          SKIP
>     ENDDO
>     IF NOT EOF()
>          INSERT BEFORE BLANK
>          SKIP
>     ENDIF
>ENDDO
>
>
>While the above code does (I think) what you asked for, I suggest you seriously rethink whatever it is you are trying to do that wants you to physically place a blank record before each change of divi. Putting any sort of index on divi will cause these blank records to move elsewhere in the ordered table. In addition, each time you INSERT BLANK BEFORE you are making a full copy of the table to insert the blank record. On large tables, this is hideously inefficient. While I don't know exactly what you need to get done, I'm sure there must be a better way than this to do it.
>
>
>
>>hi all,
>>
>>i need to append new record if the item name is different
>>ex..
>>
>>use table1
>>m.divi=divi
>>scan
>>if m.divi<>divi
>>append blank
>>endif
>>endscan
>>*****************************
>>ex....
>>
>>field name is divi
>>               a
>>               a
>>               a
>>---------------------->new record
>>               bb
>>               bb
>>---------------------> new record
>>               sss
>>               sss
>>                .
>>                .
>>
>>thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform