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!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Quick Oracle Connection ... Date: Mon, 15 Jan 2018 14:20:39 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <1477a253-ab0d-4368-bf6d-a36fb3c11611@googlegroups.com> <2fca0397-df30-4f36-8b26-293971134007@googlegroups.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 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: reader02.eternal-september.org comp.lang.ada:49912 Date: 2018-01-15T14:20:39+01:00 List-Id: On 15/01/2018 13:22, tonikaparallele@gmail.com wrote: > Thank you so much, Dimitry! In addition to my other activities, it > seems too time-consuming to understand everything to do some simple > database queries. You mean SQL, or how to create connection, prepare statement, bind arguments, walk the result set? > Is there any example programs?Unfortunately I have little experience > with communication ada-oracle. It is no different from how ODBC is used in other programming languages, a bit simpler because the environment, connection and statement objects are controlled, so there is less to care about releasing handles. There is a test program that calls all API operations, there are many Ada application programs that use ODBC. And you can easily translate C ODBC sample code. It quite straightforward: 1. Declare ODBC_Environment 2. Declare ODBC_Connection 3. Connect to the RDBMS 4. Declare ODBC_Command 5. Prepare (set a SQL statement) 6. Bind parameters, if any 7. Execute the command 8. Fetch the result set 9. Get_Data for a column of the fetched row in the result set, if any repeat 9 if many columns repeat 8 if many rows repeat 6 to execute same statement anew repeat 5 to execute another statement -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de