Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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
Exemplo n.º 4
0
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
Exemplo n.º 5
0
def db_get_all():
    oracle_lib.connect()
    sql = "select * from source"
    data = oracle_lib.select(sql)
    oracle_lib.close()
    return data