本文整理汇总了C++中PCOL::GetResultType方法的典型用法代码示例。如果您正苦于以下问题:C++ PCOL::GetResultType方法的具体用法?C++ PCOL::GetResultType怎么用?C++ PCOL::GetResultType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PCOL
的用法示例。
在下文中一共展示了PCOL::GetResultType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strcpy
char *TDBWMI::MakeWQL(PGLOBAL g)
{
char *colist, *wql/*, *pw = NULL*/;
int len, ncol = 0;
bool first = true, noloc = false;
PCOL colp;
// Normal WQL statement to retrieve results
for (colp = Columns; colp; colp = colp->GetNext())
if (!colp->IsSpecial() && (colp->GetColUse(U_P | U_J_EXT) || noloc))
ncol++;
if (ncol) {
colist = (char*)PlugSubAlloc(g, NULL, (NAM_LEN + 4) * ncol);
for (colp = Columns; colp; colp = colp->GetNext())
if (!colp->IsSpecial()) {
if (colp->GetResultType() == TYPE_DATE)
((DTVAL*)colp->GetValue())->SetFormat(g, "YYYYMMDDhhmmss", 19);
if (colp->GetColUse(U_P | U_J_EXT) || noloc) {
if (first) {
strcpy(colist, colp->GetName());
first = false;
} else
strcat(strcat(colist, ", "), colp->GetName());
} // endif ColUse
} // endif Special
} else {
// ncol == 0 can occur for queries such that sql count(*) from...
// for which we will count the rows from sql * from...
colist = (char*)PlugSubAlloc(g, NULL, 2);
strcpy(colist, "*");
} // endif ncol
// Below 14 is length of 'select ' + length of ' from ' + 1
len = (strlen(colist) + strlen(Wclass) + 14);
len += (To_CondFil ? strlen(To_CondFil->Body) + 7 : 0);
wql = (char*)PlugSubAlloc(g, NULL, len);
strcat(strcat(strcpy(wql, "SELECT "), colist), " FROM ");
strcat(wql, Wclass);
if (To_CondFil)
strcat(strcat(wql, " WHERE "), To_CondFil->Body);
return wql;
} // end of MakeWQL