mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-03-13 23:57:13 +01:00
Add the option to retrieve columns/fields from explicit columns. Should close #26
This commit is contained in:
parent
5b897f21e8
commit
0f2ac5679a
@ -260,7 +260,17 @@ void ResHnd::Create(const ConnRef & conn)
|
|||||||
// Associate the field names with their index
|
// Associate the field names with their index
|
||||||
for (Uint32 i = 0; i < mFieldCount; ++i)
|
for (Uint32 i = 0; i < mFieldCount; ++i)
|
||||||
{
|
{
|
||||||
|
// Associate the current field name with the current index
|
||||||
mIndexes[mFields[i].name] = i;
|
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
|
// Associate the current field name with the current index
|
||||||
mIndexes[mFields[i].name] = i;
|
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
|
// Configure the current bind point according to the associated field
|
||||||
mBinds[i].SetOutput(mFields[i], &mMyBinds[i]);
|
mBinds[i].SetOutput(mFields[i], &mMyBinds[i]);
|
||||||
// Store the bind point buffer into the associated row
|
// Store the bind point buffer into the associated row
|
||||||
|
Loading…
x
Reference in New Issue
Block a user