From: Jim Weirich Date: 2004-06-29T20:05:16+09:00 Subject: Re: SQLite-Ruby and "other chrs" Meino Christian Cramer wrote: > The initialization is ok, but from time to time the population of the > db breaks, cause some broadcasters station names include invalid > chars like > > R.N'Djamena > > and the "'" kills everything. > If you are using the DBI package to access the database, this is handled for you automatically when you use the ? markers in your SQL. E.g. db.do("INSERT INTO table(name) VALUES(?);", "R.N'Djamena") DBI will automatically expand the "?" into the properly escaped string for you. A lot of DBs will do this for you as well, I just know that DBI will handle even if the database does not. (There is also an escape method in the DBI somewhere that allows you to do it manually, but the ? method is much better). -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)