comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Prepared_Statement :(
Date: Tue, 27 Nov 2018 09:46:56 +0100
Date: 2018-11-27T09:46:56+01:00	[thread overview]
Message-ID: <ptj0a0$1non$1@gioia.aioe.org> (raw)
In-Reply-To: 8d3pvdt79sessg38k2uo5s6lqr6u7m61p7@4ax.com

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


  reply	other threads:[~2018-11-27  8:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-24 10:45 Prepared_Statement :( eduardsapotski
2018-11-24 10:48 ` eduardsapotski
2018-11-24 11:05 ` Dmitry A. Kazakov
2018-11-24 11:20   ` eduardsapotski
2018-11-24 17:56     ` briot.emmanuel
2018-11-24 20:00       ` Simon Wright
2018-11-24 20:45       ` Dmitry A. Kazakov
2018-11-26  6:52       ` eduardsapotski
2018-11-27  0:27         ` Dennis Lee Bieber
2018-11-27  8:46           ` Dmitry A. Kazakov [this message]
2018-11-27  8:51             ` briot.emmanuel
2018-11-24 11:29 ` eduardsapotski
2018-11-27  9:58 ` eduardsapotski
2018-11-27 18:00   ` Dmitry A. Kazakov
2018-11-27 19:02     ` Björn Lundin
2018-11-28  5:04 ` eduardsapotski
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox