Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NVL Function for Dbase

Status
Not open for further replies.

Alexrp25

Technical User
Dec 27, 2002
4
0
0
BR
Can anyone tell what is the equivalent of NVL in SQL for Dbase? What is the syntax of this function like?
Thanks for any help.

Alex.
 
Morning, I am not aware of a function called NVL. Could you explain the use of this function in the native language and then maybe someone can provide the solution. I searched the OLH for SQL 2000, dBase 2.01 and Visual dBase 5.7 with no results. Thanks R2
 
R2:
NVL(expr1,expr2) returns expr2 if expr1 is null. Otherwise it returns expr1.

Alex:
I was tring to figure this out the other day and just now got back to your post. What version of dBase are you working with? That will help to find possible alternatives for you. I know that dBaseIV for example includes the IIF() function that you may be able to apply in an SQL statement. E.g. IIF(expr1, "0","1"). This returns character 0 if expr1 = .T. otherwise it returns character 1.
So....... IIF(val1=CHR(0),val2,val1) would be similar to NVL(val1,val2). I don't have dBase available to me at the moment so I can't test this - it may or may not work or work correctly - test it. I'm not sure you can use an IIF() in SQL against a dBase table.

HTH,
Dennis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top