Guest User

Untitled

a guest
Feb 26th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import mysql.connector
  2. class Dao:
  3. cnx=0
  4. cursor=0
  5. def getFeedKeysFromCtrl(self,registerId,feedId,maxFeedKey,minFeedKey):
  6. cnx = mysql.connector.connect(user='root', password='password-1',
  7. host='127.0.0.1',
  8. database='demo_db')
  9. crsA = cnx.cursor()
  10. qury="select distinct substr(cstone_feed_key,1,7) uniq_feed_keys from cstone_ingestion_ctrl where register_id= %d and feed_id = %d and (cstone_feed_key between %d and %d);"%(registerId,feedId,minFeedKey*1000,maxFeedKey*1000)
  11. crsA.execute(qury)
  12. feedKeysDetails=crsA.fetchall()
  13. loadedFeedKeys=[int(i[0]) for i in feedKeysDetails]
  14. return loadedFeedKeys
Add Comment
Please, Sign In to add comment