def db_delete(id): oracle_lib.connect() sql = "delete from source where id ={}".format(id) print(sql) data = oracle_lib.executeSQL(sql) oracle_lib.close() return data
def db_update(id,name): oracle_lib.connect() sql = "update source set name='{}' where id ={}".format(name,id) print(sql) data = oracle_lib.executeSQL(sql) oracle_lib.close() return data
def db_get_by_id(id): oracle_lib.connect() sql = "select * from source where id={}".format(id) print(sql) data = oracle_lib.select(sql) oracle_lib.close() return data
def db_insert(id,name,age,gender): oracle_lib.connect() insert_sql = "insert into source values('{}','{}','{}','{}')".format(id,name,age,gender) print(insert_sql) data = oracle_lib.executeSQL(insert_sql) oracle_lib.close() return data
def db_get_all(): oracle_lib.connect() sql = "select * from source" data = oracle_lib.select(sql) oracle_lib.close() return data