Article View: borland.public.interbase.sql
Article #398Re: double quotes in value clauses
From: chrisgi
Date: Tue, 26 Feb 2008 16:04
Date: Tue, 26 Feb 2008 16:04
54 lines
3062 bytes
3062 bytes
thanks wayne
will the quotedstr be recognised at the server end ok
i am using firebird isql to process files when they have been sent to the server
thanks
chris
"Wayne Niddery \(TeamB\)" <wniddery@chaffaci.on.ca> wrote:
>"chrisgi" <chrisgi@omex.com> wrote in message
>news:47c43028$1@newsgroups.borland.com...
>>
>> can you explain what that is
>
>If you are executing the query yourself then a parameterized query is
>something offered by SQL database servers to provide more efficiency - you
>only need to give it an SQL query once, and then you can execute it any
>number of times with different parameters just by passing the parameters
>instead of the entire query.
>
>However, if you need to pass a complete script to another process then this
>won't work for you very well.
>
>> s.add (' VALUES ("' + account_number.Text + '","'
>> + controlcontrol_dsm.Text + '","'
>> + sqldate + '","O","'
>> + account_name.Text + '","'
>> + acc_address1.text + '","'
>> + acc_address2.text + '","'
>> + acc_address3.text + '","'
>> + acc_address4.text + '","'
>> + acc_postcode.Text + '","'
>> + acc_sec_mobile.text + '","'
>
>You are using double-quotes to delimit the values, but the SQL standard is
>to use single quotes. Double quotes are supposed to be used to indicate
>metadata such as table for field names. However, just changing that won't
>solve the problem of any of your values having embedded quotes. The solution
>to both is to use the QuotedStr function.
>
> s.add (' VALUES (' + QuotedStr(account_number.Text) + ','
> + QuotedStr(controlcontrol_dsm.Text) + ','
> + // etc...
>
>
>--
>Wayne Niddery - TeamB (www.teamb.com)
>Winwright, Inc. (www.winwright.ca)
>
Technical Details
Message-ID:
<47c44694$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!newsfeeder.dynfx.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<47c424be$1@newsgroups.borland.com> <47c42b1c$1@newsgroups.borland.com> <47c43028$1@newsgroups.borland.com> <47c4387c$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,5ae3542750123753 X-Google-Attributes: gid114a0e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "chrisgi" <chrisgi@omex.com> Sender: "chrisgi" <chrisgi@omex.com> Reply-To: "chrisgi" <chrisgi@omex.com> Subject: Re: double quotes in value clauses Newsgroups: borland.public.interbase.sql X-User-Info: 217.36.99.42 References: <47c424be$1@newsgroups.borland.com> <47c42b1c$1@newsgroups.borland.com> <47c43028$1@newsgroups.borland.com> <47c4387c$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <47c44694$1@newsgroups.borland.com> Date: 26 Feb 2008 09:04:20 -0700 X-Trace: newsgroups.borland.com 1204045460 207.105.83.66 (26 Feb 2008 09:04:20 -0700) Lines: 55 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!newsfeeder.dynfx.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail