减小字体
增大字体
/* Update one line */ int sth; char *packet_name="lijm"; char *update_stmt = "UPDATE staff_info set ADDRESS = '22' where NAME = :1"; if (0 <= (sth = sqlo_prepare(dbh, update_stmt))) { if (SQLO_SUCCESS != (sqlo_bind_by_name(sth, ":1", SQLOT_CHR, packet_name, strlen(packet_name), 0, 0) )) { printf("sqlo_bind_param failed failed: %s\n", sqlo_geterror(dbh) ); return 0; } } if (SQLO_SUCCESS != sqlo_execute(sth, 1)) { printf("sqlo_execute failed: %s\n", sqlo_geterror(dbh) ); return 0; }
/* commit */ int status; if (SQLO_SUCCESS != (status = sqlo_commit(dbh))) { printf("commit failed (%d): %sn", status, sqlo_geterror(dbh)); return 0; }
End of《用libsqlora连接oracle》
|