Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : To substitute value null for zeroSearch Forum

Forum Home > FlexODBC - ODBC Driver for DataFlex Embedded DBMS > FlexODBC SQL Support Forum

 New Topic 
 
 Post Reply 
[1]  
 To substitute value null for zero 
 Author   Message 
  Aracelia 
  
 Group: Members 
 Posts: 3 
 Joined: 2007-05-09 
 Profile
 Posted : 2007-05-10 22:08:41

On the product FLEX ODBC, does some command that

substitutes the null value for zero in a consultation

exist? 
 
Example in Oracle 
nvl(x,0)  
or 
decode(x,null,0,x). 
 
Thank you. 
Miranda, Aracelia 
Brazil.

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-05-11 09:50:48

You can use:

SELECT Name, IsActive FROM ItemInventory WHERE Color IS NULL

however, you need to setup how empty strings are handled first:

 

  Top 
  Aracelia 
  
 Group: Members 
 Posts: 3 
 Joined: 2007-05-09 
 Profile
 Posted : 2007-05-12 00:28:29

yes, but I would like a command in the clause SELECT, I don't want to restrict lines. 
In the return of a consultation for instance: 
 
TABLE X 
Cod   Name       Invt 
  1        ANA              
  2        PETER       2  
  3       JONH          9  
 
in the first registration of that consultation where there is not registration in the column " Invt ", or be where it is null, I want some to come type of value for instance 0(zero). 
 
Example of the Command in Oracle: 
select Cod, 
             Name, 
             nvl(Invt,0) as Invt  
from    TABLE X 
 

Result:


TABLE X 
Cod  Name        Invt   
  1      ANA              0 ==> he/she sees the result as it was 
  2      PETER         2    
  3      JONH            9    
 
Thank you.

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-05-12 07:47:46
If the DataFlex field is numeric, it will return 0.00 anyway. A null string can be returned either as an empty string or a null. I might have been able to use replace, like I can using QODBC, but it's not supported in FlexODBC yet. 

  Top 
  Aracelia 
  
 Group: Members 
 Posts: 3 
 Joined: 2007-05-09 
 Profile
 Posted : 2007-05-14 21:50:04
but there is a detail, I am using a consultation that you/they involve tables with outer join, in that case, in the return not always there are registrations, and when that happens, in the result of the consultation it comes null values, it is that that I would like to avoid placing like this in the place of null the value 0(zero).   
   
at once I thank.  

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-05-16 23:23:49
If that's the case, you will need to make the outer join conditional to something like WHERE Color IS NOT NULL 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to