insertDataV4.sim 966 字节
Newer Older
P
plum-lihui 已提交
1 2 3 4 5 6

sql connect

print ================ insert data
$dbNamme  = d1
$tbPrefix = ct
P
plum-lihui 已提交
7
$tbNum    = 10
P
plum-lihui 已提交
8 9 10 11 12
$rowNum   = 100
$tstart   = 1640966400000  # 2022-01-01 00:00:00.000

sql use $dbNamme

P
plum-lihui 已提交
13 14
$loop_cnt = 0

P
plum-lihui 已提交
15
loop_insert:
P
plum-lihui 已提交
16 17 18
print ====> loop $loop_cnt insert
$loop_cnt = $loop_cnt + 1

P
plum-lihui 已提交
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
$i = 0
while $i < $tbNum
  $tb = $tbPrefix . $i

  $x = 0
  while $x < $rowNum
    $c = $x / 10
    $c = $c * 10
    $c = $x - $c

    $binary = ' . binary
    $binary = $binary . $c
    $binary = $binary . '

    #print ====> insert into $tb values ($tstart , $c , $x , $binary )
    #print ====> insert into ntb values ($tstart , $c , $x , $binary )
    sql insert into $tb values ($tstart , $c , $x , $binary )
    sql insert into ntb values ($tstart , $c , $x , $binary )
    $tstart = $tstart + 1
    $x = $x + 1
  endw
P
plum-lihui 已提交
40 41
  
  #print ====> insert rows: $rowNum into $tb and ntb
P
plum-lihui 已提交
42 43

  $i = $i + 1
P
plum-lihui 已提交
44
#  $tstart = 1640966400000
P
plum-lihui 已提交
45 46 47 48
endw
goto loop_insert