Re: problems with SELECT query results

From: Joshua <joshua(at)joshuaneil(dot)com>
To: PFC <lists(at)peufeu(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: problems with SELECT query results
Date: 2007-05-29 16:44:34
Message-ID: 465C5872.5020703@joshuaneil.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I checked the table and found that none of my fields in the SELECT
statement contain NULLs.

Any other suggestions?

PFC wrote:
>> SELECT 'PV.LINEITEM:' || partnum || ',' || round(onhand) || ',' ||
>> round(qm5) || ',' || round(lsm4) || ',' || ',' || ',' ||
>> round(onorder) || ',' || ',' || ',' || binone || ',' || ',' ||
>> round(backorderqty) || ',' || ',' || round(onhold) || ',' || ',' ||
>> ',' || ',' || ',' || ',' || ',' || round(qtyperjob) || ',' ||
>> round(ordermax) AS gmrim FROM slparts WHERE vendor LIKE 'CH%'
>
> You could select columns and build the string in your application ?
>
>> The query does work and I am getting results from the database. There
>> are values for all 'partnum' in the database, however, the query
>> results include blank fields here and there in between the returned
>> records. Why am I receiving blank fields for 'gmrim'???? This
>> absolutely defies logic
>
> Because one of your fields is probably NULL, and NULL || anything
> stays NULL.
>
> You have probably been misled to believe they are "blanks" because
> they don't display as "NULL" but as "".
> I set psql to display NULL as NULL.
>
> If these columns can, must, or should not contain NULLs depends on
> your application... it's for you to chose.
> Use COALESCE, add NOT NULL constraints, grab the columns and build
> the string in your application, you chose.
>
>
> --No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 269.8.1/822 - Release Date:
> 5/28/2007 11:40 AM
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bhavana.Rakesh 2007-05-29 16:58:13 Re: jdeveloper and postgres
Previous Message ABHANG RANE 2007-05-29 16:42:59 opclass for real[]