Re: How to properly use TRIM()?

Adrian Klaver <adrian.klaver@aklaver.com>

From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Igor Korot <ikorot01@gmail.com>, "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Rob Sargent <robjsargent@gmail.com>, "pgsql-generallists.postgresql.org" <pgsql-general@lists.postgresql.org>
Date: 2026-03-07T21:29:07Z
Lists: pgsql-general
On 3/7/26 12:46 PM, Igor Korot wrote:
> Hi, David,
> 
> On Sat, Mar 7, 2026 at 12:03 PM David G. Johnston 
> <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>> wrote:
> 
>     On Sat, Mar 7, 2026 at 12:58 PM Igor Korot <ikorot01@gmail.com
>     <mailto:ikorot01@gmail.com>> wrote:
> 
>         So I started looking for a way to return SQL_NO_DATA
>         on that 4th column...
> 
> 
>     Doesn't "No Data" refer to the result set as a whole, not individual
>     columns?  I'd assume NULL is detected some other way.
> 
> 
> No, I think it’s column based.

1) My knowledge of ODBC is limited.

2) This:

https://learn.microsoft.com/en-us/sql/odbc/reference/develop-app/return-codes-odbc?view=sql-server-ver17

"SQL_NO_DATA 	No more data was available. The application calls 
SQLGetDiagRec or SQLGetDiagField to retrieve additional information. One 
or more driver-defined status records in class 02xxx may be returned. 
Note: In ODBC 2.x, this return code was named SQL_NO_DATA_FOUND."

would seem to indicate that David Johnston is correct:

'Doesn't "No Data" refer to the result set as a whole, not individual 
columns?  I'd assume NULL is detected some other way.'

> The call to SQLGetData() returns data in one column.
> 
> And as stated it successfully retrieves empty array for column 3 and 
> moves on.
> 
> Thank you.
> 
> 
>     David J.
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com