#!/usr/bin/mumps

      w "pragma journal_mode=off;",!
      w "pragma synchronous=off;",!

      s i=$zsqlite("pragma","journal_mode=off")
      s i=$zsqlite("pragma","synchronous=off")

      set date=^date
      set time=^time

      use 5
      write "drop table if exists insuranceBill;",!
      write "create table insuranceBill (ptid char(10), date date, time time, amount float, insurer char(10) );",!

      set names=^names
      set streets=^streets
      set city=^city
      set ptid=100000
      for i=1:1:1000 do
      . set ptid=ptid+1000
      . write "insert into insuranceBill values ( '",ptid,"', "
      . write " '",^dates($r(date)+1),"', "
      . write " '",^time($r(time)+1),"', "
      . for  set x=$r(99999)+1 if x>999 quit
      . write "'",x,".00', "
      . s ins=$r(^insurance)+1
      . s code=$o(^insurance(ins,""))
      . write "'",code,"' ); ",!
      
