Re: SQL statement contain " character



If you are creating the sql dynamically why use parameters? I create sql
queries dynamically all the time, when I do that I avoid parameters. I
create the string with the value that would have been in the parameter as
part of the string.

Var
sqlST : string;
begin
sqlST := 'update Tablename set';
sqlST := sqlST + 'TextField = ' + edit.text; //or whatever var has the
value
..
..
sqlST := sqlST + 'where TableID = ..'

sqlObject.sql.Text := sqlST ;


With static queries parameters work well, if I'm creating the SQL dynamicly
I usually forget about parameters.

Bill
"Dave Albiston" <mail@xxxxxxxxxxxxxxxxxx> wrote in message
news:43dbae02$1@xxxxxxxxxxxxxxxxxxxxxxxxx
>I am constructing the SQL dynamically so I can't set parameter type.
>Looking at the source, it looks like the ADO component creates a
>parameterised statement on the fly. I suspect a bug in there because in
>some other statements the " character is acceptable.
>
> Dave
>
> Bill Hannan wrote:
>> It works for me delphi 7 and Sql 2000
>>
>> Parameter datatype ftString.
>>
>> I'd check your parameter data type.
>>
>> Bill
>


.



Relevant Pages

  • Re: In-Progress Save
    ... "Graham Mayor" wrote: ... > Dim strFileA As String ... > Bill wrote: ...
    (microsoft.public.word.docmanagement)
  • Re: nvarchar parameter not truncated based on size of field
    ... Bill, Thanks for the info. ... It's still kind of bothering me that this functionality has changed since ... ..NETCF 1.x - Truncates parameter automatically ... check the size of each string before assigning? ...
    (microsoft.public.sqlserver.ce)
  • Re: JobID, a pointer or just worthless?
    ... Bill thanks for sharing the code. ... >> ConnectedSubmit in fact returns the IDs in same format as the event ... >>> If the ConnectedSubmit returned a bool result then of course the only ... >>>>> Unique ID in this context is a string. ...
    (microsoft.public.win2000.fax)
  • Re: Fundamental Multi-table DataSet population
    ... William (Bill) Vaughn ... > to populating tables with related rows from a database. ... >> TSQL workaround, that would be helpful. ... >>> It's TSQL that balks at permitting you to pass a string into the IN ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Bypassing File Version Dialog on Save
    ... You are right, Bill. ... I have only solved question #2. ... >> Dim OldFileName As String ...
    (microsoft.public.excel.programming)