1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-31 09:57:14 +01:00

Add the option to retrieve columns/fields from explicit columns. Should close #26

This commit is contained in:
Sandu Liviu Catalin 2016-08-07 02:22:59 +03:00
parent 5b897f21e8
commit 0f2ac5679a

View File

@ -260,7 +260,17 @@ void ResHnd::Create(const ConnRef & conn)
// Associate the field names with their index
for (Uint32 i = 0; i < mFieldCount; ++i)
{
// Associate the current field name with the current index
mIndexes[mFields[i].name] = i;
// Include table names if available
if (mFields[i].table_length > 0)
{
mIndexes[ToStrF("%s.%s", mFields[i].table, mFields[i].name)] = i;
}
else if (mFields[i].org_table_length > 0)
{
mIndexes[ToStrF("%s.%s", mFields[i].org_table, mFields[i].name)] = i;
}
}
}
@ -333,6 +343,15 @@ void ResHnd::Create(const StmtRef & stmt)
{
// Associate the current field name with the current index
mIndexes[mFields[i].name] = i;
// Include table names if available
if (mFields[i].table_length > 0)
{
mIndexes[ToStrF("%s.%s", mFields[i].table, mFields[i].name)] = i;
}
else if (mFields[i].org_table_length > 0)
{
mIndexes[ToStrF("%s.%s", mFields[i].org_table, mFields[i].name)] = i;
}
// Configure the current bind point according to the associated field
mBinds[i].SetOutput(mFields[i], &mMyBinds[i]);
// Store the bind point buffer into the associated row