Hi, Rob,
On Sat, Mar 7, 2026 at 1:20 PM Rob Sargent <[email protected]> wrote:
>
>
>> reloptions text[]
>
>
> Then why it’s not showing {} as in the “included” columns?
>
> Or it’s an ARRAY() implementation?
>
> Thank you.
>
>>
>
> One is an empty array, the other is null. Those are not the same thing.
Following code successfully retrieves column 3 and exits, but keep
looping for column 4.
while( ( ret = SQLGetData( m_hstmt, 3, SQL_C_WCHAR,
included.get(), 255, &ind[2] ) ) != SQL_NO_DATA )
{
if( ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO )
{
auto numBytes = ind[2];
if( ind[2] == SQL_NO_TOTAL )
numBytes = 255;
else if( ind[2] > 255 )
numBytes = 255;
str_to_uc_cpy( includedCol, included.get() );
}
else
{
GetErrorMessage( errorMsg, STMT_ERROR );
result = 1;
}
}
includedCol.erase( 0, 1 );
includedCol.pop_back();
}
while( ( ret = SQLGetData( m_hstmt, 4, SQL_C_WCHAR,
index_param.get(), 255, &ind[3] ) ) != SQL_NO_DATA )
{
if( ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO )
{
auto numBytes = ind[3];
if( ind[3] == SQL_NO_TOTAL )
numBytes = 255;
else if( ind[3] > 255 )
numBytes = 255;
str_to_uc_cpy( options, index_param.get() );
}
else
{
GetErrorMessage( errorMsg, STMT_ERROR );
result = 1;
}
}
when I tried to run it without nullif() and trim().
So I started looking for a way to return SQL_NO_DATA
on that 4th column...
Thank you.
P.S.: Sorry for kind of throwing ODBC code here. You have ODBC
related list, but this is where things get in the cross.
>
>>
>>
>> > Included is one, storage is not.
>> >
>> > Thank you.
>> >
>> >>
>> >> Given that error message, an array of text is the correct type.
>> >>
>> >> Array[]::text[]
>> >>
>> >> David J.
>> >>
>> >
>> >
>>
>>
>> --
>> Adrian Klaver
>> [email protected]