comp.lang.ada
 help / color / mirror / Atom feed
From: briot.emmanuel@gmail.com
Subject: Re: Prepared_Statement :(
Date: Tue, 27 Nov 2018 00:51:54 -0800 (PST)
Date: 2018-11-27T00:51:54-08:00	[thread overview]
Message-ID: <77d44394-12c6-4102-8962-d576f2103822@googlegroups.com> (raw)
In-Reply-To: <ptj0a0$1non$1@gioia.aioe.org>

> 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...

Alternatively, use GNATCOLL and let it do the formatting for you. The OP
query could be written as :

  with Database;  --  generated via gnatcoll_db2ada
  declare
      PS     : Prepared_Statement  := Prepare(
         SQL_Insert
             ((Database.Exmo.Trades.Trade_Id = Integer_Param (1))
              & (Database.Exmo.Trades.Pair = Integer_Param (2))
              & ...));
  begin
      --  actual execution remains the same
  end;

Then whether you use sqlite, postgresql, or add a new backend to gnatcoll, the
code remains valid.

All of these are valid choices, and depends on your workflow

  reply	other threads:[~2018-11-27  8:51 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
2018-11-27  8:51             ` briot.emmanuel [this message]
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