39 char *fcnName =
"childInBucket";
44 lft = puploadtree->
lft;
45 rgt = puploadtree->
rgt;
52 snprintf(sql,
sizeof(sql),
53 "select uploadtree_pk from %s \ 54 inner join bucket_container \ 55 on uploadtree_fk=uploadtree_pk and bucket_fk=%d \ 56 and agent_fk=%d and nomosagent_fk=%d \ 57 where upload_fk=%d and %s.lft BETWEEN %d and %d limit 1",
58 bucketDef->uploadtree_tablename,
61 bucketDef->uploadtree_tablename,
64 result = PQexec(pgConn, sql);
66 rv = PQntuples(result);
71 snprintf(sql,
sizeof(sql),
72 "select uploadtree_pk from %s \ 73 inner join bucket_file \ 74 on %s.pfile_fk=bucket_file.pfile_fk and bucket_fk=%d \ 75 and agent_fk=%d and nomosagent_fk=%d \ 76 where upload_fk=%d and %s.lft BETWEEN %d and %d limit 1",
77 bucketDef->uploadtree_tablename,
78 bucketDef->uploadtree_tablename,
81 bucketDef->uploadtree_tablename,
84 result = PQexec(pgConn, sql);
86 rv = PQntuples(result);
int fo_checkPQresult(PGconn *pgConn, PGresult *result, char *sql, char *FileID, int LineNumb)
Check the result status of a postgres SELECT.
PGconn * pgConn
Database connection.
FUNCTION int childInBucket(PGconn *pgConn, pbucketdef_t bucketDef, puploadtree_t puploadtree)
Given a container uploadtree_pk and bucketdef, determine if any child is in this bucket.