Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Carlos Lima
  Where is Carlos Lima?
 Mindelo
 Cape Verde
 Carlos Lima
 Tags
Subject: RE: select returning null values
Thread ID: 373821 Message ID: 373861 # Views: 42 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Wednesday, March 27, 2013 11:47:46 PM         
   


> ERROR: Field descricao does nott accept null values
>
> Why this select return null values?
>
> SELECT Servicos.designacao as descricao, Servicos.codigo;
> FROM Servicos ;
> RIGHT JOIN TipoServicos ON Servicos.tipo_servico==TipoServicos.codigo ;
> and TipoServicos.exame_complementar == "S" ;
> and TipoServicos.requisicao == "S" ;
> INTO CURSOR DD
> BROW

Borislav already explained. To counter that, you can infuse NVL() in your SQL SELECT like this:

SELECT CAST(NVL(Servicos.designacao,'') as c(40)) as descricao, Servicos.codigo;


Check also SET NULL command in help.

http://sandstorm36.blogspot.com
http://weblogs.foxite.com/sandstorm36

ENTIRE THREAD

select returning null values Posted by Carlos Lima @ 3/27/2013 1:13:34 PM
RE: select returning null values Posted by Borislav Borissov @ 3/27/2013 2:06:10 PM
RE: select returning null values Posted by Rick Hodgin @ 3/27/2013 2:48:29 PM
RE: select returning null values Posted by Paul Gibson @ 3/27/2013 3:22:22 PM
RE: select returning null values Posted by Jun Tangunan @ 3/27/2013 11:47:46 PM