Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id D4AB19FBDBF for ; Fri, 16 Mar 2007 06:03:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 68499-03-2 for ; Fri, 16 Mar 2007 06:03:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from interscan.indicator.com (mail.indicator.be [193.121.199.3]) by postgresql.org (Postfix) with ESMTP id BB6729FBDEF for ; Fri, 16 Mar 2007 06:03:27 -0300 (ADT) Received: from webaccess.indicator.be ([10.100.1.7]) by interscan.indicator.com with InterScan Message Security Suite; Fri, 16 Mar 2007 09:50:36 +0100 Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Fri, 16 Mar 2007 10:03:25 +0100 Message-Id: <45FA6B62.A3DD.0030.0@indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Fri, 16 Mar 2007 10:03:15 +0100 From: "Bart Degryse" To: Cc: "Shavonne Marietta Wijesinghe" Subject: Re: INSERT INTO References: <002c01c767a8$20d5d600$1102a8c0@dream> In-Reply-To: <002c01c767a8$20d5d600$1102a8c0@dream> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__PartC9ED7B43.0__=" X-imss-version: 2.046 X-imss-result: Passed X-imss-approveListMatch: *@indicator.be X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/218 X-Sequence-Number: 27856 --=__PartC9ED7B43.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I don't use ASP but in PHP I would do something in the line of =20 $valuetoinsert =3D "SANT'ANGELO LODIGIANO"; $query =3D "INSERT INTO TABLE2 (TE_INDI) VALUES ('" . str_replace("'", = "''", $valuetoinsert) . "')"; =20 I'm sure ASP has also a string replacement function >>> "Shavonne Marietta Wijesinghe" = 2007-03-16 9:50 >>> Hello =20 I have 2 tables. TABLE1 and TABLE2. =20 TABLE1 has about 400 records with details (client code, name, surname, = address, date of birth) of my clients. TABLE2 is filled with some of the client details and other extra details = (client code, address, telephone, etc) =20 So in my ASP page i have a select that gets the client details from TABLE1 = using the client code and inserts them in to TABLE2 =20 When i have a string that has a ' inside of it the record is not inserted = in to TABLE2. I know that writing it twice will fix it but how can i ask = my ASP code to do it.. =20 INSERT INTO TABLE2 (TE_INDI) VALUES ('SANT'ANGELO LODIGIANO'); =20 Thanks =20 Shavonne Wijesinghe http://www.studioform.it ( http://www.studioform.it/ ) =20 =20 --=__PartC9ED7B43.0__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
I don't use ASP but in PHP I would do something in the line of
 
$valuetoinsert =3D "SANT'ANGELO LODIGIANO";
$query =3D "INSERT INTO TABLE2 (TE_INDI) VALUES ('" . str_replace("'",= "''", $valuetoinsert) . "')";
 
I'm sure ASP has also a string replacement function

>>>= ; "Shavonne Marietta Wijesinghe" <shavonne.marietta@studioform.it> = 2007-03-16 9:50 >>>
Hello
 
I have 2 tables. TABLE1 and TABLE2.=
 
TABLE1 has about 400 records with details = (client code, name, surname, address, date of birth) of my clients.<= /DIV>
TABLE2 is filled with some of the client = details and other extra details (client code, address, telephone, = etc)
 
So in my ASP page i have a select that = gets the client details from TABLE1 using the client code and inserts them = in to TABLE2
 
When i have a string that has a ' inside = of it the record is not inserted in to TABLE2. I know that writing it = twice will fix it but how can i ask my ASP code to do it..
 
INSERT INTO TABLE2 (TE_INDI) = VALUES ('SANT'ANGELO LODIGIANO');
=
 
Thanks
 
Shavonne Wijesinghe
http://www.studioform.it
 

 
--=__PartC9ED7B43.0__=--