def get_zone (region, sps):
import fdb
con = fdb.connect (
dsn='172.16.16.77:/telenet.db',
user='TDR', password='9539955q',
dialect='3'
charset='WIN1251'
)
cur = con.cursor()
SELECT = ('SELECT ZONE FROM ZONES WHERE ZONE_NAME LIKE '
+ region[1:(len(region)-3)] + '%'
+ ' AND ZONE < 600000'
if sps:
SELECT += ' AND ZONE NAME CONTAINING 'á