![]() |
||||||
SCR/AL1 - TOME III. Les librairies utilitaires
Syntax
long OGetCountWhere(ODSN *odsn, char *tblname, char *where)
Description
long OGetCountWhere(ODSN *odsn, char *tblname, char *where) { OCSR *ocsr; char buf[1024]; long total = -1L; char *ptr;
if(where == 0) where = ""; sprintf(buf, "SELECT COUNT(*) from %s %s", tblname, where); Debug("%s\n", buf); ocsr = OQuery(odsn, buf); if(ocsr == 0) return(-1L); if(ONext(ocsr) == 0) { ptr = OGetCol(ocsr, 0); if(ptr) memcpy(&total, ptr, sizeof(long)); } OFreeOCSR(ocsr); return(total); }
Copyright © 1998-2015 Jean-Marc Paul and Bernard PAUL - Envoyez vos remarques ou commentaires à bernard@xon.be