The @name field can contain a single quote in it such as: Mike O'Grady.
Since this is creating and SQL statement on the server side, it will not process the name if it has a single quote in it. Id' like to replace that single quote with 2 single quotes without destroying th rest of th data in the field. Currently I replace a single quote with a "^" and then do a replace of that on the server side, see last <zz>. That statement is ecexuted on the other side. Please help, if there is help......Don.
Here;s the crude XSL doc: - <?xml version="1.0"?>
-
<!-- ******************************************************************** -->
-
<!-- * This XSL is used to transform the mampcp document to * -->
-
<!-- * SQL script that will insert the decomposed data to our mampcpwrk file * -->
-
<!-- * table. * -->
-
<!-- ******************************************************************** -->
-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
-
xmlns:php="http://php.net/xsl">
-
<xsl:output method="text" indent = "no" encoding="UTF-8"/>
-
<!-- Process complete tree starting from root-->
-
<xsl:template match="pccList">
-
<!-- Process each repeating MEMBER-INFO -->
-
<xsl:variable name="old">'</xsl:variable>
-
<xsl:variable name="new">^</xsl:variable>
-
<xsl:for-each select="pcc">
-
insert into mampcpwrk (name,prcode,wrkph2,adrln1,zipcod,zipcod4,titlcd,
-
provno,wrkph1,adrln2,citycd,stacod)
-
values ('<xsl:value-of select="translate(@name,$old,$new)"/>',
-
'<xsl:value-of select="translate(@cde_service_loc,$old,$new)"/>',
-
'<xsl:value-of select="translate(@num_phone,$old,$new)"/>',
-
'<xsl:value-of select="translate(@adr_mail_strt1,$old,$new)"/>',
-
'<xsl:value-of select="translate(@adr_mail_zip,$old,$new)"/>',
-
'<xsl:value-of select="translate(@adr_mail_zip_4,$old,$new)"/>',
-
'<xsl:value-of select="translate(@nam_title,$old,$new)"/>',
-
'<xsl:value-of select="translate(@id_provider,$old,$new)"/>',
-
'<xsl:value-of select="translate(@num_area_code,$old,$new)"/>',
-
'<xsl:value-of select="translate(@adr_mail_strt2,$old,$new)"/>',
-
'<xsl:value-of select="translate(@adr_mail_city,$old,$new)"/>',
-
'<xsl:value-of select="translate(@adr_mail_state,$old,$new)"/>');
-
</xsl:for-each>
-
<zz>update mampcpwrk set name=replace(name,'^','''');</zz>
-
</xsl:template>
-
</xsl:stylesheet>
0 2072 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jakanapes |
last post by:
Hi all,
I'm looking for a way to scan a block of text and replace all the
double quotes (") with single quotes (').
I'm using PHP to pull text out of a mySQL table and then feed the text
into...
|
by: sankofa |
last post by:
hi, i can't seem to be able to escape my single quote properly... is it
even possible in javascript?
this is a portion of my code..
var DLEWIS="Pastor Lewis";
.... Sermon is a yser-defined...
|
by: Joel |
last post by:
Hi,
I incorporated a function in my code that whenever I use a string variable
in an sql statement if the string contains a single quote it will encase it
in double quotes else single quotes.
...
|
by: Greg |
last post by:
I keep getting an error when I have a tick mark in a text value that I am
searching for in my XPath Query.
Example:
<Authors>
<Author LastName="O'Donnel">
<Author LastName="Smith">...
|
by: asd987 |
last post by:
Hi,
Ihave to print a field (type memo) to a file. I know how to do that ;-), but
there's one complication: all single quotes (') in the record must be
replaced by <backslash> + <single quote>...
|
by: gar |
last post by:
Hi,
I need to replace all the double quotes (") in a textbox with single quotes ('). I used this code
text= Replace(text, """", "'"
This works fine (for normal double quotes).The problem...
|
by: Justin Fancy |
last post by:
Hi everyone,
I need to replace all instances of a double quote(") with two single
quotes('') in a text file. I already have some replacements of strings
going on, but I tried this one, but the...
|
by: Reporter |
last post by:
I got the following example from http://www.evolt.org/article/User_Friendly_Forms_in_PHP/20/60144/index.html
:
echo '<tr><td>First name:</td><td><input type="text" name="first_name"...
|
by: samslists |
last post by:
Hi...
Here's a weird problem...I'm trying to escape a bunch of data to put
into a database.
Here's what I have:
def escape(string):
"""
Escape both single quotes and blackslashes
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |