public inbox for [email protected]
help / color / mirror / Atom feedFrom: Igor Korot <[email protected]>
To: Rob Sargent <[email protected]>
Cc: Adrian Klaver <[email protected]>
Cc: David G. Johnston <[email protected]>
Cc: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: How to properly use TRIM()?
Date: Sat, 7 Mar 2026 13:58:22 -0600
Message-ID: <CA+FnnTznxpXh8nAJhjnggpfYz0MEnEdK89FtejDNTmX87MktiA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CA+FnnTwxSeLhR8zNZsoR2SAXYVf9Db+zi3+SpPqdBe==m3X-AQ@mail.gmail.com>
<[email protected]>
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]
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: How to properly use TRIM()?
In-Reply-To: <CA+FnnTznxpXh8nAJhjnggpfYz0MEnEdK89FtejDNTmX87MktiA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox