RE: Replacing Strings

2007-11-01 Thread Marius Milosav
Try:
#REReplace('dill"s','"',"'","ALL")#

Marius Milosav 
ScorpioSoft Corp.
www.scorpiosoft.com

-Original Message-
From: Rick Sanders [mailto:[EMAIL PROTECTED] 
Sent: November 1, 2007 8:47 AM
To: CF-Talk
Subject: Replacing Strings

Hey list,

 

I'm trying to replace a double quote in a text field to a single quote. I've
tried using ReReplace, but it still crashes the Cold Fusion server.

What I've done is this:

#REReplace("dill"s",""","'","ALL")#

 

See, users tend to like using double quotes in a text field which breaks the
SQL query. How can i check if there's a double quote in a #form.textfield#
and remove it?

 

Thanks in advance.

 

Rick Sanders

Webenergy

Canada: 902-401-7689

USA:   919-799-9076

Canada: www.webenergy.ca

USA:   www.webenergyusa.com

 







~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292465
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Replacing Strings

2007-11-01 Thread Andy Matthews
use single quotes in your replace function (and you don't need REReplace
just FYI).

REReplace('dill"s','"',"'","ALL")

-Original Message-
From: Rick Sanders [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 01, 2007 7:47 AM
To: CF-Talk
Subject: Replacing Strings

Hey list,

 

I'm trying to replace a double quote in a text field to a single quote. I've
tried using ReReplace, but it still crashes the Cold Fusion server.

What I've done is this:

#REReplace("dill"s",""","'","ALL")#

 

See, users tend to like using double quotes in a text field which breaks the
SQL query. How can i check if there's a double quote in a #form.textfield#
and remove it?

 

Thanks in advance.

 

Rick Sanders

Webenergy

Canada: 902-401-7689

USA:   919-799-9076

Canada: www.webenergy.ca

USA:   www.webenergyusa.com

 







~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292467
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Replacing Strings

2007-11-01 Thread Kris Jones
ReReplace is for using a regular expression. Try Replace. You'll also
need to quadruple the double quotes, something like this should work:
#Replace("dill""s", , "'", "ALL")#

That is, the content of each expression is enclosed in double quotes
in this example. When the expression itself contains a double-quote,
you have to double-that up to escape it. Sometimes when I just don't
want to deal with it, I'll enclose the expressions that contain
double-quotes in single quotes to make it easier to read, something
like:
#Replace('dill"s', '"', "'", 'ALL")#

If the only issue you face with the double-quotes is in queries, make
sure to use cfqueryparam, which handles escaping the double quotes,
single quotes, etc. If you need to capture the user input in another
form field, you might want to try replacing with the html safe
equivalent "
#replace(mystring, , """, "ALL")#

Hope that helps.

Cheers,
Kris


> I'm trying to replace a double quote in a text field to a single quote. I've
> tried using ReReplace, but it still crashes the Cold Fusion server.
>
> What I've done is this:
>
> #REReplace("dill"s",""","'","ALL")#
>
> See, users tend to like using double quotes in a text field which breaks the
> SQL query. How can i check if there's a double quote in a #form.textfield#
> and remove it?

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292463
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Replacing Strings

2007-11-01 Thread Dana Kowalski
are you using cfqueryparam's on your query? It should escape them on its own I 
would think.


~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292468
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Replacing Strings

2007-11-01 Thread Ben Doom
replace('dill"s', '"', "'", "all")

In other words, where you are explicitly writing double-quotes (like for 
the find string) wrap in single quotes, and where you are explicitly 
writing single quotes (like the replace string) wrap in double quotes.

--Ben Doom

Rick Sanders wrote:
> Hey list,
> 
>  
> 
> I'm trying to replace a double quote in a text field to a single quote. I've
> tried using ReReplace, but it still crashes the Cold Fusion server.
> 
> What I've done is this:
> 
> #REReplace("dill"s",""","'","ALL")#
> 
>  
> 
> See, users tend to like using double quotes in a text field which breaks the
> SQL query. How can i check if there's a double quote in a #form.textfield#
> and remove it?
> 
>  
> 
> Thanks in advance.
> 
>  
> 
> Rick Sanders
> 
> Webenergy
> 
> Canada: 902-401-7689
> 
> USA:   919-799-9076
> 
> Canada: www.webenergy.ca
> 
> USA:   www.webenergyusa.com
> 
>  
> 
> 
> 
> 
> 
> 

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292466
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Replacing Strings

2007-11-01 Thread Rick Sanders
Didn't think of that, but it's less code to do a replace than the
cfqueryparam.


Rick Sanders
Canada: 902-401-7689
USA:   919-799-9076
Canada: www.webenergy.ca
USA:   www.webenergyusa.com


-Original Message-
From: Dana Kowalski [mailto:[EMAIL PROTECTED] 
Sent: November-01-07 11:42 AM
To: CF-Talk
Subject: Re: Replacing Strings

are you using cfqueryparam's on your query? It should escape them on its own
I would think.




~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292471
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Replacing Strings

2007-11-01 Thread Rick Sanders
Hi Andy,

Thanks for your response. I can't believe I made the rookie mistake of not
using single quotes instead of double quotes in the expression!

Kind regards,

Rick Sanders
Canada: 902-401-7689
USA:   919-799-9076
Canada: www.webenergy.ca
USA:   www.webenergyusa.com

-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED] 
Sent: November-01-07 10:46 AM
To: CF-Talk
Subject: RE: Replacing Strings

use single quotes in your replace function (and you don't need REReplace
just FYI).

REReplace('dill"s','"',"'","ALL")

-Original Message-
From: Rick Sanders [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 01, 2007 7:47 AM
To: CF-Talk
Subject: Replacing Strings

Hey list,

 

I'm trying to replace a double quote in a text field to a single quote. I've
tried using ReReplace, but it still crashes the Cold Fusion server.

What I've done is this:

#REReplace("dill"s",""","'","ALL")#

 

See, users tend to like using double quotes in a text field which breaks the
SQL query. How can i check if there's a double quote in a #form.textfield#
and remove it?

 

Thanks in advance.

 

Rick Sanders

Webenergy

Canada: 902-401-7689

USA:   919-799-9076

Canada: www.webenergy.ca

USA:   www.webenergyusa.com

 









~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292470
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Replacing Strings

2007-11-01 Thread Ben Doom
Not to put too fine a point on it, but if this data is coming directly 
from an end user, it would probably be in your best interest to add the 
 anyway.  It does quite a bit more than just quote 
escaping.  Definitely a best practice recommendation.

--Ben Doom

Rick Sanders wrote:
> Didn't think of that, but it's less code to do a replace than the
> cfqueryparam.
> 
> 
> Rick Sanders
> Canada: 902-401-7689
> USA:   919-799-9076
> Canada: www.webenergy.ca
> USA:   www.webenergyusa.com
> 
> 
> -Original Message-
> From: Dana Kowalski [mailto:[EMAIL PROTECTED] 
> Sent: November-01-07 11:42 AM
> To: CF-Talk
> Subject: Re: Replacing Strings
> 
> are you using cfqueryparam's on your query? It should escape them on its own
> I would think.
> 
> 
> 
> 
> 

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292472
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Replacing Strings

2007-11-01 Thread Charlie Griefer
On Nov 1, 2007 7:44 AM, Rick Sanders <[EMAIL PROTECTED]> wrote:
> Didn't think of that, but it's less code to do a replace than the
> cfqueryparam.

the cfqueryparam buys you more.

and you should be using it anyway.

-- 
Charlie Griefer


"...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed."

~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292473
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Replacing Strings

2007-11-01 Thread Rick Sanders
Thanks for your feedback,

I'm an ASP.net & XML programmer and new to Cold Fusion. I'll definitely look
into the cfqueryparam since it seems to be the best "Cold Fusion" way to
control user input, and not have your queries break down.

Kind regards,

Rick Sanders
Webenergy
Canada: 902-401-7689
USA:   919-799-9076
Canada: www.webenergy.ca
USA:   www.webenergyusa.com


-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED] 
Sent: November-01-07 12:10 PM
To: CF-Talk
Subject: Re: Replacing Strings

Not to put too fine a point on it, but if this data is coming directly 
from an end user, it would probably be in your best interest to add the 
 anyway.  It does quite a bit more than just quote 
escaping.  Definitely a best practice recommendation.

--Ben Doom

Rick Sanders wrote:
> Didn't think of that, but it's less code to do a replace than the
> cfqueryparam.
> 
> 
> Rick Sanders
> Canada: 902-401-7689
> USA:   919-799-9076
> Canada: www.webenergy.ca
> USA:   www.webenergyusa.com
> 
> 
> -Original Message-
> From: Dana Kowalski [mailto:[EMAIL PROTECTED] 
> Sent: November-01-07 11:42 AM
> To: CF-Talk
> Subject: Re: Replacing Strings
> 
> are you using cfqueryparam's on your query? It should escape them on its
own
> I would think.
> 
> 
> 
> 
> 



~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292474
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Replacing Strings

2007-11-01 Thread Adam Haskell
Bigger rookie mistake is not using cfqueryparam.

Adam Haskell
http://cfrant.blogspot.com

On 11/1/07, Rick Sanders <[EMAIL PROTECTED]> wrote:
>
> Hi Andy,
>
> Thanks for your response. I can't believe I made the rookie mistake of not
> using single quotes instead of double quotes in the expression!
>
> Kind regards,
>
> Rick Sanders
> Canada: 902-401-7689
> USA:   919-799-9076
> Canada: www.webenergy.ca
> USA:   www.webenergyusa.com
>
> -Original Message-
> From: Andy Matthews [mailto:[EMAIL PROTECTED]
> Sent: November-01-07 10:46 AM
> To: CF-Talk
> Subject: RE: Replacing Strings
>
> use single quotes in your replace function (and you don't need REReplace
> just FYI).
>
> REReplace('dill"s','"',"'","ALL")
>
> -Original Message-
> From: Rick Sanders [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 01, 2007 7:47 AM
> To: CF-Talk
> Subject: Replacing Strings
>
> Hey list,
>
>
>
> I'm trying to replace a double quote in a text field to a single quote.
> I've
> tried using ReReplace, but it still crashes the Cold Fusion server.
>
> What I've done is this:
>
> #REReplace("dill"s",""","'","ALL")#
>
>
>
> See, users tend to like using double quotes in a text field which breaks
> the
> SQL query. How can i check if there's a double quote in a #form.textfield#
> and remove it?
>
>
>
> Thanks in advance.
>
>
>
> Rick Sanders
>
> Webenergy
>
> Canada: 902-401-7689
>
> USA:   919-799-9076
>
> Canada: www.webenergy.ca
>
> USA:   www.webenergyusa.com
>
>
>
>
>
>
>
>
>
>
>
> 

~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292475
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Replacing Strings

2007-11-01 Thread Rick Sanders
"You've just received a virtual raspberry!"

Rick Sanders
Webenergy
Canada: 902-401-7689
USA:   919-799-9076
Canada: www.webenergy.ca
USA:   www.webenergyusa.com


-Original Message-
From: Adam Haskell [mailto:[EMAIL PROTECTED] 
Sent: November-01-07 12:28 PM
To: CF-Talk
Subject: Re: Replacing Strings

Bigger rookie mistake is not using cfqueryparam.

Adam Haskell
http://cfrant.blogspot.com

On 11/1/07, Rick Sanders <[EMAIL PROTECTED]> wrote:
>
> Hi Andy,
>
> Thanks for your response. I can't believe I made the rookie mistake of not
> using single quotes instead of double quotes in the expression!
>
> Kind regards,
>
> Rick Sanders
> Canada: 902-401-7689
> USA:   919-799-9076
> Canada: www.webenergy.ca
> USA:   www.webenergyusa.com
>
> -Original Message-
> From: Andy Matthews [mailto:[EMAIL PROTECTED]
> Sent: November-01-07 10:46 AM
> To: CF-Talk
> Subject: RE: Replacing Strings
>
> use single quotes in your replace function (and you don't need REReplace
> just FYI).
>
> REReplace('dill"s','"',"'","ALL")
>
> -Original Message-
> From: Rick Sanders [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 01, 2007 7:47 AM
> To: CF-Talk
> Subject: Replacing Strings
>
> Hey list,
>
>
>
> I'm trying to replace a double quote in a text field to a single quote.
> I've
> tried using ReReplace, but it still crashes the Cold Fusion server.
>
> What I've done is this:
>
> #REReplace("dill"s",""","'","ALL")#
>
>
>
> See, users tend to like using double quotes in a text field which breaks
> the
> SQL query. How can i check if there's a double quote in a #form.textfield#
> and remove it?
>
>
>
> Thanks in advance.
>
>
>
> Rick Sanders
>
> Webenergy
>
> Canada: 902-401-7689
>
> USA:   919-799-9076
>
> Canada: www.webenergy.ca
>
> USA:   www.webenergyusa.com
>
>
>
>
>
>
>
>
>
>
>
> 



~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292478
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Replacing Strings

2007-11-01 Thread Bobby Hartsfield
Even bigger would be saying "Cold Fusion" not once... but twice.

Definitely look into cfqeryparam if you aren't using it. If you accept info
from end users to put into your database and don't use cfqeryparam... you
are just asking for trouble. There are also other benefits. One would be...
not having to replace any kind of quotes. :-)

..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com


-Original Message-
From: Adam Haskell [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 01, 2007 11:28 AM
To: CF-Talk
Subject: Re: Replacing Strings

Bigger rookie mistake is not using cfqueryparam.

Adam Haskell
http://cfrant.blogspot.com

On 11/1/07, Rick Sanders <[EMAIL PROTECTED]> wrote:
>
> Hi Andy,
>
> Thanks for your response. I can't believe I made the rookie mistake of not
> using single quotes instead of double quotes in the expression!
>
> Kind regards,
>
> Rick Sanders
> Canada: 902-401-7689
> USA:   919-799-9076
> Canada: www.webenergy.ca
> USA:   www.webenergyusa.com
>
> -Original Message-
> From: Andy Matthews [mailto:[EMAIL PROTECTED]
> Sent: November-01-07 10:46 AM
> To: CF-Talk
> Subject: RE: Replacing Strings
>
> use single quotes in your replace function (and you don't need REReplace
> just FYI).
>
> REReplace('dill"s','"',"'","ALL")
>
> -Original Message-
> From: Rick Sanders [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 01, 2007 7:47 AM
> To: CF-Talk
> Subject: Replacing Strings
>
> Hey list,
>
>
>
> I'm trying to replace a double quote in a text field to a single quote.
> I've
> tried using ReReplace, but it still crashes the Cold Fusion server.
>
> What I've done is this:
>
> #REReplace("dill"s",""","'","ALL")#
>
>
>
> See, users tend to like using double quotes in a text field which breaks
> the
> SQL query. How can i check if there's a double quote in a #form.textfield#
> and remove it?
>
>
>
> Thanks in advance.
>
>
>
> Rick Sanders
>
> Webenergy
>
> Canada: 902-401-7689
>
> USA:   919-799-9076
>
> Canada: www.webenergy.ca
>
> USA:   www.webenergyusa.com
>
>
>
>
>
>
>
>
>
>
>
> 



~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292484
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Replacing Strings

2007-11-01 Thread James Holmes
It's the ColdFusion version of the best way, in any programming
language, to prevent SQL injection and ensure correct datatypes - bind
parameters. You should have been using them in ASP.net too.

On 11/2/07, Rick Sanders <[EMAIL PROTECTED]> wrote:
> Thanks for your feedback,
>
> I'm an ASP.net & XML programmer and new to Cold Fusion. I'll definitely look
> into the cfqueryparam since it seems to be the best "Cold Fusion" way to
> control user input, and not have your queries break down.
>
> Kind regards,
>
> Rick Sanders
> Webenergy
> Canada: 902-401-7689
> USA:   919-799-9076
> Canada: www.webenergy.ca
> USA:   www.webenergyusa.com
>
>
> -Original Message-
> From: Ben Doom [mailto:[EMAIL PROTECTED]
> Sent: November-01-07 12:10 PM
> To: CF-Talk
> Subject: Re: Replacing Strings
>
> Not to put too fine a point on it, but if this data is coming directly
> from an end user, it would probably be in your best interest to add the
>  anyway.  It does quite a bit more than just quote
> escaping.  Definitely a best practice recommendation.
>
> --Ben Doom
>
> Rick Sanders wrote:
> > Didn't think of that, but it's less code to do a replace than the
> > cfqueryparam.
> >
> >
> > Rick Sanders
> > Canada: 902-401-7689
> > USA:   919-799-9076
> > Canada: www.webenergy.ca
> > USA:   www.webenergyusa.com
> >
> >
> > -Original Message-
> > From: Dana Kowalski [mailto:[EMAIL PROTECTED]
> > Sent: November-01-07 11:42 AM
> > To: CF-Talk
> > Subject: Re: Replacing Strings
> >
> > are you using cfqueryparam's on your query? It should escape them on its
> own
> > I would think.
> >
> >
> >
> >
> >
>
>
>
> 

~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292523
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Replacing strings as part of a query

2004-06-08 Thread Deanna Schneider
What database are you using? This sounds like something that would be best
handled at the database level, instead of running it through CF.

- Original Message - 
From: "Richard Crawford"

> Actually, my question about replacing special characters (thanks to all
> who answered, by the way) was part of a larger question.  What I really
> need to do is select all rows of one table, modify the value of one
> field, and insert all of the rows, with that one modified field, into
> another table.
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Replacing strings as part of a query

2004-06-08 Thread Richard Crawford
Deanna Schneider wrote:

> What database are you using? This sounds like something that would be best
> handled at the database level, instead of running it through CF.

Deanna,

I'm using SQL Server 7.  The problem is that the field with the 
characters to be replaced is a TEXT field, and you can't use the REPLACE 
function on a TEXT field.  And, unfortunately, the data is too big in 
some of the records to CAST to VARCHAR.

Here is the SQL that I've tried using:

-

select
	msgID,
	msgSent,
	msgFromType,
	msgFromID,
	msgSubject,
	REPLACE (CAST(msgMessage AS varchar(8000)), CHAR(13), '') AS 
newMessage,
	msgOriginal,
	attID
into tblMessageNew
from tblMessage

--

In records where the value of msgMessage is greater than 8000 
characters, the SQL bombs and no results are returned.

-- 
Richard S. Crawford
Programmer III,
UC Davis Extension Distance Learning Group (http://unexdlc.ucdavis.edu)
(916)327-7793 / [EMAIL PROTECTED]
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Replacing strings as part of a query

2004-06-08 Thread Deanna Schneider
Don't know SQL Server. Sorry. But, as for your 500 error - make sure that
"show friendly http errors is turned off in your IE preferences. Then, you
should at least see more info.

- Original Message - 
From: "Richard Crawford"
> Deanna Schneider wrote:
>
> > What database are you using? This sounds like something that would be
best
> > handled at the database level, instead of running it through CF.
>
> Deanna,
>
> I'm using SQL Server 7.  The problem is that the field with the
> characters to be replaced is a TEXT field, and you can't use the REPLACE
> function on a TEXT field.  And, unfortunately, the data is too big in
> some of the records to CAST to VARCHAR.
>
> Here is the SQL that I've tried using:
>
> -
>
> select
> msgID,
> msgSent,
> msgFromType,
> msgFromID,
> msgSubject,
> REPLACE (CAST(msgMessage AS varchar(8000)), CHAR(13), '') AS
> newMessage,
> msgOriginal,
> attID
> into tblMessageNew
> from tblMessage
>
> --
>
> In records where the value of msgMessage is greater than 8000
> characters, the SQL bombs and no results are returned.
>
>
>
> -- 
> Richard S. Crawford
> Programmer III,
> UC Davis Extension Distance Learning Group (http://unexdlc.ucdavis.edu)
> (916)327-7793 / [EMAIL PROTECTED]
>
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Replacing strings as part of a query

2004-06-08 Thread Richard Crawford
Deanna Schneider wrote:

> Don't know SQL Server. Sorry. But, as for your 500 error - make sure that
> "show friendly http errors is turned off in your IE preferences. Then, you
> should at least see more info.

That in itself isn't an issue (I don't use IE if I can possibly avoid 
it).  I had hoped that I could find more information by checking the CF 
server log, but it was unrevealing.

-- 
Richard S. Crawford
Programmer III,
UC Davis Extension Distance Learning Group (http://unexdlc.ucdavis.edu)
(916)327-7793 / [EMAIL PROTECTED]
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]