insertDataV4.sim 917 字节
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
$i = 0
while $i < $tbNum
  $tb = $tbPrefix . $i

  $x = 0
  while $x < $rowNum
    $binary = ' . binary
P
plum-lihui 已提交
26
    $binary = $binary . $i
P
plum-lihui 已提交
27 28
    $binary = $binary . '

P
plum-lihui 已提交
29 30 31 32
    #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' )
P
plum-lihui 已提交
33 34 35
    $tstart = $tstart + 1
    $x = $x + 1
  endw
P
plum-lihui 已提交
36 37
  
  #print ====> insert rows: $rowNum into $tb and ntb
P
plum-lihui 已提交
38 39

  $i = $i + 1
P
plum-lihui 已提交
40
#  $tstart = 1640966400000
P
plum-lihui 已提交
41 42 43 44
endw
goto loop_insert