Re: INSERT INTO

From: "Bart Degryse" <Bart(dot)Degryse(at)indicator(dot)be>
To: <pgsql-sql(at)postgresql(dot)org>
Cc: "Shavonne Marietta Wijesinghe" <shavonne(dot)marietta(at)studioform(dot)it>
Subject: Re: INSERT INTO
Date: 2007-03-16 09:03:15
Message-ID: 45FA6B62.A3DD.0030.0@indicator.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I don't use ASP but in PHP I would do something in the line of

$valuetoinsert = "SANT'ANGELO LODIGIANO";
$query = "INSERT INTO TABLE2 (TE_INDI) VALUES ('" . str_replace("'", "''", $valuetoinsert) . "')";

I'm sure ASP has also a string replacement function

>>> "Shavonne Marietta Wijesinghe" <shavonne(dot)marietta(at)studioform(dot)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.
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 ( http://www.studioform.it/ )


In response to

  • INSERT INTO at 2007-03-16 08:50:20 from Shavonne Marietta Wijesinghe

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Guillaume Lelarge 2007-03-16 09:16:58 Re: INSERT INTO
Previous Message Shavonne Marietta Wijesinghe 2007-03-16 08:50:20 INSERT INTO