16 #include <scheduler.h>
29 sprintf(sql,
"INSERT INTO upload (upload_desc,upload_filename,user_fk,upload_mode,upload_origin) "
30 "VALUES('testing upload data', 'testing file', '1', '100', 'testing file')");
34 sprintf(sql,
"SELECT currval('upload_upload_pk_seq') as mykey FROM %s",
"upload");
36 upload_pk = atoi(PQget(db_result, 0,
"mykey"));
40 sprintf(sql,
"INSERT INTO foldercontents (parent_fk,foldercontents_mode,child_id) VALUES ('1',2,'%d')",
upload_pk);
45 sprintf(sql,
"INSERT INTO job (job_pk,job_user_fk,job_queued,job_priority,job_name,job_upload_fk) "
46 "VALUES(%d,'1',now(),'0','testing file',%d)", job_pk,
upload_pk);
50 sprintf(sql,
"INSERT INTO jobqueue "
51 "(jq_pk,jq_job_fk,jq_type,jq_args,jq_runonpfile,jq_starttime,jq_endtime,jq_end_bits,jq_host) "
52 "VALUES (%d,'%d', 'ununpack', '%d', NULL, NULL, NULL, 0, NULL)", jq_pk, job_pk,
upload_pk);
PGresult * database_exec(scheduler_t *scheduler, const char *sql)
Executes an sql statement for the scheduler.
int Prepare_Testing_Data(scheduler_t *scheduler)