comp.lang.ada
 help / color / mirror / Atom feed
* Gnatcoll SQL questions
@ 2015-07-08 20:21 NiGHTS
  2015-07-23 19:23 ` joakimds
  0 siblings, 1 reply; 2+ messages in thread
From: NiGHTS @ 2015-07-08 20:21 UTC (permalink / raw)


I am moderately experienced with the gnatcoll SQL library in that I have used it with success and have studied some of its code and methods. Currently I am using it as an interface to SQLite but may use it in the future for PostgreSQL.

Here are my questions.

1. How do I delete data? I know this sounds simple but I can't delete any data for the life of me. Here is an example of my code.

procedure proc
is
        Query  : GNATCOLL.SQL.SQL_Query;
        
begin
        Query := SQL_Delete ( 
                From  => data_db.Profiles,
                Where => data_db.Profiles.Id_Profiles = 1
        );
                
        Database_Connection.Execute ( Query );
        Database_Connection.Commit;
        
end proc;

Note that Database_Connection has been instantiated, initialized and has a good connection to the database. I also know this because the program can SELECT, UPDATE and INSERT just fine. But this particular DELETE function does nothing at all to the database. I have also tried it omitting the entire "Where" line so it deletes all items in the Profiles table and yet no success.


2. I would like to use GNATCOLL.SQL.Exec.Insert_And_Get_PK but I can't figure out how to work with it. Previously I used Last_ID after my Insert's commit but it always returned -1, so I figured it would be more effective to use Insert_And_Get_PK instead. I can't find any examples anywhere (period) so it would be great if I can get some pointers on how to use it.


In conclusion, why does the internet have so little documentation on Gnatcoll? I've read through the docs.adacode.com documentation on the SQL interface too many times to count but it is merely a basic overview. Does anyone know of a good source of reference for Gnatcoll other than the source code itself? Also helpful would be some kind of example source code, something I can study from someone else's work.


Thank you in advance for your help.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-23 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-08 20:21 Gnatcoll SQL questions NiGHTS
2015-07-23 19:23 ` joakimds

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