-
-
Save bjhaid/6684000 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'oci8' | |
f = File.open("/home/bblite/ported/portedmsisdn.txt") | |
conn = OCI8.new(DB_USER, DB_PASSWORD, DB_SERVER) | |
conn.autocommit = true | |
f.each_line do |msisdn| | |
#I think you would need to validate the MSISDN against a particular regular expression | |
next unless msisdn.match(/^233\d{9}/) | |
#replace the port with the SDP server port | |
`curl 127.0.0.1:8051/blackberry/smsservice?msisdn=#{msisdn.chomp}&msg=deactivate` #you need to deactivate the msisdn on Broker | |
conn.exec("delete from subscriber where = '#{msisdn.chomp}'") #msisdn would have a new line character behind it so you would want to remove the new line | |
conn.commit | |
end | |
conn.logoff | |
#you need to think of a folder they can drop into and we monitor it, or you would have to put this on cron job that runs every 5 minutes and they should be dropping them in a folder then you process all the files in a folder, and move failed and successfull as need be to where they should be. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ORA-00920: invalid relational operator (OCIError) there was = missing between where and msisdn