Exemple #1
0
void qObjODBC::EvalCol(qCtx *ctx, qStr *out, qArgAry *args) 
{
	assert(myStmt.RowCount()!=-1);
	if (myStmt.RowCount() == -1)
		return;
	CDbCol *col;
	if ((col = GetEvalCol(ctx, args))) {
		int ind = col->GetInd();
		if (myStmt.HasData() && SQL_HAS_DATA(ind)) {
			col->ConvBuf();
			col->RTrim();
			if (col->GetBuf() && *col->GetBuf())
				out->PutS(col->GetBuf());
		}
	}
}
Exemple #2
0
void qObjODBC::EvalCol(qCtx *ctx, qStr *out, qArgAry *args) 
{
	assert(myStmt.RowCount()!=-1);
	if (myStmt.RowCount() == -1)
		return;
	CDbCol *col;
	if ((col = GetEvalCol(ctx, args))) {
		int ind = col->GetInd();
		// smx_log(SMXLOGLEVEL_DEBUG, "ind for %s is %d", (const char *) col->Name, ind);
		if (myStmt.HasData() && SQL_HAS_DATA(ind)) {
			col->ConvBuf();
			col->RTrim();
			if (col->GetBuf() && *col->GetBuf())
				out->PutS(col->GetBuf());
		}
	}
}
Exemple #3
0
void qObjODBC::EvalEnumCol(qCtx *ctx, qStr *out, qArgAry *args) 
{
	assert(myStmt.RowCount()!=-1);
	if (myStmt.RowCount() == -1)
		return;
	if (args->Count() == 0)
		return;

	int   num, type, size;

	const char *name=0;
	const char *value=0;
	bool  ok = true;
	
	qCtxTmp sub(ctx);

	sub.MapObj(&num,   "num");
	sub.MapObj(&name,  "name");
	sub.MapObj(&value, "value");
	sub.MapObj(&type,  "type");
	sub.MapObj(&size,  "size");
	sub.MapObj(&ok, (QOBJFUNC) EvalBreak, "break");

	CDbCol *col;
	for(num = 1; ok && num <= myStmt.ColCount(); ++num) {
		col = myStmt.Column(num-1);
		name = col->Name;
		if (myStmt.HasData() && SQL_HAS_DATA(col->GetInd())) {
			col->ConvBuf();
			col->RTrim();
			value = col->GetBuf();
		} else {
			value = 0;
		}
		type = col->Type;
		size = col->Size;
		sub.qCtx::Parse(args->GetAt(0), out);
	}
}