Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
| Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2005, 02:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Naperville, IL, USA.
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Since you only want the '|' internally make the following modification:

Code:
SET @s4 = isnull(@s1 + '|', '') + isnull(@s2 + '|', '') + isnull(@s3, '')
Rand
 
Old May 6th, 2005, 02:41 PM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

rgerald
             Thx.........finally i got it...that works man..thx a lot..

 
Old May 6th, 2005, 03:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Naperville, IL, USA.
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What was your final version?

How does it handle all three strings being null? Do you get a blank, a '|' or a NULL? Will there always be at least one non-null string?

Rand
 
Old May 6th, 2005, 04:05 PM
Friend of Wrox
 
Join Date: Jan 2004
Location: , , USA.
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ya..post the code

 
Old May 6th, 2005, 04:49 PM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

there are no chances that all the fields will be null...atleast one will be there always...so it worked....but if all 3 values r null..then its giving error..but thats not in the requirment...i forwarded it to my boss and he is happy...;) ..thx guys...its time for leaving home..have a nice weekend...see u all later

 
Old May 6th, 2005, 05:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Naperville, IL, USA.
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have a variant that will work even if all three fields are null. I can post it on Monday, if anyone wants to see it.



Rand




Similar Threads
Thread Thread Starter Forum Replies Last Post
help pls with connection string arian29 VB Databases Basics 10 August 29th, 2008 11:17 PM
I need help!!!!!!!!!!!!!!!!!!!!!!!!!!!! pls!!!!!!! ironchef Java Basics 2 September 26th, 2006 02:35 PM
Pls help me!! hoailing22 ASP.NET 1.0 and 1.1 Basics 4 June 10th, 2005 11:24 PM
Concatination BSkelding MySQL 1 August 18th, 2004 09:47 PM
Concatination kilika SQL Server 2000 1 August 26th, 2003 10:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.