insertFixedDataV4.sim 1.0 KB
Newer Older
P
plum-lihui 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

sql connect

print ================ insert data
$dbNamme  = d1
$tbPrefix = ct
$tbNum    = 10
$rowNum   = 100
$tstart   = 1640966400000  # 2022-01-01 00:00:00.000

$loopInsertNum = 10

sql use $dbNamme

$loopIndex = 0

loop_insert:
print ====> loop $loopIndex insert
$loopIndex = $loopIndex + 1

$i = 0
while $i < $tbNum
  $tb = $tbPrefix . $i

  $x = 0
  while $x < $rowNum
    $binary = ' . binary
    $binary = $binary . $i
    $binary = $binary . '

    #print ====> insert into $tb values ($tstart , $i , $x , $binary )
    #print ====> insert into ntb values ($tstart , $i , $x , $binary )
    sql insert into $tb values ($tstart , $i , $x , $binary )
    sql insert into ntb values ($tstart , 999 , 999 , 'binary-ntb' )
    $tstart = $tstart + 1
    $x = $x + 1
  endw
  
  #print ====> insert rows: $rowNum into $tb and ntb

  $i = $i + 1
#  $tstart = 1640966400000
endw


if $loopIndex < $loopInsertNum then
  goto loop_insert
endi

print ====> insert data end ===========