Ok i have this whole script running on 1 single table is there a way to put in my script listed below to either delete the selected records from the tbl query or to remove the phone field value???? "I only want to grab the selected records 1 time"
Code:
'establish constants ln2 = "Callerid: ##########" '<--- put the fixed number inside the quotes ln3 = "MaxRetries: 2" ln4 = "RetryTime: 300" ln5 = "WaitTime: 45" ln6 = "Context: outboundmsg1" ln7 = "Extension: s" ln8 = "Priority: 1" tbl = table.open("maker") tbl.query_create("n","top_records(2,\"isnotblank("+chr(92)+"\"Phone"+chr(92)+"\") \")") tbl.fetch_first() counter = "1" 'add more leading zeroes if more than 1000 files need to be created 'file.dir_create("c:\callfiles") WHILE .not. tbl.fetch_eof() fil = file.create("c:\callfiles\\"+counter+".call",FILE_RW_EXCLUSIVE) ln1 = "Channel: SIP/ainphonex/"+alltrim(tbl.phone) fil.write_line(ln1) fil.write_line(ln2) fil.write_line(ln3) fil.write_line(ln4) fil.write_line(ln5) fil.write_line(ln6) fil.write_line(ln7) fil.write_line(ln8) fil.flush() fil.close() counter = increment_value(counter) tbl.fetch_next() END WHILE tbl.close() xbasic_wait_for_idle() dim list as C list = <<%a% 1.call 2.call %a% ftp_put_file_multiple("*", "*", "*", list, "C:\callfiles", "/var/www/html", .F.) xbasic_wait_for_idle() filename = "c:\callfiles\1.call" result = file.exists(filename) if result = .T. then FILE.REMOVE("c:\callfiles\1.call") else end end if filename = "c:\callfiles\2.call" result = file.exists(filename) if result = .T. then FILE.REMOVE("c:\callfiles\2.call") else end end if filename = "c:\callfiles\3.call" result = file.exists(filename) if result = .T. then FILE.REMOVE("c:\callfiles\3.call") else end end if filename = "c:\callfiles\4.call" result = file.exists(filename) if result = .T. then FILE.REMOVE("c:\callfiles\4.call") else end end if filename = "c:\callfiles\5.call" result = file.exists(filename) if result = .T. then FILE.REMOVE("c:\callfiles\5.call") else end end if 'sys_shell("rd c:\callfiles") file.dir_remove("c:\callfiles")
Comment