List:MySQL on Win32« Previous MessageNext Message »
From:Paul DuBois Date:August 2 2002 3:40pm
Subject:Re: Nested dialogs in input data
View as plain text  
At 17:23 +0200 8/2/02, Doru-Catalin Togea wrote:
>Hi all!
>
>I have another question:
>
>I want to insert Bible text into a mysql database, and it sometimes
>contains nested dialogs, like:
>
>Gen 3:2 And the woman said to the serpent, "We may eat the fruit of the
>trees of the garden;
>Gen 3:3 "but of the fruit of the tree which [is] in the midst of the
>garden, God has said, 'You shall not eat it, nor shall you touch it, lest
>you die.' "
>
>I guess by now you understand my problem. However,
>
>I want to insert each of the lines in its own row. The first line presents
>no problems, even though it contains a >"< character, because my sql
>statement would include the whole string in single quotes:
>
>	insert .... values (...., 'And the woman said to the serpent, "We
>may eat the fruit of the trees of the garden;');
>
>The second line, however, contains nested dialogs where both double and
>single quotes are used as part of the text (that is as part of the
>input data), so that the first occurence of the single quote in the text
>will be interpreted as the end of the data, making the rest of the text
>superfluous parameters to my sql statement.
>
>	insert .... values (...., '"but of the fruit of the tree 
>which [is] in the
>midst of the garden, God has said, 'You shall not eat it, nor shall you
>touch it, lest you die.' "');
>
>What are my options?

The MySQL manual is your friend:

http://www.mysql.com/doc/S/t/String_syntax.html
Thread
Nested dialogs in input dataDoru-Catalin Togea2 Aug
  • Re: Nested dialogs in input dataPaul DuBois2 Aug