Hello P,
If you use parameterized inserts doesn't this whole issue just go
away? I used to have to mess with escaping strings and so forth. Now
that I compile and bind the strings to the statements, I don't have to
mess with it any more.
C
Thursday, May 8, 2008, 9:11:40 AM, you wrote:
PK> On 5/8/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> I am converting text data from another database into SQLite. Some text
>> data has embedded apostrophes like this:
>>
>> This was George's big day
>>
>> Other data has embedded double quotes like this:
>>
>> The box is 3" wide
>>
>> I am generating INSERT INTO statements for thousands of records to be used
>> in a Windows script to move the data into SQLite. I am needing to use
>> different statement (with different delmiters) for each of the above
>> 2 scenarios:
>>
>> INSERT INTO tbl VALUES("This was George's big day");
>> INSERT INTO tbl VALUES('The box is 3" wide');
PK> INSERT INTO tbl VALUES ('This was George''s big day');
PK> INSERT INTO tbl VALUES ('The box is 3" wide');
PK> The text delimiter in SQL is '
PK> You escape a ' with another '
>>
>> Double-quotes wrap the apostrophe in #1, apostrophes wrap the double-quote
>> in #2. But this means I need to parse the data content for every field in
>> order to generate the INSERTs. Is there a single set of delimiters that
>> would handle both scenarios without having to parse the data first?
>>
>> Chris
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Christopher F. Martin
>> School of Medicine
>> Center for Digestive Diseases & Nutrition
>> CB# 7555, 4104 Bioinformatics Bldg.
>> University of North Carolina at Chapel Hill
>> Chapel Hill, North Carolina 27599-7555
>> Phone: 919.966.9340 Fax: 919.966.7592
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>
PK> _______________________________________________
PK> sqlite-users mailing list
PK> [email protected]
PK> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
--
Best regards,
Teg mailto:[EMAIL PROTECTED]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users