The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Databases
> Firebird SQL Development
|
'Select a||b||c as test' issue
Discuss 'Select a||b||c as test' issue in the Firebird SQL Development forum on Dev Shed. 'Select a||b||c as test' issue Firebird SQL Development forum discussing administration, Firebird SQL syntax, or other Firebird SQL-related topics. Firebird is the evolution of Borland's Interbase product.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

July 9th, 2003, 03:42 AM
|
|
Junior Member
|
|
Join Date: Jul 2003
Location: malaysia
Posts: 13
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
'Select a||b||c as test' issue
I write a sql statement to add 4 string to 1 , it gives strange result
Select a||b||c as test
if field c is null , then the result test is null . Otherwise it is normal .
Is this a bug , or I need to modify the statement .
any help is appreciated.
|

July 9th, 2003, 06:47 PM
|
|
Contributing User
|
|
Join Date: Jan 2003
Location: No es importante
Posts: 2,065

Time spent in forums: 6 h 50 m 52 sec
Reputation Power: 13
|
|
|
This is ansi sql standards. Try using
select ifnull(a, '') || ifnull(b, '') || ifnull(c, '') as test
|

July 9th, 2003, 09:36 PM
|
|
Junior Member
|
|
Join Date: Jul 2003
Location: malaysia
Posts: 13
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Thanks for advise . Unfortunately it doesn't work ,error 'function unknown'
|

July 10th, 2003, 03:53 AM
|
|
Contributing User
|
|
Join Date: Jan 2003
Location: Paris Uppland
|
|
|
use coalesce unstead of nullif
|

July 10th, 2003, 05:16 AM
|
|
Junior Member
|
|
Join Date: Jul 2003
Location: malaysia
Posts: 13
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Sorry I don't understand . Would you mind showing me the statement .
thx so much
|

July 10th, 2003, 05:44 AM
|
|
Contributing User
|
|
Join Date: Jan 2003
Location: Paris Uppland
|
|
Code:
select coalesce(a, '') || coalesce(b, '') || coalesce(c, '') as test
|

July 10th, 2003, 06:54 AM
|
|
Junior Member
|
|
Join Date: Jul 2003
Location: malaysia
Posts: 13
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Thanks SwamBoogie.
I try this before your post ,but remain "function unknown"
|

July 10th, 2003, 04:40 PM
|
|
Contributing User
|
|
Join Date: Jan 2003
Location: Paris Uppland
|
|
|
Well as coalesce is standard I assumed it was supported.
You could try
select nz(a, '')
Maybe you have to write an IB function for this.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|