Présentation
Documentation
L'équipe
Sérialisation
 
Programmes
Objets
Libs Utilitaires
Libs Internes
   
 
Editeur
Syntaxes
Windows
Versions
   

SCR/AL1 - TOME III. Les librairies utilitaires

25. Le groupe s_odbc

25.25 OGetCountWhere (file s_odbc.c:1425)

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