opensubscriber
   Find in this group all groups
 
Unknown more information…

d : database@list.cfdeveloper.co.uk 26 September 2006 • 3:27PM -0400

RE: [CF-Database] String Concatenation
by Lee Fortnam

REPLY TO AUTHOR
 
REPLY TO GROUP




Thanks Guys,

Should have spotted that!!!

Nick, why would you use a character column in particular?

Lee

-----Original Message-----
From: database-bounces@list...
[mailto:database-bounces@list...] On Behalf Of Nick de Voil
Sent: 26 September 2006 08:13
To: database programming
Subject: Re: [CF-Database] String Concatenation

> I have a stored procedure where I am passing a var called @SMSCancel
> bigint
>
> I need to pass this along with some other text into a nvarchar field,
> at the moment I have the following in my SP:
>
> -- insert the sponsor message
> INSERT INTO
> APPM8_WLCSponsors
> (ClientID, SponsorText)
> VALUES
> (@LocationID, 'To stop alerts, text No to +' + @SMSCancel + '.')


String concatenation only works on strings, therefore you have to CONVERT or
CAST your integer to a string.

@LocationID, 'To stop alerts, text No to +' + CAST(@SMSCancel AS char(12)) +
'.'

FWIW I would normally define a phone number as a character column in the
database.

Nick



_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help
>-<

_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.