From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Prepared_Statement :( Date: Tue, 27 Nov 2018 09:46:56 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <9468b0a5-19bd-4057-a0d8-f84ed0425188@googlegroups.com> <8d3pvdt79sessg38k2uo5s6lqr6u7m61p7@4ax.com> NNTP-Posting-Host: MyFhHs417jM9AgzRpXn7yg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.3 Xref: reader01.eternal-september.org comp.lang.ada:54910 Date: 2018-11-27T09:46:56+01:00 List-Id: On 2018-11-27 01:27, Dennis Lee Bieber wrote: > On Sun, 25 Nov 2018 22:52:49 -0800 (PST), eduardsapotski@gmail.com > declaimed the following: > >>> "?" is how sqlite represents parameters. Postgresql uses $1, $2,... So the >>> https://www.postgresql.org/docs/10/sql-prepare.html >> Thenks! It really works! >> I did as in JDBC. It uses exactly '?'. > > JDBC is its own database interface. Parameter identifiers are specific > to the interface package in use. For a comparison, Python DB-API compatible > database adapters can use any of five parameter: > ? (replacement in order arguments provided) > :# (numbered position) > :name (actual parameter name) > %s (C printf format codes, %s in Python works for anything) > %(name)s (as above, but with parameter name to select) > One has to read the documentation for the specific adapter to know which to > use (or put in a lot of overhead code to query the adapter for the > "paramstyle" and then algorithmically generate statements using the proper > style). Ergo, if you can, never use any DB-specific bindings, use ODBC. It is not portable across RDBMs either (SQL is very not Ada (:-)), but at least it would give you far less headache... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de