Discussion:
[NF] SQL equivalent for STRTRAN/CHRTRAN ?
MB Software Solutions, LLC
2012-05-04 14:53:15 UTC
Permalink
Is there a SQL equivalent function for replacing characters like we have
in the STRTRAN/CHRTRAN functions?
--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16
Paul Hill
2012-05-04 15:29:45 UTC
Permalink
Hi Mike,

It's Replace()

SELECT REPLACE('The quick brown fox', ' ', '_')
=> The_quick_brown_fox

Paul

On 4 May 2012 15:53, MB Software Solutions, LLC
Post by MB Software Solutions, LLC
Is there a SQL equivalent function for replacing characters like we have
in the STRTRAN/CHRTRAN functions?
--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16
[excessive quoting removed by server]
Dave Crozier
2012-05-04 15:30:16 UTC
Permalink
Replace()

Dave

-----Original Message-----
From: profox-***@leafe.com [mailto:profox-***@leafe.com] On Behalf Of MB Software Solutions, LLC
Sent: 04 May 2012 15:53
To: ProFox Email List
Subject: [NF] SQL equivalent for STRTRAN/CHRTRAN ?

Is there a SQL equivalent function for replacing characters like we have in the STRTRAN/CHRTRAN functions?

--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16

[excessive quoting removed by server]
Dave Crozier
2012-05-04 15:32:00 UTC
Permalink
and use Charindex() to search for an expression in another expression.... like AT()

Dave

-----Original Message-----
From: profox-***@leafe.com [mailto:profox-***@leafe.com] On Behalf Of MB Software Solutions, LLC
Sent: 04 May 2012 15:53
To: ProFox Email List
Subject: [NF] SQL equivalent for STRTRAN/CHRTRAN ?

Is there a SQL equivalent function for replacing characters like we have in the STRTRAN/CHRTRAN functions?

--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16

[excessive quoting removed by server]
Dave Crozier
2012-05-04 15:33:22 UTC
Permalink
...and I forgot also Patindex() to search for a string in another string.... remember positions relative to 0 not 1!!!!!

Dave

-----Original Message-----
From: profox-***@leafe.com [mailto:profox-***@leafe.com] On Behalf Of Dave Crozier
Sent: 04 May 2012 16:32
To: ProFox Email List
Subject: RE: [NF] SQL equivalent for STRTRAN/CHRTRAN ?

and use Charindex() to search for an expression in another expression.... like AT()

Dave

-----Original Message-----
From: profox-***@leafe.com [mailto:profox-***@leafe.com] On Behalf Of MB Software Solutions, LLC
Sent: 04 May 2012 15:53
To: ProFox Email List
Subject: [NF] SQL equivalent for STRTRAN/CHRTRAN ?

Is there a SQL equivalent function for replacing characters like we have in the STRTRAN/CHRTRAN functions?

--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16

[excessive quoting removed by server]
MB Software Solutions, LLC
2012-05-04 16:42:32 UTC
Permalink
Post by Dave Crozier
...and I forgot also Patindex() to search for a string in another string.... remember positions relative to 0 not 1!!!!!
Dave
-----Original Message-----
Sent: 04 May 2012 16:32
To: ProFox Email List
Subject: RE: [NF] SQL equivalent for STRTRAN/CHRTRAN ?
and use Charindex() to search for an expression in another expression.... like AT()
Dave
Thanks, Paul & Dave!
--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16
Rick Schummer
2012-05-06 04:21:19 UTC
Permalink
Is there a SQL equivalent function for replacing characters like we have in the STRTRAN/CHRTRAN functions?<<
Not sure if you were referring to SQL Server or MySQL, but one of my all-time favorite Visual FoxPro Wiki entries:

http://fox.wikis.com/wc.dll?Wiki~VFPSQL-TSQL-Mapping~VFP


Rick
White Light Computing, Inc.

www.whitelightcomputing.com
www.swfox.net
www.rickschummer.com
MB Software Solutions, LLC
2012-05-07 20:33:08 UTC
Permalink
Post by Rick Schummer
Is there a SQL equivalent function for replacing characters like we have in the STRTRAN/CHRTRAN functions?<<
http://fox.wikis.com/wc.dll?Wiki~VFPSQL-TSQL-Mapping~VFP
Hey Rick,

Yeah, I should have specified MySQL, not SQL Server.
--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16
MB Software Solutions, LLC
2012-05-07 21:34:47 UTC
Permalink
Post by Rick Schummer
Is there a SQL equivalent function for replacing characters like we have in the STRTRAN/CHRTRAN functions?<<
http://fox.wikis.com/wc.dll?Wiki~VFPSQL-TSQL-Mapping~VFP
Great link...thanks!
--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16
Loading...