def delete_weekend_candles_rows(): for i, row in enumerate(dbt.execute_query(sql_select_weekends)): print i, row.d1, row.d2 dbt.execute_non_query(sql_delete_weekend_candles, row.d1, row.d2) print 'ok'
def delete_weekend_candles_rows(): for i, row in enumerate(dbt.execute_query(sql_select_weekends)): print i,row.d1, row.d2 dbt.execute_non_query(sql_delete_weekend_candles, row.d1, row.d2) print 'ok'
def delete_weekend_rows(): for i, row in enumerate(dbt.execute_query(sql_select_weekends)): print i, row.d1, row.d2 dbt.execute_non_query(sql_delete_weekends, row.d1, row.d2) def delete_weekend_candles_rows(): for i, row in enumerate(dbt.execute_query(sql_select_weekends)): print i, row.d1, row.d2 dbt.execute_non_query(sql_delete_weekend_candles, row.d1, row.d2) print 'ok' if __name__ == '__main__': dbt.db_db = "forex" delete_weekend_candles_rows() sys.exit(0) for row in dbt.execute_query(sql_select_candles, '2012-10-11', 8): print row.date, row.hour, row.open, row.high, row.low, row.close max_price = dbt.execute_query(sql_select_max_price, '2012-10-11', 8, 20).next().max_bid open_price = dbt.execute_query(sql_select_open_price, '2012-10-11', 8).next().bid print 'max_price', max_price print 'open_price', open_price
for i, row in enumerate(dbt.execute_query(sql_select_weekends)): print i,row.d1, row.d2 dbt.execute_non_query(sql_delete_weekend_candles, row.d1, row.d2) print 'ok' if __name__ == '__main__': dbt.db_db="forex" delete_weekend_candles_rows() sys.exit(0) for row in dbt.execute_query(sql_select_candles,'2012-10-11',8): print row.date, row.hour, row.open, row.high, row.low, row.close max_price = dbt.execute_query(sql_select_max_price,'2012-10-11',8,20).next().max_bid open_price = dbt.execute_query(sql_select_open_price,'2012-10-11',8).next().bid print 'max_price',max_price print 'open_price',open_price