Re: [sqlite] [Delphi] Escaping quote?

2007-08-15 Thread MaxGyver
I'm not an expert on Aducom SQLite components, but anyway i'll try to help. Maybe you should consider using parameters in your query. Parameters in SQLite start with ':', '@' or '?', however ASGSQlite supports only ':' in my opinion. Your SQL query should look like this: INSERT INTO Stuff (Title)

Re: [sqlite] [Delphi] Escaping quote?

2007-06-27 Thread Ralf Junker
>Question, does the %q operator offer any advantages over calling QuotedStr ? Yes: The %q operator just duplicates internal quotes, it does insert quotes at the beginning and the end of the string like QuotedStr does. You can can still use sqlite3_mprintf's %Q operator for that. Ralf -

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread drh
"Clay Dowling" <[EMAIL PROTECTED]> wrote: > John Elrick wrote: > > >> A much better solution than QuotedStr is to use queries with parameters. > >> If you're going to be running the query multiple times it also gives you > >> a > >> speed boost. > >> > > > > True, however, that assumes you will be

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread Clay Dowling
John Elrick wrote: >> A much better solution than QuotedStr is to use queries with parameters. >> If you're going to be running the query multiple times it also gives you >> a >> speed boost. >> > > True, however, that assumes you will be running the query multiple times > in a row, which I haven

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread John Elrick
Clay Dowling wrote: John Elrick wrote: // Input := 'Let's meet at the pub tonight!'; MyFormat := 'insert into stuff (title) values (%s)'; SQL := Format(MyFormat, QuotedStr(Input)); try ASQLite3DB1.Database := db; ASQLite3DB1.DefaultDir := ExtractFileDir(Application.ExeName); ASQ

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread Clay Dowling
John Elrick wrote: > // Input := 'Let's meet at the pub tonight!'; > MyFormat := 'insert into stuff (title) values (%s)'; > SQL := Format(MyFormat, QuotedStr(Input)); > > try > ASQLite3DB1.Database := db; > ASQLite3DB1.DefaultDir := ExtractFileDir(Application.ExeName); > ASQLite3DB1.O

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread John Elrick
Ralf Junker wrote: I'm having a problem saving strings into a colum from a Delphi application because they might contain the ( ' ) single quote character: Is there a function I should call either in SQLite or Delphi before running the SQL query? Why don't you use the '%q' operator of SQ

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread Ralf Junker
>I'm having a problem saving strings into a colum from a Delphi application >because they might contain the ( ' ) single quote character: > >Is there a function I should call either in SQLite or Delphi before running >the SQL query? Why don't you use the '%q' operator of SQLite's sqlite3_mprint

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread John Elrick
Gilles Ganault wrote: Hello I'm having a problem saving strings into a colum from a Delphi application because they might contain the ( ' ) single quote character: = // Input := 'Let's meet at the pub tonight!'; MyFormat := 'insert into stuff (title) values ('''%s')'; SQL := Forma

[sqlite] [Delphi] Escaping quote?

2007-06-26 Thread Gilles Ganault
Hello I'm having a problem saving strings into a colum from a Delphi application because they might contain the ( ' ) single quote character: = // Input := 'Let's meet at the pub tonight!'; MyFormat := 'insert into stuff (title) values ('''%s')'; SQL := Format(MyFormat, Input); try