This is a multi-part message in MIME format.

------=_NextPart_000_0007_01BFC8C1.E6E3DF00
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi!
    How do I dynamically replace text in multiple rows in my database?
Background:  Have two tables:
Table 1 fields include: ContactID, Groups
    The groups field is a text field that is filled dynamically through =
a series of checkboxes. Example, the field might contain a text string =
like, "Group1, Group2, Group4".

Table 2 fields include: GroupID, GroupName

The user has the option to edit a group name in table two through an =
editing form.  I can get it to update table two through a standard =
CFUPDATE, but I'm having trouble getting the changed group name to =
filter through the table 1 "Goups" field.  I've tried using the replace =
function in an Update, but the results are not good.

<cfquery datasource=3D"datasource">
 UPDATE Table1
 SET Groups=3D'#Replace(Groups, "OldGroup", "GroupName", "ALL")#'
</cfquery>

Where OldGroup=3DGroup name before change and GroupName=3DGroup name =
after change

Not Working...AHHHHHHHHH...OK, feel better.  HELP!
                Thanks,  Christine

------=_NextPart_000_0007_01BFC8C1.E6E3DF00
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; How do I dynamically =
replace=20
text in multiple rows in my database?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Background:&nbsp; Have two =
tables:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Table 1 fields include: ContactID,=20
Groups</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; The groups field is =
a text field=20
that is filled dynamically through a series of checkboxes. Example, the =
field=20
might contain a text string like, "Group1, Group2, Group4".</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Table 2 fields include: GroupID,=20
GroupName</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The user has the option to edit a group =
name in=20
table two through an editing form.&nbsp; I can get it to update table =
two=20
through a standard CFUPDATE, but I'm having trouble getting the changed =
group=20
name to filter through the table 1 "Goups" field.&nbsp; I've tried using =
the=20
replace function in an Update, but the results are not =
good.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;cfquery=20
datasource=3D"datasource"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;UPDATE Table1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;SET Groups=3D'#Replace(Groups, =
"OldGroup",=20
"GroupName", "ALL")#'</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;/cfquery&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Where OldGroup=3DGroup name before =
change and=20
GroupName=3DGroup name after change</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Not Working...AHHHHHHHHH...OK, feel =
better.&nbsp;=20
HELP!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Thanks,&nbsp;=20
Christine</FONT></DIV></BODY></HTML>

------=_NextPart_000_0007_01BFC8C1.E6E3DF00--

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to