Database import

De Stoq Wiki
Ir para: navegação, pesquisa

MS SQL Server

bcp

Paradox

Requires pxtools.

One table to CSV

pxcsvdump -f input.CSV -b input.CSV > table.CSV

Dump a list of tables

for name in $(ls *.DB); do
   base=`echo $name|cut -d. -f1`
   echo "Dumping $base..."
   pxcsvdump -b $base.MB -f $base.DB > $base.CSV
   size=$(ls -s $base.CSV|cut -d' ' -f1)
   if [ "$size" = "0" ] ; then
     rm $base.CSV
   else
     pxinfo -f $base.DB > $base.INFO
   fi
done
echo "Done"