Titolo: [v11 SQL] Esportazione dati
Categoria: Codice |
|
Ultimo Aggiornamento: 10/01/10 |
Ecco una versione modificata per la v11 di un metodo di esportazione dati in un file testo.
C_TEXT($testo)
C_BLOB($blob)
$pointertable:=->[LaTabella]
For ($j;1;Get last field number($pointertable))
If (Is field number valid(Table($pointertable);$j))
$testo:=$testo+Field name(Table($pointertable);$j)+Char(Tab )
If ($j
$testo:=$testo+Char(Tab )
End if
End if
End for
$testo:=$testo+Char(Carriage return )+Char(Line feed )
TEXT TO BLOB($testo;$blob)
ALL RECORDS($pointertable->)
ARRAY LONGINT($arrRecNum;0)
SELECTION TO ARRAY($pointertable->;$arrRecNum)
For ($i;1;Size of array($arrRecNum))
GOTO RECORD($pointertable->;$arrRecNum{$i})
$testo:=""
For ($j;1;Get last field number($pointertable))
If (Is field number valid(Table($pointertable);$j))
$pointer:=Field(Table($pointertable);$j)
If ((Type($pointer->)=Is Alpha Field ) | ((Type($pointer->)=Is Text )))
$testo:=$testo+$pointer->
Else
$testo:=$testo+String($pointer->)
End if
If ($j<Get last field number($pointertable))
$testo:=$testo+Char(Tab )
End if
End if
End for
$testo:=$testo+Char(Carriage return )+Char(Line feed )
TEXT TO BLOB($testo;$blob;UTF8 text without length ;*)
End for
BLOB TO DOCUMENT("Export.txt";$blob)
Inviato da: PierPaolo Sichera |
|
Visite: 10621 |
Se accedi con utente e password, puoi aggiungere dei commenti.