Ask a Question related to ASP Database, Design and Development.
-
Lamine Darbouche #1
Replace function
Please help,
I want to replace a string within field in a table with a nother string.
I am using the replace function but I am doing something wrong.
my code is:
UPDATE authors SET au_lname = Replace(au_lname,'cheryl','frannk')
What am I doing wrong?
Regards
Lamine
Lamine Darbouche Guest
-
Trouble using Replace() function in CFN file
I don't do much scripting in coldfusion besides some of the very basics for trasfering info from the database, so I'm not sure how to write this....... -
Problem with VB replace function for CRLF...I think
I'm not sure if this is the best place for this post, sorry if it is not... Here is what I am doing: I have created a small kbase (SQL db)... -
Search & Replace Function?
I have some textfield that users will enter data into on my web site and then I'll use php and write it to mysql - for security purposes, is there... -
Using Replace function to remove two different characters
I'm using replace function to strip 0s from a particular string: <%=replace(rs1("racelength"),"0","''"%> but I need to also strip empty spaces... -
Text Replace function
Hi - I'm using the replace function to hilite search words in text which is returned. However, as the text which is being searched also includes... -
Paul White #2
Re: Replace function
"Lamine Darbouche" <lamine_d@mpt-ltd.com> wrote in message
news:eMnLwKoVDHA.2316@TK2MSFTNGP09.phx.gbl...> What am I doing wrong?
> Regards
> Lamine
Try this ...
UPDATE authors SET au_lname = 'frannk' where au_lname = 'cheryl'
Paul White Guest
-
Bob Barrows #3
Re: Replace function
Lamine Darbouche wrote:
What database?> Please help,
> I want to replace a string within field in a table with a nother
> string. I am using the replace function but I am doing something
> wrong.
> my code is:
> UPDATE authors SET au_lname = Replace(au_lname,'cheryl','frannk')
> What am I doing wrong?
> Regards
> Lamine
Why do you think you are doing something wrong?
Bob Barrows
Bob Barrows Guest
-
Aaron Bertrand - MVP #4
Re: Replace function
> UPDATE authors SET au_lname = Replace(au_lname,'cheryl','frannk')
Not sure. What is the problem? Are you getting an error message? If so,> What am I doing wrong?
what is it? If not, what is the symtpom? e.g. is the replace not happening
at all, is it replacing all values, is it replacing 'cheryl' with 'frannk'
when you meant to replace 'frannk' with 'cheryl'?
That's perfectly valid syntax in SQL Server. Access, not sure.
Aaron Bertrand - MVP Guest
-
Lamine Darbouche #5
Re: Replace function
Great guys,
Many thanks to both of you.
Patrice, the answer to your yes replace is also a sql function.
It works fine now.
Regards
Lamine
"Patrice FRITSCH" <patrice.fritsch@NOSPAM.com> wrote in message
news:O428Z$oVDHA.2272@TK2MSFTNGP11.phx.gbl...> is replace a SQL functions ?
> I know it as a VB function !
> If you want to replace every record where au_lname is "cheryl" by "frank",
> then Pauls solution will word.
> But not if "cheryl" is part of the field value.
>
>
> "Lamine Darbouche" <lamine_d@mpt-ltd.com> a écrit dans le message de news:
> [email]eMnLwKoVDHA.2316@TK2MSFTNGP09.phx.gbl[/email]...>> > Please help,
> > I want to replace a string within field in a table with a nother string.
> > I am using the replace function but I am doing something wrong.
> > my code is:
> > UPDATE authors SET au_lname = Replace(au_lname,'cheryl','frannk')
> > What am I doing wrong?
> > Regards
> > Lamine
> >
> >
>
Lamine Darbouche Guest
-
Cpt_America23 #6
replace Function
It seems that the replace function only replaces the first occorence of the
string you are replacing. for example if I have a string:
var heros:string = "I love superheros";
and i want to replace all of the spaces:
heros = heros.replace(" ","");
what i would end up with is this:
Ilove superheros
am i using this function wrong? or is it only supposed to do this? is there
another way to format my string if this is not working?
sorry for all of the questions, and thanks in advance.
Cpt_America23 Guest
-
ntsiii #7
Re: replace Function
Huh? Actionscript doesn't even have a native replace function. Where did you
find it? I use:
function replace(sString:String, sFind:String, sReplace:String):String
{
return sString.split( sFind ).join( sReplace );
}
If this is Flex 2, you will have better luck over in the Labs area.
Tracy
ntsiii Guest
-



Reply With Quote

