cou_sendMessageX(cnx, ap_psprintf(p, "ENTERING TEST"), CO_MSG_DEBUG);

ar = coa_Create(cnx);
for(i=0; i< 10; i++)
{
coa_AppendElement(cnx, ar, ap_pstrdup(p, text));
cou_sendMessageX(cnx, ap_psprintf(p, "num of elems: %d", coa_GetElementCount(cnx, ar)), CO_MSG_DEBUG);
}

for(i=0; i< 10; i++)
{
cou_sendMessageX(cnx, (char *)coa_GetElement(cnx, ar, i), CO_MSG_DEBUG);
}

corec2 = cor_CreateEmpty(cnx);
__CREATE_QUERY("SELECT * FROM co_sys_meta_class")

for(j=0; j<10; j++)
{
__SQL_GET_RESULT
NTuples = cor_GetTupleCount(cnx, corec);
for(i=0; i<NTuples; i++)
{
cor_AppendRecord(cnx, corec2, corec, i);
}
}
cou_setReturnValue(cnx, corec2, CO_RECORDSET);
__CLEAR_RESULT